Book a call
Table of Contents
GraphiQL playgroundย to play with theย Todo APIย built with Hasura GraphQL (you will need to sign up for a Hasura account).- Tools like GraphiQL make GraphQL APIs really easy to use and integrate APIs in your app without requiring external documentation tools.
- GraphiQL is a tool built by Facebook, (pronounced "graphical") that makes it easy to explore any GraphQL API.
- When you work with a GraphQL API in a project you will almost always use a tool like GraphiQL to explore and test your GraphQL queries.
First, here's a look at the data models and how they are linked to each other.

Exploring Queries (fetching data) in GraphiQL Playground ๐ถ
- As you can see, the 3 models are linked to each other. Let's try toย fetch different slices of data from our overall 'graph'.
- Let's fetch some slices of data now (following screenshots have the GraphQL query in the left window and the response on the right window):
First, let's fetchย usernames like so:

Second, let's fetch users and their todos, like so:

Now lets fetch data with some parameters or arguments, think about this RESTful endpointย GET /api/todos?limit=ย whereย limit=3ย is theย query-param, in GraphQL we can do:

filter,ย sortย andย paginationย arguments. Incase you have a custom GraphQL API, you might have access to different arguments for specific fields.Finally, let's take a look at Multiple arguments on multiple fields. Lets fetch 5 most recent todos for 1 user, like so:

Last and most important, we need to make our queries reusable, so we need to be able to pass queries dynamically. This can be achieved like:

What we learned from the above โ๏ธ code snippets:
Exploring Mutations (writing data) in GraphiQL Playground ๐พ
'POST',ย 'PUT',ย 'PATCH',ย 'DELETE'ย APIs.Basic Mutations
inserts,ย updatesย orย deletesย that we can use in our app. If we are using a custom GraphQL API, created by a backend team not by Hasura then we might have access to different mutations and these might behave differently.First, let's create a todo (this is in context of our todo API), like:

From the above โ๏ธ example, we can see that, the todo we want to create i.eย insertย is passed as argument to theย insert_todosย mutation, but the 'fields' we are returning are responsible for the shape of our response.

When inserting data, we almost always want to capture data from user input or user action. So, the data we are passing is going to be dynamic, we can achieve this like:

$todoย is of typeย todo_insert_inputย and this is defined in the schema, incase of custom GraphQL API which is not created by a backend team, they will define these input types and our mutation argument must conform to these rules, shape of the object we are passing.updateย andย deleteย actions a bit later in this series.- Make basic GraphQL mutations.
- Can pass dynamic arguments/data to mutations with query variables.
Exploring Subscriptions (subscribing, listening for changing data) in GraphiQL Playground ๐ถ
A strong use case for subscriptions
Let's set up a subscription to check users online, each time the data changes on the server, it will push the changes to the client.

How does this GraphQL subscription work? ๐
- Make GraphQL subscriptions.
We are now ready to setup our Hasura backend, which we will implement in the next part!
Subscribe to Our Newsletter
Subscribe to RSS
Press & Media Hub RSS FeedRelated Articles.
More from the engineering frontline.
Dive deep into our research and insights on design, development, and the impact of various trends to businesses.

Dec 16, 2025
Architecture for Next.js App Router i18n at Scale: Fixing 100+ Locale SSR Bottlenecks

Dec 16, 2025
Strapi CMS: The Modern Headless CMS Powering Scalable Digital Experiences

Nov 19, 2025
Offline-First Flutter: Implementation Blueprint for Real-World Apps

Nov 18, 2025
React Query as a State Manager in Next.js: Do You Still Need Redux or Zustand?

Oct 21, 2025
Incremental Static Regeneration in Next.js: The Secret Sauce Behind Scalable Static Sites

Sep 22, 2025

