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

@graphql-tools/graphql-file-loader

Package Overview
Dependencies
Maintainers
3
Versions
1041
Alerts
File Explorer

Advanced tools

Socket logo

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

  • 8.0.0-rc-20230519015308-f93ea91d
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9M
increased by8.83%
Maintainers
3
Weekly downloads
 
Created

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

Package last updated on 19 May 2023

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