dotansimha / dotansimha/graphql-code-generator
Naming collision in generated files
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
Description
**Describe the bug**
I had an enum called `DataQuery` in my schema. I also defined a query operation `DataQuery`. I'm using the `react-query` plugin, it outputs a function `useDataQuery` and a corresponding `DataQuery` interface for the return type. It also generates a `DataQuery` corresponding to my enum. This generates a collision `Enum declarations can only merge with namespace or other enum declarations.ts(2567)`
**Expected behavior**
I suppose it should refuse to generate the code rather than generating invalid code. It was easy enough to workaround by renaming my query or enum, but the tool could be a bit more defensive.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.