How to prevent or eliminate duplicated fields with GraphQL?

How to prevent or eliminate duplicated fields with GraphQL?


2

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


Load 7 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *