Queries

Learn what are queries in GraphQL and how they can be used

About Queries

Every GraphQL schema has a root type for both queries and mutations. The query type defines GraphQL operations that retrieve data from the server.

For more information, see "Forming calls with GraphQL" below.

Performing Queries in GraphQL

GraphQL queries return only the data you specify. To form a query, you must specify fields within fields (also known as nested subfields) until you return only scalars.

Queries are structured like this:

query {
  JSON-OBJECT-TO-RETURN
}

For an actual example, see "Example Query".

Last updated