Complex Queries
Now that we have a session management story for our admin UI, we can tackle exposing more sensitive information. What we want to do is provide an order history that we’ll display on each menu item show page. We’ll have to start by adding some fields to our GraphQL schema in order to connect menu items over to the orders, and we’ll need to do a few tweaks at the database and context level to make pulling the data out easy.
What we’ll get for this effort, though, is pretty cool. Not only will it give us the ability to show this information on the show page, but we’ll also suddenly have the ability to display a subset of the information back on the index page, and we’ll have set up everything the next chapter needs to do the same ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access