There are many ways to configure your application to use GraphQL, and while it is often enough to specify configuration options directly in your application code, maintaining and understanding the hard-coded configuration options may become a challenge as the scale grows. We recommend configuring your application with a
.graphqlrc file that contains commonly needed GraphQL-related artifacts.
Think about GraphQL Config as one configuration for all your GraphQL tools.
The basic idea is to have one configuration file that any GraphQL tool could consume.
As a developer
From the developer perspective, you gain simplicity and a central place to setup libraries, tools and your IDE extensions.
As a library author
From the point of view of a library author, GraphQL Config makes it easier to maintain the code responsible for handling configuration, loading GraphQL schemas or even files with GraphQL operations and fragments. GraphQL Config provides a set of useful methods and an easy-to-work-with API.
Learn more in usage docs
custom extension paths with
We are using
cosmiconfig to load the schema, and it uses the following flow to look for configurations:
- a JSON or YAML, extensionless "rc file"
- an "rc file" with the extensions .json, .yaml, .yml, or .js.