# graphql-introspection

Canonical page: https://docs.ovok.com/settings-and-features/features/graphql-introspection

For the GraphQL endpoint, query patterns, and a sandbox schema check, see the [GraphQL guide](/graphql).

A project feature flag for GraphQL schema introspection. Ovok accepts and stores it, but **turning it on does not enable introspection today**: introspection is governed by a platform-wide setting, not by this flag.

| | |
| --- | --- |
| Type | Project feature |
| Value in `features` | `graphql-introspection` |
| Change with | `PATCH /v1/projects/me/features` (replaces the whole list) |
| Who can change it | Project admin. Any practitioner can read the list. |
| On for new projects | **No** |
| Effect on ordinary GraphQL queries | None. They work whether the flag is on or off. |
| Effect on introspection queries | None. |

## What works [#what-works]

Ordinary queries need no feature:

```bash
curl --request POST \
  --url 'https://api.sandbox.ovok.com/fhir/R4/$graphql' \
  --header "Authorization: Bearer ${OVOK_TOKEN}" \
  --header 'Content-Type: application/json' \
  --data '{"query":"{ PatientList(_count: 1) { id } }"}'
```

Whether an introspection query (one that asks for `__schema` or `__type`) is answered depends on a platform-wide setting, not on this flag. In the sandbox it is answered whether or not the flag is on:

```bash
curl --request POST \
  --url 'https://api.sandbox.ovok.com/fhir/R4/$graphql' \
  --header "Authorization: Bearer ${OVOK_TOKEN}" \
  --header 'Content-Type: application/json' \
  --data '{"query":"{ __schema { queryType { name } } }"}'
```

| Response path | Example | Meaning |
| --- | --- | --- |
| `data.__schema.queryType.name` | `QueryType` | Name of the root query type returned by introspection. |

An environment whose platform setting disables introspection refuses these queries with `403`, and adding this flag does not change that.

## Gotchas [#gotchas]

- **You do not need the flag for GraphiQL or a code generator.** Introspection works in the sandbox without it. If a tool gets `403` elsewhere, the flag is not the cause and setting it will not fix it.
- **A stored flag is not a promise.** The flag is accepted and stored, but nothing reads it for GraphQL today.
- **Use the published references for schema.** Browse [FHIR resources](/api/fhir/r4) and [FHIR Elements](/fhir-elements) for resource structures, elements, and supported search parameters.
- **Introspection is expensive.** It is for development tools; do not call it from production code.

## Related [#related]

- [Settings and features](/settings-and-features#project-features)
- [FHIR basics](/fhir-basics)
