Skip to content
Last updated

info

Customize the overview section of your GraphQL API documentation with metadata like title, description, contact information, and license details.

Usage

Add the info object to your GraphQL configuration to display API metadata in the overview page:

redocly.yaml
graphql:
  info:
    title: GitHub GraphQL API
    version: v4
    description: |
      Comprehensive **GraphQL API** for GitHub.
      
      ## Features
      - Precise data queries
      - Strongly typed schema
    termsOfService: https://example.com/terms
    contact:
      name: API Support
      url: https://support.example.com
      email: support@example.com
    license:
      name: MIT
      url: https://opensource.org/licenses/MIT

Options

OptionTypeDescription
titlestringThe name of your GraphQL API. Appears in the page header and sidebar.
versionstringThe version of your API. Displays next to the title as Title (version).
descriptionstringMarkdown-formatted description of your API. Supports headings, lists, code blocks, and links.
termsOfServicestringURL to your API's terms of service. Displays as a link in the overview panel.
contactContact objectContact information for API support.
licenseLicense objectLicense information for your API.

Contact object

OptionTypeDescription
namestringName of the contact person or team.
urlstringURL to a contact page or support site.
emailstringContact email address for API support.

License object

OptionTypeDescription
namestringLicense name (e.g., MIT, Apache 2.0). Used as link text when identifier is not provided.
urlstringURL to the full license text.
identifierstringSPDX license identifier. When provided, displays instead of the license name.

Schema directives (alternative)

You can also define info metadata using GraphQL schema directives. Config values take precedence over schema directives.

directive @redocly_info(title: String, version: String, description: String, termsOfService: String) on SCHEMA
directive @redocly_contact(name: String, url: String, email: String) on SCHEMA
directive @redocly_license(name: String, url: String, identifier: String) on SCHEMA

schema 
  @redocly_info(
    title: "My API"
    version: "1.0"
    description: "API description from schema"
  )
  @redocly_contact(email: "support@example.com")
  @redocly_license(name: "MIT")
{
  query: Query
}

Schema docstring (fallback)

You can also provide title and description using GraphQL's standard docstring syntax. This has the lowest priority and is used only when values are not provided in config or directives.

"""
# My API Title

Description goes here.
Multiline etc etc.
"""
schema {
  query: Query
}

If the docstring starts with # (followed by a space) on the first line, that line is extracted as the title and the rest as the description. Otherwise, the entire docstring is used as the description.

Per-API customization

Use the apis configuration to customize info for each GraphQL API separately:

redocly.yaml
# Global defaults
graphql:
  info:
    contact:
      email: default@company.com

# Per-API overrides
apis:
  github-api@v1:
    root: ./github.graphql
    graphql:
      info:
        title: GitHub API (Production)
        contact:
          email: github-support@company.com
  
  internal-api@v1:
    root: ./internal.graphql
    graphql:
      info:
        title: Internal API
        contact:
          email: internal-support@company.com

Merge priority

When info is defined in multiple places, they merge with this priority (highest to lowest):

  1. Per-API config (apis.*.graphql.info) - highest priority
  2. Global config (graphql.info)
  3. Schema directives (@redocly_info, @redocly_contact, @redocly_license)
  4. Schema docstring ("""...""") - lowest priority (title and description only)

Resources