A free GraphQL API for testing, with saved mutations
Queries, variables, saved mutations and error responses on a public endpoint.
Examples last run against the API on
A free public GraphQL API for testing is at https://api.testingapis.com/graphql. It needs no key and no sign-up. Send a POST with a JSON body. It has 20 query fields covering users, products, posts, todos, books, movies and countries, plus six mutations whose changes are saved. Introspection is on, so GraphQL clients can load the schema. Every example here was run on 1 November 2026.
A first query
$ curl -X POST https://api.testingapis.com/graphql \
-H "Content-Type: application/json" \
-d '{"query":"{ products(category: \"electronics\") { id title price inStock } }"}'
{"data":{"products":[
{"id":1,"title":"Wireless Noise-Cancelling Headphones","price":249.99,"inStock":true},
{"id":2,"title":"Smartwatch Series 6","price":199.99,"inStock":true},
...Point Postman, Insomnia or any GraphQL client at the same URL. List fields take a filter argument, such as category on products, userId on posts and completed on todos.
Variables
User ids start at 101. Note the type: the id argument is an Int!, and declaring it as ID! returns a validation error.
query ($id: Int!) {
user(id: $id) {
id
name
job
city
}
}
# Variables: {"id": 101}
# Response: {"data":{"user":{"id":101,"name":"Hiroshi Tanaka","job":"Engineer","city":"Tokyo"}}}Mutations that save
The mutations are addTodo, toggleTodo, deleteTodo, createUser, updateUser and deleteUser. All of the arguments on addTodo are required.
mutation {
addTodo(title: "Write the tests", userId: 101, priority: "high") {
id
title
completed
priority
}
}
# {"data":{"addTodo":{"id":31,"title":"Write the tests","completed":false,"priority":"high"}}}GraphQL and REST read the same data. After toggleTodo, the REST route shows the change, which is useful for checking one interface through the other:
$ curl https://api.testingapis.com/api/todos/31
{"id":31,"userId":101,"title":"Write the tests","completed":true,"priority":"high","dueDate":"2026-11-08"}Testing errors
A GraphQL client has to handle failures that a REST client doesn't see. An invalid query returns an errors array with the location of the problem, and a mutation can succeed while reporting false. Assert on the body, since a 200 doesn't mean the operation worked. A body that isn't valid JSON gets a 400.
{ products { nope } }
# 200 OK
# {"errors":[{"message":"The field `nope` does not exist on the type `Product`.",
# "locations":[{"line":1,"column":14}],"path":["products"], ...}]}
mutation { deleteTodo(id: 999999) }
# {"data":{"deleteTodo":false}}Reading the schema
Send this query to list every operation. The GraphQL API reference documents each type.
{
__schema {
queryType { fields { name } }
mutationType { fields { name } }
}
}What this API doesn't do
- There are no subscriptions. For live updates, use the WebSocket server.
- List fields filter but don't paginate. For paging, use the REST pagination routes.
The GraphQL testing tutorial goes from these requests to a full test suite.