kamilkisiela / graphql-config

One configuration for all your GraphQL tools (supported by most tools, editors & IDEs)
https://the-guild.dev/graphql/config
MIT License
1.16k stars 94 forks source link

Load order of configs is different from the documentation #1266

Open Arkham opened 1 year ago

Arkham commented 1 year ago

Issue workflow progress

Progress of the issue based on the Contributor Workflow


Describe the bug

From the docs page, the order that is used to load the configs should be:

  1. a package.json property.
  2. a JSON or YAML, extensionless "rc file".
  3. a "rc file" with the extensions .json, .yaml, .yml, .toml, .ts or .js.
  4. a .config.js CommonJS module, or a .config.ts Typescript module using cosmiconfig-typescript-loader

Instead in the implementation package.json comes after the "rc files": https://github.com/kamilkisiela/graphql-config/blob/523362dbb8bd81cc30838cde6e33f71e6979e7ab/src/helpers/cosmiconfig.ts#LL57-L74C5

To Reproduce

Expected behavior

The section inside the "package.json" should take precedence

Environment: