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

Docs: Clarify integrated configuration for other tools #1419

Open
bmulholland opened this issue Dec 9, 2023 · 1 comment
Open

Docs: Clarify integrated configuration for other tools #1419

bmulholland opened this issue Dec 9, 2023 · 1 comment

Comments

@bmulholland
Copy link

I'm migrating configuration from codegen and eslint to this config, but it's unclear what the mapping is.

For example:

  1. ESLint defines the "operations" value. Is "documents" in graphql-config read as "operations" by graphql-eslint?
  2. For codegen, the only mention is the "extensions" -- do I just drop my exact configuration from codegen into "extensions" and it works?
  3. It mentions "Now GraphQL Code Generator can consume that data" -- does that mean I have to specify the config file manually with --config option of codegen?
@bmulholland bmulholland changed the title Clarify integrated configuration for other tools Docs: Clarify integrated configuration for other tools Dec 9, 2023
@lensbart
Copy link

Agreed that it would be helpful if this could be clarified. If I currently follow the example from the docs and nest my entire existing graphql-codegen config in extensions: { codegen: { ... } } as suggested on that page, I get the following error when running graphql-codegen-esm --config graphql.config.ts:

✖ Invalid Codegen Configuration!
  Please make sure that your codegen config file contains the "generates" field, with a specification for the plugins you need.
  It should looks like that:
  schema:
  - my-schema.graphql
  generates:
  my-file.ts:
  - plugin1
  - plugin2
  - plugin3
◼ Generate outputs

It is unclear to me whether this is due to

  • Some wrong/missing CLI flag? (It seems like graphql-codegen doesn’t have a way to tell apart its own/specific config format, and the generic graphql-config format. Or is this done based on the file name only?)
  • Incorrect config object format?
  • Bug in one or the other NPM package?
  • Unsupported feature?

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

2 participants