Class: JsonFileLoader
Defined in: packages/loaders/json-file/src/index.ts:54
This loader loads documents and type definitions from JSON files.
The JSON file can be the result of an introspection query made against a schema:
const schema = await loadSchema('schema-introspection.json', {
loaders: [
new JsonFileLoader()
]
});Or it can be a DocumentNode object representing a GraphQL document or type definitions:
const documents = await loadDocuments('queries/*.json', {
loaders: [
new GraphQLFileLoader()
]
});Implements
Constructors
Constructor
new JsonFileLoader():
JsonFileLoader
Returns
JsonFileLoader
Methods
canLoad()
canLoad(
pointer,options):Promise<boolean>
Defined in: packages/loaders/json-file/src/index.ts:55
Parameters
pointer
string
options
Returns
Promise<boolean>
canLoadSync()
canLoadSync(
pointer,options):boolean
Defined in: packages/loaders/json-file/src/index.ts:73
Parameters
pointer
string
options
Returns
boolean
handleFileContent()
handleFileContent(
normalizedFilePath,rawSDL,options):Source
Defined in: packages/loaders/json-file/src/index.ts:175
Parameters
normalizedFilePath
string
rawSDL
string
options
Returns
load()
load(
pointer,options):Promise<Source[]>
Defined in: packages/loaders/json-file/src/index.ts:103
Parameters
pointer
string
options
Returns
Promise<Source[]>
Implementation of
loadSync()
loadSync(
pointer,options):Source[]
Defined in: packages/loaders/json-file/src/index.ts:140
Parameters
pointer
string
options
Returns
Source[]
Implementation of
resolveGlobs()
resolveGlobs(
glob,options):Promise<string[]>
Defined in: packages/loaders/json-file/src/index.ts:91
Parameters
glob
string
options
Returns
Promise<string[]>
resolveGlobsSync()
resolveGlobsSync(
glob,options):string[]
Defined in: packages/loaders/json-file/src/index.ts:97
Parameters
glob
string
options
Returns
string[]