February 2020
Intermediate to advanced
404 pages
8h 42m
English
So far, we've seen how the client GraphQL query works. It describes the fields regarding the data that should be supplied. But what if we need data about certain criteria? Can we query with some values? Yes! GraphQL is built on querying and it provides a variety of options we can use while querying.
Let's go back to the initial example we showcased, that is, a user's API with name and address. The client query looks like this:
{ user { name address { street } }}
The preceding query fetches all the users from the GraphQL server. We can also query a record by using the name. The query syntax uses curved brackets and parenthesis (:) on a field. Let's retrieve users whose name is "alice". The preceding client query should ...
Read now
Unlock full access