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 93 forks source link

Docs: Clarify integrated configuration for other tools #1419

Open bmulholland opened 6 months ago

bmulholland commented 6 months ago

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?
lensbart commented 6 months ago

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