Understanding the GraphQL syntax
Like React Query, GraphQL refers to a request to fetch data as a query. In the following subsections, we’ll learn how to write a basic GraphQL query that returns data from a couple of fields. These fields will have primitive values and so the result will be flat. We’ll then learn how to write a more advanced query containing object-based field values that have their own properties. Lastly, we will learn how to make queries more reusable using parameters.
Returning flat data
Carry out the following steps to use the GitHub GraphQL API Explorer to get information about your GitHub user account:
- Open the following URL in a browser to open the GitHub GraphQL API Explorer: https://docs.github.com/en/graphql/overview/explorer.
- Sign in using the Sign in with GitHub button if you aren’t signed in already. A GraphQL API Explorer page appears, as follows:
...