Named Fragments in GraphQL

Learn what named fragments are and how we use named fragments.

We'll cover the following

Using named fragments

In one of the previous lessons, we introduced fragments, using the inline variety to associate parts of GraphQL documents with specific types. Named fragments are just like inline fragments, but they’re reusable.

Let’s give that search query another look. This time, we break out the fields for menu items and categories:

Get hands-on with 1400+ tech skills courses.