Schemas and Types
Learn how to define a GraphQL schema with Deno.
We'll cover the following
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 atitle
,description
,price
, andidentifier
. - Author: An author can write many books and have these basic fields:
firstName
andlast name
. - Review: A book can have many reviews, each of which has a
rating
and acomment
.
Note: For the sake of simplicity, a single
Author
writes only oneBook
.
Take a look at the class diagram below to understand these relationships better:
Get hands-on with 1200+ tech skills courses.