> ## Documentation Index
> Fetch the complete documentation index at: https://docs.requestly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GraphQL Request

> Requestly supports GraphQL requests, allowing you to send queries, mutations, and define variables

GraphQL requests work over HTTP just like REST, but instead of defining multiple endpoints, you typically interact with a **single endpoint** (e.g., `/graphql`) and specify the exact data you want. This gives you flexibility, reduces over-fetching, and makes debugging APIs much simpler.

![](https://mintcdn.com/requestly/Z9psaKI2OUaqbNe1/images/graphql-request/b393cc24-502b-4229-80e0-fd5b75a374cf.png?fit=max\&auto=format\&n=Z9psaKI2OUaqbNe1\&q=85\&s=e8628fa6787dbc4a6e776aca492f0acd)

## Create your first GraphQL request

**1. Open API Client and Create a New Request**

Open **Requestly Desktop App**, then click the `+ New` button to create a new request and select **GraphQL request** from the menu.

![](https://mintcdn.com/requestly/Z9psaKI2OUaqbNe1/images/graphql-request/9e445125-233d-4086-bbb1-913887d4edfd.png?fit=max\&auto=format\&n=Z9psaKI2OUaqbNe1\&q=85\&s=2224cfb28115309c133ce3812030bd83)

**2. Name Your API Request**

Give a descriptive title for your request to make it easy to identify later

![](https://mintcdn.com/requestly/Z9psaKI2OUaqbNe1/images/graphql-request/08acf961-0623-4ec8-a7a9-c9eebd57ca82.png?fit=max\&auto=format\&n=Z9psaKI2OUaqbNe1\&q=85\&s=d5d93cefd173c4a966c1c959d80fb9d3)

**3. Enter the GraphQL server URL**

Add your GraphQL endpoint.

> [!NOTE]
>
> It will automatically perform **schema introspection** so you can explore available queries, mutations, and types.

![](https://mintcdn.com/requestly/Z9psaKI2OUaqbNe1/images/graphql-request/8c9a443f-86dc-489c-94e5-84e5f33a7c9c.png?fit=max\&auto=format\&n=Z9psaKI2OUaqbNe1\&q=85\&s=8e0250fd4795ceb846fca178af56951b)

**4. Explore the schema**

Under the **Query** tab, you’ll see three panels:

* **Query/Mutation editor**: where you write or generate queries.

* **Variables editor**: where you define variables in JSON format.

* **Schema explorer**: where you browse your API’s schema (Queries, Mutations, Subscriptions). If the panel is closed, the **Schema** button at the right-hand end of the tab strip reopens it, and that button disappears while the panel is open.

> [!NOTE]
>
> The **Schema** button described here only opens this explorer panel. The separate **Schema** tab in the same tab strip is where you attach a schema document, covered in [Attach a schema from a file or URL](#attach-a-schema-from-a-file-or-url).

![](https://mintcdn.com/requestly/Z9psaKI2OUaqbNe1/images/graphql-request/c674ba8c-8ead-4c18-95a2-8197e8dc460c.png?fit=max\&auto=format\&n=Z9psaKI2OUaqbNe1\&q=85\&s=87f2a6a40779e5f982e8f300a177a48b)

**5. Build your query**

In the schema explorer, select a field and expand its arguments. A query will automatically appear in the **Query editor**.\
Alternatively, you can write your query manually

![](https://mintcdn.com/requestly/Z9psaKI2OUaqbNe1/images/graphql-request/468ee277-2628-4400-bfd1-06dcaaaa7583.png?fit=max\&auto=format\&n=Z9psaKI2OUaqbNe1\&q=85\&s=b35c1ca15fc5f8da06ed53c5f5272f63)

**6. Add variables (optional)**

In the **Variables editor**, provide values in JSON format.

![](https://mintcdn.com/requestly/Z9psaKI2OUaqbNe1/images/graphql-request/e547f084-420b-409b-8d51-dd0b925a5b39.png?fit=max\&auto=format\&n=Z9psaKI2OUaqbNe1\&q=85\&s=4dd2d365ee0c914c826adf314b9d8556)

**7. Send the request**

Click **Send** to execute your query and view the response.

![](https://mintcdn.com/requestly/Z9psaKI2OUaqbNe1/images/graphql-request/6bbd5f6f-29c3-48d7-8e10-9384b2d86ff3.png?fit=max\&auto=format\&n=Z9psaKI2OUaqbNe1\&q=85\&s=0c7f587a0ca519bae8b6c0656524d8ae)

### Create a GraphQL request with multiple queries

**1. Create a new request**

Open **Requestly Desktop App**, then click the `+ New` button to create a new request and select **GraphQL request** from the menu.

![](https://mintcdn.com/requestly/Z9psaKI2OUaqbNe1/images/graphql-request/9e445125-233d-4086-bbb1-913887d4edfd.png?fit=max\&auto=format\&n=Z9psaKI2OUaqbNe1\&q=85\&s=2224cfb28115309c133ce3812030bd83)

**2. Select multiple fields**

From the schema explorer, select more than one field. Both queries will appear in the **Query editor**. Alternatively, you can manually add a new query / mutation.

![](https://mintcdn.com/requestly/Z9psaKI2OUaqbNe1/images/graphql-request/c674ba8c-8ead-4c18-95a2-8197e8dc460c.png?fit=max\&auto=format\&n=Z9psaKI2OUaqbNe1\&q=85\&s=87f2a6a40779e5f982e8f300a177a48b)

**3. Choose a query to run**

Only one query runs at a time. First, click the **Send** button, then select the query you want to run from the dropdown.

To execute another query, click the Send button again and select the other query from the dropdown.

![](https://mintcdn.com/requestly/Z9psaKI2OUaqbNe1/images/graphql-request/6f82178d-a478-40a6-9f99-03f066ee2cb4.png?fit=max\&auto=format\&n=Z9psaKI2OUaqbNe1\&q=85\&s=e55f21cab6f31d489d8091c549b3b29a)

## Attach a schema from a file or URL

By default a GraphQL request builds its schema by introspecting whatever endpoint is in the URL bar, and that keeps working exactly as before. Attach a schema document yourself when introspection is turned off on the server, when the schema you develop against is not the one that endpoint serves yet, or when you keep the schema in your repository.

> [!NOTE]
>
> Attaching a schema is rolling out gradually. If your GraphQL requests show no **Schema** tab, it is not enabled for your account yet.

![The Schema tab of a GraphQL request with nothing attached, showing the schema picker, the Import a GraphQL schema link and the Use GraphQL introspection link](https://mintcdn.com/requestly/R1c-VDYdoBMf7TWZ/images/graphql-schema-tab-unattached.light.png?fit=max\&auto=format\&n=R1c-VDYdoBMf7TWZ\&q=85\&s=0e8e75336ed02586ab3d4a8804e0a086)

The tab gives you three ways to get a schema, and they are mutually exclusive. Attaching a document turns introspection off for that request, and choosing **Use GraphQL introspection** drops the attached document. One request never has two live schema sources.

Nothing is ever copied. Every attachment is a reference that Requestly re-reads when the request loads, so the schema document itself is never stored inside your request.

### Attach a file from your machine

**1. Open the Schema tab**

Open the GraphQL request, then select the **Schema** tab.

**2. Choose the file**

Click **Import a GraphQL schema**, then click **Choose a file** and pick your schema document. `.graphql`, `.gql`, `.graphqls`, `.sdl`, and `.json` files are all accepted.

**3. Check that it loaded**

The picker now names the file and the tab reads "Schema document attached from a local file". Switch back to the **Query** tab: autocomplete and the schema explorer behave exactly as they do on an introspected schema.

A file attachment stays a live reference, not a snapshot. Edit the file in your editor, click the refresh button beside the picker, and the change is picked up without attaching the file again. Requestly never watches the file, so picking up an edit is always an explicit refresh.

> [!NOTE]
>
> On the web app, keeping an attached file in sync needs a Chromium-based browser (Chrome, Edge, Brave, Arc) or the desktop app. On other browsers the file still attaches, but it is read once: edit it and attach it again to pick up the change.

### Attach a schema by URL

**1. Open the Schema tab**

Open the GraphQL request, then select the **Schema** tab.

**2. Enter the URL**

Paste the URL straight into the picker and select the **Attach** row that appears, or click **Import a GraphQL schema** and press Enter in the **Enter a URL** field.

**3. Check that it loaded**

The picker now shows a short name taken from the URL, which is its last path segment rather than the whole link. If the URL served a schema document, the tab reads "Schema document attached from a URL". Switch back to the **Query** tab: autocomplete and the schema explorer behave exactly as they do on an introspected schema.

The URL you paste is meant to point at a schema **document**: GraphQL SDL, or the JSON result of an introspection query. Requestly fetches it and reads the response as a document first.

If what comes back is not a schema document, Requestly then **introspects that same URL** before it reports any error. So pasting a plain GraphQL endpoint works too, and you do not need to know in advance which of the two a URL is.

One thing to expect when the fallback is what succeeded: no document was ever parsed, so the request is now introspecting that URL rather than holding a document, and the tab says so. It reads "No schema document attached. This request uses GraphQL introspection" even though the schema loaded and is driving the editor. The URL is still added to the picker, so you can reuse it on another request.

> [!TIP]
>
> Coming from Postman? A plain endpoint URL is accepted here because of the introspection fallback above, and an **introspection-result JSON** file or URL is a first-class import format rather than something you must convert to SDL first.

> [!NOTE]
>
> On the web app, fetching a schema URL runs through Cloud Agent, which cannot reach `localhost` or private network addresses. Attach those from the desktop app.

### Reuse a location you have attached before

Once a file or URL has loaded successfully, it is remembered on that device and offered in the picker on every other GraphQL request, with no network call. A document that failed to load is not remembered, so a broken location never comes back to haunt you.

Each remembered row is labelled with a short name derived from its location, so the list stays one line per entry. Hover a row to see the full location.

Hover any remembered row except the one this request is using and click the cross to forget it. Forgetting a location removes it from the list and nothing else: every request already attached to it stays attached and keeps working.

![The Schema tab with a schema attached, showing the attached location in the picker and the refresh button beside it](https://mintcdn.com/requestly/R1c-VDYdoBMf7TWZ/images/graphql-schema-tab-attached.light.png?fit=max\&auto=format\&n=R1c-VDYdoBMf7TWZ\&q=85\&s=deea640f257253c0edcafc6317a657b0)

### Go back to introspection

While a document is attached, the tab offers **Use GraphQL introspection**. Choosing it detaches the document and the request goes back to introspecting the URL in the URL bar. The control needs a request URL to work against, and says so when the URL bar is empty.

While introspection is already the live source there is nothing to switch to, so the tab shows "Using GraphQL introspection" with its own re-run control instead.

### What a teammate on another machine sees

What travels with a shared request depends on the kind of attachment, and not on whether you work in a team project or a local project. The behaviour is the same in both.

| You attached | What a teammate opening that request gets |
| - | - |
| A **URL** | The same attachment. The URL is part of the request, so the schema loads for them too. |
| A **file** | Nothing device-specific. The request falls back to introspection, and the tab offers them a route to attach their own copy. They never see a file path from your machine. |

If you want a schema to be shared, attach it by URL.

### On a GraphQL example

A GraphQL [example](https://docs.requestly.com/api-client/examples.md) has a **Schema** tab too, and it shows where its parent request's schema comes from rather than the schema itself: the source (**Introspection**, **Schema document**, or **Local file**), the location when that source is a URL, and that it was resolved from the parent request. Everything there is read-only, with no attach, reuse or refresh controls, because an example never carries a schema of its own. A **Local file** source shows no location at all, so an example never displays a path from another machine.

### Why there is no "Import as specification"

Postman lets you import a GraphQL schema as an API specification. Requestly has no equivalent, and that is deliberate rather than an oversight: [Requestly specifications](https://docs.requestly.com/api-client/api-design/overview.md) are OpenAPI documents, and there is no GraphQL format for a schema to become.

To share a schema with your team, host it where your teammates can reach it and attach it **by URL**. A URL attachment travels with the request. A file you attach stays on your own machine by design, and there is no way to promote it into something shared.

### What survives when you attach SDL

An attached SDL document is used as SDL. Requestly never converts it to introspection JSON on the way in, so things introspection cannot express survive attaching: custom directive applications, and type extensions that add nothing but a directive.

### When something goes wrong

Errors on this tab are short and always name what to do next. The common ones:

| What you see | What it means |
| - | - |
| "Could not load GraphQL schema. The document is not valid GraphQL SDL. Check the file and attach it again." | The document was read but is not a schema Requestly can build. |
| "Could not load GraphQL schema. That URL did not return a schema document, and introspecting it failed. Check the URL and attach it again." | Both attempts were made against your URL and both failed. |
| "Could not refresh the GraphQL schema. The location was not found. The previously loaded schema is still in use. Re-import it to continue." | A refresh could not reach the file or URL. Your request keeps working on the schema it already loaded. |

If an attached file has moved, been deleted, or the browser has dropped its permission, the tab says so and offers **Re-attach** so you can point at it again in one click.

![The Schema tab showing a schema load error above the attach controls, which stay available](https://mintcdn.com/requestly/R1c-VDYdoBMf7TWZ/images/graphql-schema-tab-error.light.png?fit=max\&auto=format\&n=R1c-VDYdoBMf7TWZ\&q=85\&s=533341829c6a28b9098dcc8ac20c1f5b)

The attach controls stay available in every error state, so you can fix the problem from where you are told about it.

## What's Next?

> [card] [Add Authorization](https://docs.requestly.com/api-client/send-api-request/authorization.md)
>
> Secure your GraphQL requests with API keys, tokens, or OAuth flows

> [card] [Use Variables](https://docs.requestly.com/api-client/environments-and-variables.md)
>
> Make your GraphQL queries dynamic with environment variables

> [card] [Organize in Collections](https://docs.requestly.com/api-client/api-collections.md)
>
> Group related GraphQL requests together


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.