Describe the bug
The add plugin does not inherit the config from its parent. I noticed this while testing #2567 (1.7.1-alpha-b651f2ce.56).
To Reproduce
packages/product-1/src/graphql/index.tsx:
documents: "packages/product-1/src/**/*.graphql"
config:
skipDocumentsValidation: true
withHOC: true
withComponent: true
withHooks: true
hooksImportFrom: "react-apollo"
reactApolloImportFrom: "react-apollo"
plugins:
- add: "/* eslint-disable */"
- "typescript"
- "@n1ru4l/graphql-codegen-relay-optimizer-plugin"
- "typescript-operations"
- "typescript-react-apollo"
Workaround:
packages/product-1/src/graphql/index.tsx:
documents: "packages/product-1/src/**/*.graphql"
config:
skipDocumentsValidation: true
withHOC: true
withComponent: true
withHooks: true
hooksImportFrom: "react-apollo"
reactApolloImportFrom: "react-apollo"
plugins:
- add:
content:
- "/* eslint-disable */"
config:
skipDocumentsValidation: true
- "typescript"
- "@n1ru4l/graphql-codegen-relay-optimizer-plugin"
- "typescript-operations"
- "typescript-react-apollo"
Additional context
Should every plugin trigger a document validation? I know that documents might change between steps, so this might make sense, however, the add plugin could completely skip validation by default (since it does not interfere with the documents).
@n1ru4l Yeah it happens because when the parent/child config value is string, we can't really extend it as object :(
I think we need to find a good solution for that.
@n1ru4l had some time today, and I wanted to fix that for a long time :D Also, we can now bump version of plugins without bump everything, so we can easily introduce breaking changes in plugins as well.
Fixed it in: https://github.com/dotansimha/graphql-code-generator/pull/4509
Fixed in @graphql-codegen/[email protected] (also for time plugin)
Most helpful comment
@n1ru4l had some time today, and I wanted to fix that for a long time :D Also, we can now bump version of plugins without bump everything, so we can easily introduce breaking changes in plugins as well.
Fixed it in: https://github.com/dotansimha/graphql-code-generator/pull/4509