Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@graphql-codegen/visitor-plugin-common
Advanced tools
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.
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);
Similar to @graphql-codegen/visitor-plugin-common, graphql-tools provides a set of utilities for working with GraphQL schemas, including schema stitching, mocking, and directives. While graphql-tools focuses more broadly on schema manipulation and execution, @graphql-codegen/visitor-plugin-common is specifically designed to aid in the development of code generation plugins.
This is the core package of GraphQL Code Generator ecosystem, which @graphql-codegen/visitor-plugin-common is a part of. While graphql-code-generator orchestrates the code generation process and manages plugin execution, @graphql-codegen/visitor-plugin-common provides the foundational utilities for creating those plugins.
FAQs
Unknown package
The npm package @graphql-codegen/visitor-plugin-common receives a total of 5,658,759 weekly downloads. As such, @graphql-codegen/visitor-plugin-common popularity was classified as popular.
We found that @graphql-codegen/visitor-plugin-common demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.