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

Config is not loaded from package.json #692

Closed
ionut-botizan opened this issue May 13, 2021 · 1 comment · Fixed by #693
Closed

Config is not loaded from package.json #692

ionut-botizan opened this issue May 13, 2021 · 1 comment · Fixed by #693

Comments

@ionut-botizan
Copy link
Contributor

Describe the bug
The default search locations of cosmicconfig are overwritten and the package.json option is left out, so configs are not loaded from it.
The culprit: https://github.com/kamilkisiela/graphql-config/blob/master/src/helpers/cosmiconfig.ts#L71
The original: https://github.com/davidtheclark/cosmiconfig/blob/main/src/index.ts#L109

To Reproduce
Steps to reproduce the behavior:

  1. Define a graphql configuration in package.json
  2. Try to load it using loadConfigSync

A Codesandbox example where configurations are loaded from .#rc files, #.config.js files, but not from package.json:
https://codesandbox.io/s/graphql-config-ignoring-packagejson-nergw?file=/src/index.js

Expected behavior
The loadConfigSync function should load the graphql configuration from the package.json file, as per the graphql-config documentation and the default behavior of cosmiconfig

Environment:

  • OS: All
  • GraphQL Config Version: 3.2.0
  • NodeJS: All
@kamilkisiela
Copy link
Owner

v3.3.0

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

Successfully merging a pull request may close this issue.

2 participants