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.