...
/Create Reusable Query Units and Fields Using Fragments
Create Reusable Query Units and Fields Using Fragments
Learn about the GraphQL fragments used to prevent duplication of GraphQL queries.
We'll cover the following...
Let’s say our customer base has grown, and our new clients require more information. For example, the clients want to compare pizzas side-by-side while also looking at the available toppings. This operation would need us to repeat the fields at least once for each comparison.
GraphQL fragments
GraphQL fragments allow us to build sets of fields and then use them in queries as needed.