Schemas and Types

Learn how to define a GraphQL schema with Deno.

Data model

Now let’s take a look at how we can create a GraphQL schema with Deno with the help of an example. Let’s consider three entities:

  • Book: A book is written by an Author, and it has a title, description, price, and identifier.
  • Author: An author can write many books and have these basic fields: firstName and last name.
  • Review: A book can have many reviews, each of which has a rating and a comment.

Note: For the sake of simplicity, a single Author writes only one Book.

Take a look at the class diagram below to understand these relationships better:

Get hands-on with 1200+ tech skills courses.