# persisted_query_hash_mismatch

Source: https://capacms.com/docs/errors/persisted_query_hash_mismatch

400 invalid_request. The sha256 sent does not match the query text sent.

| HTTP status | `type`            | Surfaces |
| ----------- | ----------------- | -------- |
| 400         | `invalid_request` | GraphQL  |

## What it means

The sha256 sent does not match the query text sent.

## What to do

Hash the exact query string, UTF-8, lowercase hex.

## On GraphQL

`/api/graphql` answers the same `code` inside `errors[].extensions`. The status depends on the `Accept` header you send ([status codes](https://capacms.com/docs/api/graphql#status-codes)):

| `application/json` | `graphql-response+json` | When                                           |
| ------------------ | ----------------------- | ---------------------------------------------- |
| 400                | 400                     | the sha256 of `query` is not the hash you sent |

## See also

* [Persisted queries](https://capacms.com/docs/api/graphql#persisted-queries)
