
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@graphql-codegen/add
Advanced tools
GraphQL Code Generator plugin for adding custom content to your output file
The @graphql-codegen/add package is a plugin for GraphQL Code Generator that allows you to prepend custom content to the output file. It is useful for adding custom imports, comments, or any other content that should be included at the top of the generated file.
Prepending custom content
This feature allows you to add custom text to the beginning of the generated file. In the code sample, a custom comment is added to the top of the file.
"plugins": [
{
"add": "// This is a custom comment added to the top of the file"
}
]
Adding custom imports
With this feature, you can prepend custom import statements to your generated file. The code sample demonstrates how to add a custom import for a function.
"plugins": [
{
"add": "import myCustomFunction from './myCustomFunction';\n"
}
]
Combining with other plugins
This feature showcases how @graphql-codegen/add can be used in conjunction with other plugins. The code sample prepends an eslint-disable comment before the rest of the code generated by the typescript and typescript-resolvers plugins.
"plugins": [
{
"add": "/* eslint-disable */\n"
},
"typescript",
"typescript-resolvers"
]
The graphql-import package allows you to import and export types in your GraphQL schema files. It is similar to @graphql-codegen/add in that it helps manage and modularize your GraphQL schema, but it does not generate code or prepend content to files.
graphql-tools is a comprehensive package for working with GraphQL in JavaScript. It includes functionality for schema stitching and mocking, among other things. While it is not specifically for code generation like @graphql-codegen/add, it does offer utilities that can be used in the code generation process.
graphql-tag is a package for parsing GraphQL queries in JavaScript. It is used to embed GraphQL queries in JavaScript code. Unlike @graphql-codegen/add, it does not generate code or allow for custom content to be prepended, but it is a common tool used in the GraphQL ecosystem.
FAQs
GraphQL Code Generator plugin for adding custom content to your output file
The npm package @graphql-codegen/add receives a total of 1,889,310 weekly downloads. As such, @graphql-codegen/add popularity was classified as popular.
We found that @graphql-codegen/add demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.