Config search places
.graphqlrc(YAML and JSON)
The simplest config specifies only
schema which points to the source of GraphQL Schema.
Based on the above example you may think GraphQL Config accepts only single graphql files, but it does more than that.
To learn more about possible sources of GraphQL schema read the "Specifying schema" chapter.
Another piece of GraphQL may be operations and fragments. In GraphQL Config we call them
Include / Exclude
When you want to point out files related to the schema--for instance, React components--and make your IDE GraphQL Extension recognize those files, you can
Remember that all files specified in
documentsare included by default.
In order to pass information to GraphQL Config's consumers (like IDE extensions, Node libraries), you can use an
extensions section that is a key-value object.
Now GraphQL Code Generator is able to consume that data.
GraphQL Config allows you to define multiple projects within the same config file.
Consider, for instance, writing the following configuration:
This basically creates a singular, default project. In order to extend configuration to multiple projects, you can use the following approach:
It's also possible to define many projects where one is the default. You can simply add
default as that project's name: