GraphQL Queries and Schemas
Learn to understand the connection between GraphQL queries and schemas by examining object and scalar types, graph relationships, and how queries navigate these structures. This lesson helps you grasp schema design fundamentals and the role of types and edges in building effective GraphQL APIs with Elixir and Absinthe.
We'll cover the following...
Queries and schemas
Do you remember the user example from earlier and how our GraphQL server knew that the client could receive the user’s name, email, and friends? That worked because of cooperation between the GraphQL queries’ structure and the graph of types maintained in the schema. In the next couple of chapters, we’ll cover how we actually write Elixir code that builds this schema graph. Let’s look at a few diagrams that demonstrate this correspondence.
Let’s talk about another query that returns the data for a user profile. A basic diagram of the GraphQL schema might look like this:
This is a graph ...