March 2018
Intermediate to advanced
304 pages
6h 59m
English
A GraphQL query is the way that API users can ask for specific pieces of information. We’ve defined the shape of our GraphQL MenuItem type, but to support users getting menu items, we need to provide two things:
The key to the first objective is defining a special object type to serve as the entry point for queries on a GraphQL schema. We already defined it when we used the query macro earlier.
The query macro is just like object, but it handles some extra defaults for us that Absinthe expects. Since we’ve already defined a blank query object, let’s take a look at what it looks like in IEx, too:
| | iex(1)> Absinthe.Schema.lookup_type(PlateSlateWeb.Schema, ... |
Read now
Unlock full access