The Structure of a Query
Explore the components of a GraphQL query including operation types, named queries, and nested objects. Understand how to use directives like include and skip for conditional data fetching. This lesson helps you gain confidence in crafting clear and efficient GraphQL queries within GitHub's API environment.
We'll cover the following...
The Query Statement
Now, let’s take a step back to examine the structure of the GraphQL query. After we were introduced to variables, we encountered the query statement in our query structure for the first time. Before using the query statement, we used the shorthand version of a query in which we omitted the statement. However, as we are using variables, the query statement must be included. Try the following query without variables but with the query statement to verify that the longer version of a query works.