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.
Parses GraphQL SDL files into the introspection schema. SDL files usually use the extension .graphqls
or .graphql
.
Provides the SDL in a raw string.
Disables introspection. This means that no documentation will be generated at all for GraphQL types. Only custom pages content will be generated.
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.
Dev
#
The extra-configuration used when running the dev command , allowing for live hot-reload of the preview website.
Quickstart
Command - Generate