1.0.0 • Published 6 years ago

require-graphql v1.0.0

Weekly downloads
6
License
BSD-3-Clause
Repository
github
Last release
6 years ago

require-graphql

Adds GraphQL schema file support to require()

Usage

Require the extension:

require('require-graphql');

Then require your GraphQL schema file:

require('./your_schema_file.graphql');

The extension allows dropping the GraphQL schema file extension:

require('./your_schema_file');

As well as to skip separately requiring GraphQL:

const Graphql = require('require-graphql');

Which is the same as:

require('require-graphql');
const Graphql = require('graphql');

Note that this module does not include a dependency on the GraphQL module to avoid version conflicts. It will load whatever GraphQL module is already loaded by your package.json file.