-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
waiting-for-answerWaiting for answer from authorWaiting for answer from author
Description
Describe the bug
I have two separate queries, with separate fragments (named the same).
These queries are in different directories within my project, so I would expect both of them to create separate EntityFragment
types in the generated files.
Instead, I receive this error:
yarn run v1.22.4
$ graphql-codegen --config codegen.yml
Multiple fragments with the name(s) "entity" were found.
Multiple fragments with the name(s) "entity" were found.
Not all fragments have an unique name: entity
Not all fragments have an unique name: entity
Something went wrong
error Command failed with exit code 1.
To Reproduce
Steps to reproduce the behavior:
- My GraphQL schema:
File 1:
fragment entity on Entity {
id
somefield
}
File 2:
fragment entity on Entity {
id
someotherfield
}
- My
codegen.yml
config file:
overwrite: true
errorsOnly: true
schema:
- schema.graphql:
loader: "./app/scripts/webpack/graphql-schema.js"
documents: "src/**/*.graphql"
generates:
src/js/shared/@types/graphql.d.ts:
plugins:
- "typescript"
config:
skipTypename: true
useTypeImports: true
declarationKind: "interface"
src/:
preset: near-operation-file
presetConfig:
extension: .generated.ts
baseTypesPath: js/shared/@types/graphql.ts
plugins:
- "typescript-operations"
- "typed-document-node"
config:
skipTypename: true
declarationKind: "interface"
Expected behavior
Environment:
- OS: Ubuntu
"@graphql-codegen/cli": "1.19.1",
"@graphql-codegen/near-operation-file-preset": "^1.17.12",
"@graphql-codegen/typed-document-node": "^1.17.10",
"@graphql-codegen/typescript": "1.17.11",
"@graphql-codegen/typescript-operations": "1.17.9",
- NodeJS: 14.7.0
Additional context
Metadata
Metadata
Assignees
Labels
waiting-for-answerWaiting for answer from authorWaiting for answer from author