# graphql_validation_failed

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

400 invalid_request. The document parses but asks for something the key's schema does not have: a field, an argument, a type or a missing variable.

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

## What it means

The document parses but asks for something the key's schema does not have: a field, an argument, a type or a missing variable.

## What to do

Use the names the message suggests; the schema only holds models this key can read.

## 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                                                                                                                                                     |
| ------------------ | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 200                | 400                     | an unknown field, a wrong argument type, a subscription anywhere in the document, an unnamed operation beside another. One error per problem, at most 20 |

## See also

* [GraphQL](https://capacms.com/docs/api/graphql)
