concept datum in category graphql

appears as: data, data, The data
GraphQL in Action

This is an excerpt from Manning's book GraphQL in Action.

The word "graph" in GraphQL comes from the fact that the best way to represent data in the real world is with a graph-like data structure. If you analyze any data model, big or small, you’ll always find it to be a graph of objects with many relations between them.

That was the first "aha" moment for me when I started learning about GraphQL. Why think of data in terms of resources (in URLs) or tables when you can beautifully think of it as a graph?

The error message here was a helpful one. The path "person" must provide id or personID. Since we are asking the server about ONE person, it needs a way to identify which person’s data to return. Note again that this was not a syntax problem but rather a missing-required-value problem.

Root fields are also usually used to access certain types of data referenced by a unique identifier. For example:

# Ask for the user whose ID equal to 42
{
  user(id: 42) {
    fullName
  }
}

In this query, the field user represents one of many users in a graph of data. To instruct the server to pick one user, we specify a unique ID value for the user field.

Figure 5.8. Note how the response has both errors and data
ch05 fig 10 gqlia
Fullstack GraphQL Applications With GRANDstack

This is an excerpt from Manning's book Fullstack GraphQL Applications With GRANDstack.

At its heart GraphQL is a specification for building APIs. The GraphQL specification describes an API query language and a way for fulfilling those requests. When building a GraphQL API we describe the data available using a strict type system. These type definitions become the specification for the API, and the client is free to request the data it requires based on these type definitions, which also define the entry points for the API.

Now that we have our type definitions we need to define the entry points for our API. The entry points for read operations are defined in a special type called the Query type. Entry points for write operations are defined in a special type called the Mutation type. In this chapter we focus only on queries, mutations will be covered in a future chapter where we will be updating data in a database.

Figure 3.8. Creating data with Cypher and Neo4j Browser
neo4j browser create