Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@graphql-tools/graphql-file-loader
Advanced tools
A set of utils for faster development of GraphQL tools
The @graphql-tools/graphql-file-loader package is a utility that allows you to load GraphQL schema definitions and type definitions from .graphql and .gql files. It integrates with other GraphQL tools to enable you to construct your GraphQL schema in a modular and organized way using separate files for different parts of your schema.
Loading GraphQL schema files
This feature allows you to load a GraphQL schema from a .graphql or .gql file synchronously. The `loadSchemaSync` function is used in conjunction with the `GraphQLFileLoader` to read the schema file and construct a GraphQLSchema object.
const { loadSchemaSync } = require('@graphql-tools/load');
const { GraphQLFileLoader } = require('@graphql-tools/graphql-file-loader');
const schema = loadSchemaSync('path/to/schema.graphql', {
loaders: [new GraphQLFileLoader()]
});
Loading GraphQL type definitions
This feature allows you to load GraphQL type definitions from a file. The `loadTypedefsSync` function is used to read type definitions from a .graphql or .gql file and can be used to compose a schema programmatically.
const { loadTypedefsSync } = require('@graphql-tools/load');
const { GraphQLFileLoader } = require('@graphql-tools/graphql-file-loader');
const typeDefs = loadTypedefsSync('path/to/types.graphql', {
loaders: [new GraphQLFileLoader()]
});
The graphql-import package allows you to import and use .graphql files in your JavaScript and TypeScript projects. It provides functionality similar to @graphql-tools/graphql-file-loader but with a different API and additional features like importing specific types from a schema file.
graphql-tag is a package that provides a template literal tag to parse GraphQL queries. While it does not directly load schema files, it is commonly used to define GraphQL queries and fragments within JavaScript files, which can then be composed into a full schema.
FAQs
A set of utils for faster development of GraphQL tools
The npm package @graphql-tools/graphql-file-loader receives a total of 3,269,992 weekly downloads. As such, @graphql-tools/graphql-file-loader popularity was classified as popular.
We found that @graphql-tools/graphql-file-loader 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.