Class: JsonFileLoader
Defined in: packages/loaders/json-file/src/index.ts:49
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:50
Parameters
pointer
string
options
Returns
Promise<boolean>
canLoadSync()
canLoadSync(
pointer,options):boolean
Defined in: packages/loaders/json-file/src/index.ts:68
Parameters
pointer
string
options
Returns
boolean
handleFileContent()
handleFileContent(
normalizedFilePath,rawSDL,options):Source
Defined in: packages/loaders/json-file/src/index.ts:168
Parameters
normalizedFilePath
string
rawSDL
string
options
Returns
load()
load(
pointer,options):Promise<Source[]>
Defined in: packages/loaders/json-file/src/index.ts:96
Parameters
pointer
string
options
Returns
Promise<Source[]>
Implementation of
loadSync()
loadSync(
pointer,options):Source[]
Defined in: packages/loaders/json-file/src/index.ts:133
Parameters
pointer
string
options
Returns
Source[]
Implementation of
resolveGlobs()
resolveGlobs(
glob,options):Promise<string[]>
Defined in: packages/loaders/json-file/src/index.ts:86
Parameters
glob
string
options
Returns
Promise<string[]>
resolveGlobsSync()
resolveGlobsSync(
glob,options):string[]
Defined in: packages/loaders/json-file/src/index.ts:91
Parameters
glob
string
options
Returns
string[]