Socket
Socket
Sign inDemoInstall

@graphql-codegen/plugin-helpers

Package Overview
Dependencies
31
Maintainers
4
Versions
5457
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @graphql-codegen/plugin-helpers

GraphQL Code Generator common utils and types


Version published
Weekly downloads
5.9M
decreased by-19.57%
Maintainers
4
Install size
2.52 MB
Created
Weekly downloads
 

Package description

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

Last updated on 06 Feb 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc