New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@graphql-codegen/plugin-helpers

Package Overview
Dependencies
Maintainers
4
Versions
5523
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-codegen/plugin-helpers

GraphQL Code Generator common utils and types

5.1.0-alpha-20241023133807-d6d53d85bc02e66416e5a006ac6e320152517004
Source
npm
Version published
Weekly downloads
8.6M
5.68%
Maintainers
4
Weekly downloads
 
Created

What is @graphql-codegen/plugin-helpers?

The @graphql-codegen/plugin-helpers package provides utility functions and types that are used to develop plugins for GraphQL Code Generator. It helps with the creation of custom plugins by providing common functionalities such as schema and document handling, plugin validation, and configuration management.

What are @graphql-codegen/plugin-helpers's main functionalities?

Validate Plugins

This feature allows developers to validate the structure of plugins to ensure they conform to the expected interface required by GraphQL Code Generator.

const { validatePlugins } = require('@graphql-codegen/plugin-helpers');

const plugins = [
  { plugin: require('some-graphql-codegen-plugin') }
];

validatePlugins(plugins);

Normalize Output Parameters

This utility normalizes output parameters, which can be used to handle file paths and names in a consistent manner across different plugins.

const { normalizeOutputParam } = require('@graphql-codegen/plugin-helpers');

const output = 'path/to/output.ts';
const normalizedOutput = normalizeOutputParam(output);

Create Schema AST

This function is used to create a GraphQL schema AST from a GraphQL schema object, which can then be used by plugins to generate code.

const { createSchemaAst } = require('@graphql-codegen/plugin-helpers');
const { buildSchema } = require('graphql');

const schema = buildSchema(`type Query { hello: String }`);
const schemaAst = createSchemaAst(schema);

Other packages similar to @graphql-codegen/plugin-helpers

FAQs

Package last updated on 23 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts