concept list in category graphql

appears as: list, The list, lists
GraphQL in Action

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

To see a list of other GraphQL server libraries checkout az.dev/graphql-servers.

Note how within an edges field we are now asking about a single node field because the list is no longer a list of nodes but rather a list of edges where each edge is a node + cursor.

This query will show the names and description for each directive and it will also include an array of all possible locations where that directive can be used. In addition, it will also include a list of all arguments supported by that directive. Each directive can optionally receive a list of arguments, and just like field arguments some argument values might be required by the API server. The response to the previous query should show that in any GraphQL schema both the @include and @skip directives have the argument “if”. The @deprecated directive has the argument “reason”.

Figure 3.4. List all directives supported by a schema
ch03 fig 04 gqlia

The list of locations you see in figure 3.4 in the response of the previous query is also important. Directives can be used only in the locations they are declared to belong to. For example, the @include/@skip directives can only be used after fields or fragments. You cannot for example use them in the top-level of an operation. Similarly, the @deprecated directive can only be used after field definitions when defining a GraphQL service schema.

Listing 3.27. Possible shape of a data object to represent a list of tweets
const tweetList = [
  { id: ·-·-·,
    userName: ·-·-·,
    userHandle: ·-·-·,
    date: ·-·-·,
    body: ·-·-·,
    repliesCount: ·-·-·,
    tweetsCount: ·-·-·,
    likes: ·-·-·,
  },
  { id: ·-·-·,
    userName: ·-·-·,
    userHandle: ·-·-·,
    date: ·-·-·,
    body: ·-·-·,
    repliesCount: ·-·-·,
    tweetsCount: ·-·-·,
    likesCount: ·-·-·,
  },
  ·-·-·,
];