© Thomas Frisendal 2018
Thomas FrisendalVisual Design of GraphQL Datahttps://doi.org/10.1007/978-1-4842-3904-9_9

9. From Graph to Trees

Thomas Frisendal1 
(1)
Copenhagen S, Denmark
 

Structure Design at the API Level

The schema definitions are on the server side. What you see at the application side is being exposed as a result of the schema design.

The GraphQL list modifier is an easy way to generate a sub-branch of the result tree. In our Email example, we have plenty of lists. For example, the keywords tagging a message:
keywords: [Keyword] @relation(name: "Tags")
Lists can handle nulls, which are syntactically visualized in GraphQL:
  • The data can be null: [Keyword]

  • The data cannot be null: [Keyword!]

  • The list cannot be null: [Keyword!]!

Another GraphQL construct ...

Get Visual Design of GraphQL Data: A Practical Introduction with Legacy Data and Neo4j 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.