Skip to content
This repository has been archived by the owner on Nov 3, 2018. It is now read-only.
/ require-graphql Public archive

Adds GraphQL schema file support to require()

License

Notifications You must be signed in to change notification settings

outmoded/require-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Adds GraphQL schema file support to require()

Resources

License

Stars

Watchers

Forks

Packages

No packages published