graphql-tools-monorepo / loaders/graphql-file/src / GraphQLFileLoader
Class: GraphQLFileLoader
loaders/graphql-file/src.GraphQLFileLoader
This loader loads documents and type definitions from .graphql
files.
You can load a single source:
const schema = await loadSchema('schema.graphql', {
loaders: [
new GraphQLFileLoader()
]
});
Or provide a glob pattern to load multiple sources:
const schema = await loadSchema('graphql/*.graphql', {
loaders: [
new GraphQLFileLoader()
]
});
Implements
Table of contents
Constructors
Methods
Constructors
constructor
• new GraphQLFileLoader(): GraphQLFileLoader
Returns
Methods
canLoad
▸ canLoad(pointer
, options
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
pointer | string |
options | GraphQLFileLoaderOptions |
Returns
Promise
<boolean
>
Defined in
packages/loaders/graphql-file/src/index.ts:66
canLoadSync
▸ canLoadSync(pointer
, options
): boolean
Parameters
Name | Type |
---|---|
pointer | string |
options | GraphQLFileLoaderOptions |
Returns
boolean
Defined in
packages/loaders/graphql-file/src/index.ts:84
handleFileContent
▸ handleFileContent(rawSDL
, pointer
, options
): Object
Parameters
Name | Type |
---|---|
rawSDL | string |
pointer | string |
options | GraphQLFileLoaderOptions |
Returns
Object
Name | Type |
---|---|
document | DocumentNode |
location | undefined | string |
Defined in
packages/loaders/graphql-file/src/index.ts:200
load
▸ load(pointer
, options
): Promise
<Source
[]>
Parameters
Name | Type |
---|---|
pointer | string |
options | GraphQLFileLoaderOptions |
Returns
Promise
<Source
[]>
Implementation of
Defined in
packages/loaders/graphql-file/src/index.ts:128
loadSync
▸ loadSync(pointer
, options
): Source
[]
Parameters
Name | Type |
---|---|
pointer | string |
options | GraphQLFileLoaderOptions |
Returns
Source
[]
Implementation of
Defined in
packages/loaders/graphql-file/src/index.ts:165
resolveGlobs
▸ resolveGlobs(glob
, options
): Promise
<string
[]>
Parameters
Name | Type |
---|---|
glob | string |
options | GraphQLFileLoaderOptions |
Returns
Promise
<string
[]>
Defined in
packages/loaders/graphql-file/src/index.ts:102
resolveGlobsSync
▸ resolveGlobsSync(glob
, options
): string
[]
Parameters
Name | Type |
---|---|
glob | string |
options | GraphQLFileLoaderOptions |
Returns
string
[]