Magidoc configuration

The website is customizable through different options defined in a magidoc.mjs. The mjs extension tells Node to load the javascript file as an ES Module, allowing you to use the import/export syntax and top-level async/await.

Introspection

#

The introspection configuration object determines how Magidoc fetches the introspection schema for your API. This can be accomplished either using a live endpoint or SDL files.

Fetches the introspection schema from a live API endpoint using the introspection query.

    
  

Website

#

The website object specifies different options for building the documentation website.

    
  

The list of available templates can be found on the templates page.

queryGenerationFactories

#

The query generation factories are used to customize query parameters in the generated queries. This is useful in the event that your API contains custom scalars, or that you want to return custom values for a type.

To know more about the extent of what is possible with queryGenerationFactories, read the query generator documentation.

Magidoc CLI uses environment variables to pass options to the templates, which means that functions are not supported here, unlike when using the graphql-query-generator directly. If you wish to have more customization options of the output variables, you will need to use the eject command and customize the template directly.

Dev

#

The extra-configuration used when running the dev command, allowing for live hot-reload of the preview website.