> ## Documentation Index
> Fetch the complete documentation index at: https://bruno-a6972042-mintlify-ws-multi-message-1777871287.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# GraphQL Request

export const BrunoButton = ({collectionUrl, width = 160, height = 40, className = '', style = {}}) => {
  const encodedUrl = encodeURIComponent(collectionUrl);
  const buttonUrl = `https://fetch.usebruno.com?url=${encodedUrl}`;
  return <div style={{
    display: 'flex',
    justifyContent: 'center',
    width: '100%',
    margin: '2rem 0',
    ...style
  }} className={className}>
      <a href={buttonUrl} target="_blank" rel="noopener noreferrer" style={{
    textDecoration: 'none',
    display: 'inline-block'
  }}>
        <img src="https://fetch.usebruno.com/button.svg" alt="Fetch in Bruno" width={width} height={height} noZoom style={{
    width: `${width}px`,
    height: `${height}px`,
    display: 'block',
    cursor: 'pointer'
  }} />
      </a>
    </div>;
};

Bruno provides the capability to send GraphQL requests, allowing you to interact with APIs that use the GraphQL query language.

## Create GraphQL request

1. Create new request from collection context menu (...) and select **New Request**.
2. Select **GraphQL** as request type with:
   * **URL**: The URL of the GraphQL endpoint.
   * **Name**: The name of the request.
3. Click on **Create** button.

<img src="https://mintcdn.com/bruno-a6972042-mintlify-ws-multi-message-1777871287/TfWWB6j2-XKBV2Tn/images/screenshots/send-request/graphql/create-graphql-request.webp?fit=max&auto=format&n=TfWWB6j2-XKBV2Tn&q=85&s=c8b61fbcc74a7a4070c47f433f116c47" alt="create-graphql-request" width="2472" height="1126" data-path="images/screenshots/send-request/graphql/create-graphql-request.webp" />

## GraphQL request with query

After creating the request:

* Go to **Query** section where you can write and execute all your GraphQL queries
* You can also use the **Variables** section to pass variables to your query

<img src="https://mintcdn.com/bruno-a6972042-mintlify-ws-multi-message-1777871287/TfWWB6j2-XKBV2Tn/images/screenshots/send-request/graphql/02-gql-query.webp?fit=max&auto=format&n=TfWWB6j2-XKBV2Tn&q=85&s=d298fc19f12b43858ddb7c05cfffdc2a" alt="query-graphql" width="2596" height="1478" data-path="images/screenshots/send-request/graphql/02-gql-query.webp" />

**Example Query:**

You can test this query using the below GraphQL API: `https://graphqlzero.almansi.me/api`

```graphql theme={null}
query Albums {
  albums {
    data {
      id
      title
    }
  }
}
```

## Query builder

**Query builder** is a tool that helps you build your GraphQL queries easily. It allows you to select the fields you want to retrieve from the API and generate the query for you. Follow the below steps to use Query builder in Bruno.

1. Click on **query builder** icon next to prettify icon.

<img src="https://mintcdn.com/bruno-a6972042-mintlify-ws-multi-message-1777871287/TfWWB6j2-XKBV2Tn/images/screenshots/send-request/graphql/03-gql-builder.webp?fit=max&auto=format&n=TfWWB6j2-XKBV2Tn&q=85&s=fcb63a6d4ee2ba5a557c5598d0491d4e" alt="gql-builder" width="2596" height="1180" data-path="images/screenshots/send-request/graphql/03-gql-builder.webp" />

2. Select the fields you want to retrieve from the API and generate the query for you.

<Note>
  You can also use the **Search** input to search for the fields you want to retrieve from the API.
</Note>

<img src="https://mintcdn.com/bruno-a6972042-mintlify-ws-multi-message-1777871287/TfWWB6j2-XKBV2Tn/images/screenshots/send-request/graphql/04-gql-builder-ui.webp?fit=max&auto=format&n=TfWWB6j2-XKBV2Tn&q=85&s=c778ff8e4de7d0268edc53cbf8070847" alt="gql-builder-ui" width="2596" height="1454" data-path="images/screenshots/send-request/graphql/04-gql-builder-ui.webp" />

3. Click on **Send** button to execute the query.

### Query Builder with mutations

Mutation is use to modify data in the GraphQL API. Follow the below steps to use Mutation in Query builder.

1. Click on **Mutation** from query builder.

2. Select the fields you want to modify/update from the API and generate the query for you.

3. Execute the request by clicking on **Send** button.

<img src="https://mintcdn.com/bruno-a6972042-mintlify-ws-multi-message-1777871287/TfWWB6j2-XKBV2Tn/images/screenshots/send-request/graphql/05-gql-mutations.webp?fit=max&auto=format&n=TfWWB6j2-XKBV2Tn&q=85&s=2977d6d0f5f359cccde6e0d89e8b0bb6" alt="mutation-builder" width="2596" height="1574" data-path="images/screenshots/send-request/graphql/05-gql-mutations.webp" />

## Get Started with GraphQL APIs

Explore our sample REST and GraphQL collection to see practical examples and test GraphQL endpoints:

<BrunoButton collectionUrl="https://github.com/bruno-collections/rest-graphql-collection" width={160} height={40} />
