Requestly
HTTP InterceptorPricingRequestly vs PostmanBlogDocsDownload

Home / Blog / HTTP Interceptor

A Beginner’s Guide to Testing GraphQL APIs with Requestly

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

  1. Open the API Client from the left sidebar in Requestly.
  2. Click + New and select GraphQL Request.
  3. Give your request a descriptive name, like “Get Country Details.”

Create a New GraphQL Request screenshot

Create New GraphQL Request

Step 2: Enter a GraphQL Endpoint

For this tutorial, we’ll use the Countries API (a free, public GraphQL server):

https://countries.trevorblades.com/graphql

Paste this into the URL field.

Once added, Requestly will automatically introspect the schema so you can explore available queries, mutations, and types.

Enter a GraphQL Endpoint screenshot

Explore the Schema

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. 🎉

Build Your First Query screenshot

Send your first query

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.

Add Variables (Optional) screenshot

Use Variables in Query

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.

Run Multiple Queries screenshot

Use Multiple Queries

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.

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.

Test any API request visually: import a cURL command or build from scratch in Requestly, the free API client for developers.

Download Free →