Generate GraphQL Reference
Fern generates API Reference documentation from a GraphQL schema. Add your schema file to your Fern project and Fern renders queries, mutations, subscriptions, and types as an interactive reference.
Configuration
Set up your project structure
Add your GraphQL schema file to your /fern directory and create a generators.yml that references it:
Customize the layout
For a full list of configuration options and layout customizations, see Customize API Reference layout.
Include more than one GraphQL Reference
To include multiple GraphQL definitions in your documentation, use the api-name property. The api-name corresponds to the folder name containing your GraphQL schema.
Configuration properties
Path to your GraphQL schema file. You can include multiple GraphQL specs if your project exposes more than one GraphQL API.
Name of the folder that operations from this spec appear under in the API Reference sidebar. Use this to group related GraphQL operations together.
URL of your GraphQL API endpoint. Fern performs introspection against this endpoint to fetch the schema. When set, running fern api update updates the local schema from this endpoint.