Specifying Schema
Specifying Schema — GraphQL Config documentation.
The simplest config specifies only schema which points to the source of GraphQL schema.
GraphQL Config can start with a single schema and grow from there.
Multiple Files
GraphQL Config can also assemble multiple modularized schemas into a single GraphQL schema object.
You can specify a list of files:
Alternatively, you can use a glob pattern to find and include pieces of schema:
GraphQL Config looks for those files, reads the files and merges them to produce a GraphQL schema object.
Introspection Result
A very common way to describe a GraphQL schema is to run an introspection query on it and save the resulting output as a JSON file. GraphQL Config can also read these files into schema objects.
Note that JSON introspection results are parsed for both file validity and for schema validity; if either check fails, an error message will be passed back to the caller.
Endpoint
In case you want to access a running GraphQL server via its endpoint, you can pass its address into the configuration file.
Environment Variables
It is possible to load definitions from environment variables, with or without fallback values.
If you want to define a fallback endpoint you may wrap your value with quotation marks.
Passing Headers
If you need to pass headers in the schema request you can do it this way: