GraphQL: getting started

Lesson 03 · 10 min

Queries, variables, fragments

A query is a tree of fields. Variables replace string concatenation.

A query gets a name and declares typed variables: query Book($id: ID!). Variable values travel as a separate JSON object. A fragment is a reusable piece of a selection. An alias renames a field in the response.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.