Skip to content

Load order of configs is different from the documentationΒ #1266

@Arkham

Description

@Arkham

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions