14. Exercise: Query the supergraph
1m

Exercise: Query the supergraph

🎯 Goal: Build a that enables the client to display the data needed for the mockup below.

Mockup of the homepage

Bonus

  • Find the Explorer settings that shows you which is responsible for resolving each .
  • How can you view the for your query?
Task!

Solution

  1. Head over to Explorer.

  2. We can now see the new available in the Documentation tab.

  3. Build the :

    query HomepageWithLocationsAndActivities {
    ... @defer {
    featuredLocation {
    id
    name
    photo
    }
    }
    locations {
    id
    name
    photo
    description
    }
    activities {
    id
    name
    photo
    terrain
    stats {
    groupSize
    averageTemperature
    gravity
    }
    }
    }

Bonus:

  1. Click the settings icon in the left panel and turn on Editor hints.

  2. Turn on Subgraph source. Now you can see which are responsible for which in your !

  3. Click the arrow beside Response and change to Query Plan Preview.

Previous

Share your questions and comments about this lesson

Your feedback helps us improve! If you're stuck or confused, let us know and we'll help you out. All comments are public and must follow the Apollo Code of Conduct. Note that comments that have been resolved or addressed may be removed.

You'll need a GitHub account to post below. Don't have one? Post in our Odyssey forum instead.