Socket
Socket
Sign inDemoInstall

@graphql-codegen/plugin-helpers

Package Overview
Dependencies
Maintainers
4
Versions
5481
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


Version published
Weekly downloads
7.1M
decreased by-5.46%
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 17 May 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc