dotansimha / dotansimha/graphql-code-generator
Codegen doesn't fail when identical operations are present in multiple files
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
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
1. Clone [https://codesandbox.io/p/devbox/zealous-leakey-cwjm77]()
2. 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
* `graphql` version: ^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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.