graphql-query-rewriter / core

Seamlessly turn breaking GraphQL changes into non-breaking changes
https://graphql-query-rewriter.github.io/core
MIT License
407 stars 15 forks source link

How to fix collisions #52

Open zmay2030 opened 1 year ago

zmay2030 commented 1 year ago

Hello, Trying to figure out how we should approach this issue. If we are rewriting a scalar field to an object, it replaces all fields with the name.

So we want to rewrite the the user's name scalar to an object, it will also replace the one for city

query {
   user {
     name
   }
   city {
      name
   }
}

I know we can filter by fragmentMatchCondition or queryMatchCondition. But that would mean we expect the user to either use fragments or give consistent names for their queries? Let me know if this makes sense, I feel like I may be missing something...