Skip to main content

Configuration

GraphQL-Markdown reads its settings from a GraphQL Config file, from framework options such as the Docusaurus plugin, and from CLI flags. Later sources take precedence over earlier ones.

GraphQL Config​

GraphQL Config is the recommended way to configure GraphQL-Markdown across all frameworks. Use a GraphQL Config file (multiple formats supported) to configure GraphQL-Markdown:

.graphqlrc
schema: "https://graphql.anilist.co/"
extensions:
graphql-markdown:
linkRoot: "/examples/default"
baseURL: "."
homepage: "data/anilist.md"
formatter: "@graphql-markdown/formatters/hugo"
loaders:
UrlLoader:
module: "@graphql-tools/url-loader"
options:
method: "POST"
printTypeOptions:
deprecated: "group"

For supported formatter presets, see Other frameworks.

For Docusaurus plugin options and site settings, see the Docusaurus guide.

Configuration lifecycle​

GraphQL-Markdown processes configuration sources in the following priority order (later sources override earlier ones):

  1. Default configuration: Built-in default settings
  2. GraphQL Config file (.graphqlrc): Framework-agnostic project settings
  3. Framework-specific configuration: for example, Docusaurus plugin settings
  4. CLI flags: Command-line arguments override all other settings

CLI flags let you override settings temporarily without editing your configuration files.

Current limitations:

  • Single schema only, no schema stitching
  • include, exclude, documents and glob pattern are not supported