cli
This module provides the CLI functionality for generating documentation from GraphQL schemas. It exports utilities to run the documentation generator both programmatically and via CLI.
Seeβ
GraphQL Markdown Documentation
RunContextβ
Defined in: index.ts:38
Internal context set by GraphQL-Markdown entry points.
Propertiesβ
trigger?β
optional trigger?: TelemetryTrigger;
Defined in: index.ts:40
Entry point reported by anonymous telemetry.
GraphQLMarkdownCliTypeβ
type GraphQLMarkdownCliType = Command;
Defined in: index.ts:33
Type representing the GraphQL Markdown CLI.
Seeβ
GraphQL Markdown Documentation
getGraphQLMarkdownCli()β
function getGraphQLMarkdownCli(
options,
loggerModule?,
customFormatter?,
context?,
): Command;
Defined in: index.ts:101
Configures and returns the GraphQL Markdown CLI.
Parametersβ
optionsβ
ConfigOptions
Options for configuring the GraphQL Markdown CLI.
loggerModule?β
string
Optional logger module to use.
customFormatter?β
string
Optional default formatter package name. When provided, registers
--formatter and --mdxParser (deprecated) flags with this value as the default.
context?β
Optional internal context (telemetry trigger).
Returnsβ
Command
The configured CLI instance.
Exampleβ
const cli = getGraphQLMarkdownCli(
{ id: "custom" },
"custom-logger",
"@graphql-markdown/formatters/docusaurus",
);
await cli.parseAsync(process.argv);
runGraphQLMarkdown()β
function runGraphQLMarkdown(
options,
cliOptions?,
loggerModule?,
context?,
): Promise<void>;
Defined in: index.ts:60
Runs the GraphQL Markdown CLI to generate documentation from a GraphQL schema.
Parametersβ
optionsβ
ConfigOptions
Options for configuring the GraphQL Markdown CLI.
cliOptions?β
CliOptions
Optional command-line options passed to the CLI.
loggerModule?β
string
Optional logger module to use.
context?β
Optional internal context (telemetry trigger).
Returnsβ
Promise<void>
Exampleβ
await runGraphQLMarkdown(
{ id: "custom" },
{ schema: "./schema.graphql", root: "./docs" },
"custom-logger",
);