A Beginner’s Guide to Testing GraphQL APIs with Requestly

Your lightweight Client for API debugging
No Login Required
Requestly isnât available for download on mobile or tablets.
To download it, please open this page on a desktop PC and enter your email to get the link.
- Local Projects
- Organize API into Collections & Environments
- API Tests
- Import from Postman, OpenAPI, etc
- Redirect URLs & modify HTTP headers
- Mock API / GraphQL responses
- Insert custom JavaScript scripts
When working with APIs, most developers are used to REST. But GraphQL is quickly becoming the go-to choice for modern applications. Instead of juggling multiple endpoints, GraphQL lets you work with a single endpoint (usually /graphql) and define exactly what data you need. This means fewer round trips, less over-fetching, and more control for the client.
The good news? With the Requestly API Client, running GraphQL queries is just as easy as sending REST requests. In this guide, we’ll walk through creating your first GraphQL request step by step.
Step 1: Create a New GraphQL Request
- Open the API Client from the left sidebar in Requestly.
- Click + New and select GraphQL Request.
- Give your request a descriptive name, like “Get Country Details.”

Step 2: Enter a GraphQL Endpoint
For this tutorial, we’ll use the Countries API (a free, public GraphQL server):
https://countries.trevorblades.com/graphqlPaste this into the URL field.
Once added, Requestly will automatically introspect the schema so you can explore available queries, mutations, and types.

Step 3: Explore the Schema
In request, you’ll should see three panels:
- Query Editor → where you write your GraphQL queries or mutations.
- Variables Editor → where you define variables in JSON format.
- Schema Explorer → a browsable tree of queries, mutations, and fields exposed by the API.
This setup makes it easy to discover what data you can fetch without memorizing the schema.
Step 4: Build Your First Query
Let’s fetch some details about India. In the Query Editor, enter:
query {
country(code: "IN") {
name
native
currency
emoji
}
}Click Send.
You’ll see a JSON response with the country’s name, currency, and emoji. 🎉

Step 5: Add Variables (Optional)
Instead of hardcoding values, you can use variables to make requests reusable.
Query:
query GetCountry($code: ID!) {
country(code: $code) {
name
currency
emoji
}
}Variables:
{
"code": "US"
}Now you can quickly swap between different countries just by changing the variable value.

Step 6: Run Multiple Queries
You can also define multiple queries in the same request. For example:
query GetIndia {
country(code: "IN") {
name
currency
capital
}
}
query GetUS {
country(code: "US") {
name
currency
capital
}
}When you hit Send, Requestly will let you pick which query to execute from a dropdown. This makes it easy to test variations side by side without creating separate requests.

Wrapping Up
That’s it — you just ran your first GraphQL request in Requestly!
With schema exploration, variables, and support for multiple queries, the Requestly API Client makes debugging and testing GraphQL APIs as seamless as REST.
Next steps to try:
- Run a mutation (e.g., updating or creating data).
- Test a GraphQL API that requires authentication headers.
- Chain GraphQL requests together using runtime variables in Requestly.
Whether you’re new to GraphQL or already building production APIs, Requestly gives you the flexibility to test faster and collaborate better.
Related guides
- GraphQL vs REST: How to Choose and Test Both
- How to Test an API: A Step-by-Step Guide
- How to Write API Tests and Assertions
Test GraphQL faster: Requestly’s API client has first-class GraphQL support, including a schema explorer and a variables panel. Try Requestly API Client →
Frequently Asked Questions
How do I test a GraphQL API?
Send a POST request to the GraphQL endpoint with your query in the body, then inspect the data and errors fields in the JSON response. In Requestly you create a GraphQL request, enter the endpoint, and run queries against it.
What is GraphQL introspection?
Introspection is a built-in query that returns the API’s schema. Requestly’s schema explorer uses it to show the available types, queries, and fields so you can build queries without guesswork.
How do I pass variables to a GraphQL query?
Declare variables in the query and supply a JSON object of their values. Requestly gives you a dedicated variables panel next to the query editor.
Do GraphQL APIs use GET or POST?
Most GraphQL requests use POST with the query in the request body. Some servers also allow GET for read-only queries.
How do I add authentication to a GraphQL request?
Set headers just like any HTTP request, for example an Authorization header with a bearer token. The header applies to the GraphQL POST call.
Can I write assertions on GraphQL responses?
Yes. Use post-response scripts to assert on the JSON response, such as checking a field under data or confirming the errors array is empty.
Contents
- Step 1: Create a New GraphQL Request
- Step 2: Enter a GraphQL Endpoint
- Step 3: Explore the Schema
- Step 4: Build Your First Query
- Step 5: Add Variables (Optional)
- Step 6: Run Multiple Queries
- Wrapping Up
- Related guides
- Frequently Asked Questions
- How do I test a GraphQL API?
- What is GraphQL introspection?
- How do I pass variables to a GraphQL query?
- Do GraphQL APIs use GET or POST?
- How do I add authentication to a GraphQL request?
- Can I write assertions on GraphQL responses?
Subscribe for latest updates
Share this article
Get started today
Requestly isnât available for download on mobile or tablets.
To download it, please open this page on a desktop PC and enter your email to get the link.
- Local Projects
- Organize API into Collections & Environments
- API Tests
- Import from Postman, OpenAPI, etc
- Redirect URLs & modify HTTP headers
- Mock API / GraphQL responses
- Insert custom JavaScript scripts









