Add a GraphQL schema
To create pages for your GraphQL API, you need a valid GraphQL schema in SDL (Schema Definition Language) format. Store the schema in your documentation repository or host it at an HTTPS URL that Mintlify can fetch.schema.graphql
Auto-populate GraphQL pages
To automatically generate pages for every query, mutation, and type in your schema, add agraphql property to a tab in your docs.json. Mintlify parses the schema and creates a page for each operation and named type.
graphql property accepts either a string (a local path or HTTPS URL) or an object with the following fields.
You must declare
graphql on a tab. A tab with graphql may include groups, but no other navigation structures, such as pages, versions, or languages. It also cannot include an openapi or asyncapi property.string
required
A local path to an SDL file in your documentation repository or an HTTPS URL to a hosted SDL file. Does not accept HTTP URLs.
string
The directory to store generated pages. Defaults to
graphql-reference.Generated pages
Mintlify organizes generated pages into three sections under the tab you configured:- Queries: One page per field on your
Queryroot type. - Mutations: One page per field on your
Mutationroot type. - Types: One page per named object, input, enum, interface, union, or scalar type.
Deprecations
Fields and arguments that you mark with@deprecated in your schema display as deprecated on the generated pages. If you provide a deprecation reason, it appears next to the field.
Update your documentation
Mintlify regenerates GraphQL reference pages when you runmint dev or when you push changes to your documentation repository. If your schema is hosted at an HTTPS URL, updates to the schema regenerate on the next build.