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

# Queries & mutations

> How operations, variables, and query cost work in the v3 API

Every v3 request is a single `POST` carrying a GraphQL document. **Queries**
read data; **mutations** write it.

## Sending an operation

The request body is JSON with a `query` field and optional `variables` and
`operationName`:

```json theme={null}
{
  "query": "query GetProduct($id: ID!) { product(id: $id) { id title sku } }",
  "variables": { "id": "prd_123" }
}
```

The response mirrors the shape you asked for, under `data`:

```json theme={null}
{
  "data": {
    "product": { "id": "prd_123", "title": "Wool Runner", "sku": "WR-9" }
  }
}
```

Looking up a record by an ID that does not exist returns `null`, not an error.

### Queries

```graphql theme={null}
query {
  productFamilies(first: 5) {
    nodes {
      id
      title
      products(first: 3) {
        nodes {
          id
          sku
          price {
            amount
            currency
          }
        }
      }
    }
  }
}
```

### Mutations

A mutation returns the record it wrote, so you can select fields from it as you
would in a query. Failures are reported in the top-level `errors` array with a
`code`, as described in [Errors](/docs/api-reference/v3/errors); invalid input
returns HTTP `400`.

```graphql theme={null}
mutation {
  createWebhookEndpoint(
    input: {
      url: "https://example.com/redo-webhooks"
      topics: [PRODUCT_CREATED, PRODUCT_UPDATED]
    }
  ) {
    id
    secret
  }
}
```

## Query cost & rate limits

The API uses **query-cost rate limiting**: each query's cost is estimated from
its shape *before* it runs and reserved against your store's bucket, and the
response reports the cost under `extensions.cost`. Requesting fewer results and
fewer fields keeps cost, and latency, low. Mutations are not charged.

See [Rate limiting](/docs/api-reference/v3/rate-limiting) for the cost model,
`throttleStatus`, and how to handle `429` / `THROTTLED` responses.

## Related

* [Rate limiting](/docs/api-reference/v3/rate-limiting): query cost and
  throttling
* [Pagination](/docs/api-reference/v3/pagination): paging through connections
* [Errors](/docs/api-reference/v3/errors): error shapes and codes


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