Skip to main content

graphql-introspection

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.

TypeProject feature
Value in featuresgraphql-introspection
Change withPATCH /v1/projects/me/features (replaces the whole list)
Who can change itProject admin. Any practitioner can read the list.
On for new projectsNo
Effect on ordinary GraphQL queriesNone. They work whether the flag is on or off.
Effect on introspection queriesNone.

What works​

Ordinary queries need no feature:

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:

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 pathExampleMeaning
data.__schema.queryType.nameQueryTypeName 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​

  • 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. The Ovok API references list the resources, elements and search parameters you can query.
  • Introspection is expensive. It is for development tools; do not call it from production code.