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 ...

Get Craft GraphQL APIs in Elixir with Absinthe now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.