-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Which packages are impacted by your issue?
@graphql-codegen/core
Describe the bug
Codegen doesn't throw any error if identical operations are present in different files
Your Example Website or App
https://codesandbox.io/p/devbox/zealous-leakey-cwjm77
Steps to Reproduce the Bug or Issue
- Clone https://codesandbox.io/p/devbox/zealous-leakey-cwjm77
- run
yarn codegen
Expected behavior
Expected to see Not all operations have an unique name: user: error
Screenshots or Videos
No response
Platform
- OS: any
- NodeJS: ^22
graphqlversion: ^16@graphql-codegen/*version(s): ^4
Codegen Config File
No response
Additional context
We do see the error when, in any of the file, we add a new field or remove a field, marking these operations as not identical.
I think this can cause problems for a huge team if everyone is adding an identical operation in their own files, and suddenly adding another field breaks the codegen. IMO, the codegen should have failed the moment same name operations were introduced, and it should have forced devs to create a common gql file.
Metadata
Metadata
Assignees
Labels
No labels