Commit
emitLegacyCommonJSImports
flag (#8077)
* feat: add `emitLegacyCommonJSImports` flag * add changeset * update docs * fix * fix(emitLegacyCommonJSImports): normalize value across plugins and presets + fix specs Introduced a `shouldEmitLegacyCommonJSImports()` helper to get proper value Co-authored-by: Charly POLY <cpoly55@gmail.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
'@graphql-codegen/cli': minor | ||
'@graphql-codegen/visitor-plugin-common': minor | ||
'@graphql-codegen/gql-tag-operations': minor | ||
'@graphql-codegen/near-operation-file-preset': minor | ||
'@graphql-codegen/plugin-helpers': minor | ||
--- | ||
|
||
Add new flag to emit legacy common js imports. Default it will be `true` this way it ensure that generated code works with [non-compliant bundlers](https://github.com/dotansimha/graphql-code-generator/issues/8065). | ||
|
||
You can use the option in your config: | ||
```yaml | ||
schema: 'schema.graphql' | ||
documents: | ||
- 'src/**/*.graphql' | ||
emitLegacyCommonJSImports: true | ||
``` | ||
|
||
Alternative you can use the CLI to set this option: | ||
```bash | ||
$ codegen --config-file=config.yml --emit-legacy-common-js-imports | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
2cbcbb3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
graphql-code-generator – ./
graphql-code-generator-theguild.vercel.app
graphql-code-generator.vercel.app
graphql-code-generator-git-master-theguild.vercel.app
www.graphql-code-generator.com
graphql-code-generator.com
graphql-codegen.com
www.graphql-codegen.com