Socket
Socket
Sign inDemoInstall

@graphql-tools/graphql-file-loader

Package Overview
Dependencies
35
Maintainers
3
Versions
1029
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @graphql-tools/graphql-file-loader

A set of utils for faster development of GraphQL tools


Version published
Weekly downloads
3.5M
decreased by-0.73%
Maintainers
3
Install size
1.25 MB
Created
Weekly downloads
 

Package description

What is @graphql-tools/graphql-file-loader?

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.

What are @graphql-tools/graphql-file-loader's main functionalities?

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()]
});

Other packages similar to @graphql-tools/graphql-file-loader

FAQs

Last updated on 23 Feb 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc