Last updated

Add GraphQL API descriptions

Transform your GraphQL schema files into reference documentation by integrating them into your project. The resulting documentation shows both the high-level elements such as queries and mutations, and the details of all the individual data types.

Give your users the tools they need to make the most of your GraphQL APIs with comprehensive reference documentation. Either add individual schema files to your project alongside your other content, or use an API catalog to showcase your GraphQL APIs alongside OpenAPI and AsyncAPI APIs.

Prerequisites

Ensure you have:

Include GraphQL schema in your project

Add the GraphQL schema files to your project. These can be added anywhere in the file structure, just like you might do with an OpenAPI or Markdoc file. When you access the URL for the location, the GraphQL reference documentation is shown.

For example, add a GraphQL schema file as apis/sample-schema.graphql, and then check the path /apis/sample-schema/ in your project to see the documentation.

Add schema to sidebar

To add a GraphQL schema file, add it as a page in the sidebars.yaml file.

- page: sample-schema.graphql
  label: Sample Schema

You can also use groups to structure sidebar navigation, check the documentation about sidebars.

Resources