Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@graphql-codegen/visitor-plugin-common

Package Overview
Dependencies
Maintainers
5
Versions
5994
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-codegen/visitor-plugin-common

  • 1.0.4-alpha-485d1b53.18
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.9M
increased by5.59%
Maintainers
5
Weekly downloads
 
Created

What is @graphql-codegen/visitor-plugin-common?

The @graphql-codegen/visitor-plugin-common package provides a set of utilities and base classes for developing custom plugins for GraphQL Code Generator. These tools facilitate the creation of plugins by handling common tasks such as schema traversal and type mapping, allowing developers to focus on the specific logic of their plugins.

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

Schema Visitor

This feature allows developers to create custom visitors that can traverse a GraphQL schema. Developers can extend the SchemaVisitor class and override methods corresponding to different schema elements, such as types, fields, and directives, to implement custom behavior.

"use strict";
const { SchemaVisitor } = require('@graphql-codegen/visitor-plugin-common');
class MyCustomVisitor extends SchemaVisitor {
  visitFieldDefinition(field) {
    // Custom logic for visiting field definitions
  }
}
module.exports = MyCustomVisitor;

Plugin Helpers

This feature provides utility functions that assist in common plugin development tasks, such as mapping GraphQL scalars to language-specific types. The `buildScalars` function, for example, takes a schema and a mapping configuration as input and outputs a mapping of GraphQL scalar names to the specified custom types.

"use strict";
const { buildScalars } = require('@graphql-codegen/visitor-plugin-common');
const config = {
  scalars: {
    DateTime: 'Date'
  }
};
const builtScalars = buildScalars(schema, config.scalars);
console.log(builtScalars);

Other packages similar to @graphql-codegen/visitor-plugin-common

FAQs

Package last updated on 25 Mar 2019

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