Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load order of configs is different from the documentation #1266

Open
4 tasks
Arkham opened this issue Feb 22, 2023 · 0 comments
Open
4 tasks

Load order of configs is different from the documentation #1266

Arkham opened this issue Feb 22, 2023 · 0 comments

Comments

@Arkham
Copy link

Arkham commented Feb 22, 2023

Issue workflow progress

Progress of the issue based on the Contributor Workflow

  • 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox

    Make sure to fork this template and run yarn generate in the terminal.

    Please make sure the Codegen and plugins version under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

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

  • Create a .graphqlrc.js
  • Add a "codegen" section to your "package.json"

Expected behavior

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

Environment:

  • OS: any
  • GraphQL Config Version: latest
  • NodeJS: any
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant