apollographql / apollo-tooling

✏️ Apollo CLI for client tooling (Mostly replaced by Rover)
https://apollographql.com
MIT License
3.04k stars 470 forks source link

Codegen should throw error on duplicate fragment names #1706

Open glentakahashi opened 4 years ago

glentakahashi commented 4 years ago

Intended outcome:

apollo client:codegen should throw an error if two fragments are named the same, similar to how it already does this for mutations + queries.

Actual outcome:

The last fragment for a given name will overwrite all the other ones.

How to reproduce the issue:

Repro here: https://github.com/glentakahashi/apollo-codegen-fragment-test

yarn gql creates graphql.d.ts without throwing an error which has only the fragment from b.ts, which has overwritten a.ts

Versions

2.21.1

glentakahashi commented 4 years ago

Potential fix here: https://github.com/apollographql/apollo-tooling/pull/1707

B1rch commented 2 years ago

I see that the PR for the fix has been closed. I was wondering what the reasoning behind this is, as I'm running into this issue as well in my project.

glentakahashi commented 2 years ago

the PR had been open for > 2 years and the team didn't seem to be getting around to it. We've moved onto a different tool, so you're welcome to re-open a new PR with my changes to try and get it merged again