You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
Make sure to fork this template and run yarn generate in the terminal.
Please make sure the Codegen and plugins version under package.json matches yours.
2. A failing test has been provided
3. A local solution has been provided
4. A pull request is pending review
Describe the bug
I am attempting to write a graphql config that will auto-generate typescript code based on embedded gql templates in .ts files.
I have found a bug that is caused by .d.ts (typescript type definitions files) also being included in the documents glob.
To Reproduce
Steps to reproduce the behavior:
Use a configuration that includes .ts files. In this example, a .d.ts file may exist in src/global.d.ts.
Im experiencing the same issue, but I'm trying to exclude a local schema definition thats in a .graphql file.
Had no luck getting the file excluded trying the same things that @onthecais tried..
The reason I tried excluding the local schema is because it overrides a field with another type, which causes the error Error: Field "Foo.Bar" already exists in the schema. It cannot also be defined in this type extension..
Using graphql-codegen with a separate codegen.yaml file I worked around this issue using the ignoreFieldConflicts: true config parameter, because there I need to have this schema information included, successfully creating all my queries, mutations, types and so on.
But I could not get my vscode graphql extension to work again, because I can not exclude the local schema file, which I don't need for intellisense in my IDE.
Issue workflow progress
Progress of the issue based on the Contributor Workflow
Describe the bug
I am attempting to write a graphql config that will auto-generate typescript code based on embedded gql templates in .ts files.
I have found a bug that is caused by
.d.ts
(typescript type definitions files) also being included in the documents glob.To Reproduce
Steps to reproduce the behavior:
Use a configuration that includes .ts files. In this example, a .d.ts file may exist in
src/global.d.ts
.This config errors with:
Things I have tried:
"!(**/*.d.ts)"
src/**/!(.d)*.ts
exclude: "**/*.d.ts"
exclude: 'src/global.d.ts'
All of these have had no effect and .d.ts files are always included. I can only fix it by removing the
src/**/*.ts
entry.Expected behavior
.d.ts
files should be excluded and everything should work like magic.Environment:
@graphql-codegen/[email protected]
)Additional context
The text was updated successfully, but these errors were encountered: