Moving On

In this chapter, we learned how to build the foundation of a GraphQL schema in an Elixir application, defining an object type that we exposed via a query field, and we tested our fledgling API using a popular tool, GraphiQL.

Here are a couple challenges for you before we move on:

  1. We’ve defined :id and :name fields for our MenuItem object type. The backing Ecto schema, PlateSlate.Menu.Item, has a number of other fields we could also expose in our GraphQL schema. Define another one using one of the built-in scalar types we mentioned earlier.
  2. Add descriptions for the fields inside the MenuItem object type, using the @desc form. Don’t stop there: you can use it to add a description for the object type itself, too. Verify that GraphiQL is ...

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.