How to prevent or eliminate duplicated fields with GraphQL?

222 Views Asked by At

Is it anti pattern to prevent or eliminate duplicated fields in GraphQL? for example, this query has the same id field 10 times and even tho it doesn't return the value 10 times, but it's increasing the query cost, so, what is the best way to deal with this? how can I prevent querying duplicated fields?

query Viewer { me { id id id id id id id id id id } }

I couldn't find much online. I'm using GraphQL-Yoga on the server

0

There are 0 best solutions below