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
GraphQLMarkdownCliTypeβ
type GraphQLMarkdownCliType = CommanderStatic;
Defined in: index.ts:29
Type representing the GraphQL Markdown CLI.
Seeβ
GraphQL Markdown Documentation
getGraphQLMarkdownCli()β
function getGraphQLMarkdownCli(
options,
loggerModule?,
customMdxParser?): CommanderStatic
Defined in: index.ts:84
Configures and returns the GraphQL Markdown CLI.
Parametersβ
optionsβ
GraphQLMarkdownCliOptions
Options for configuring the GraphQL Markdown CLI.
loggerModule?β
string
Optional logger module to use.
customMdxParser?β
Optional MDX parser configuration.
string
| boolean
Returnsβ
CommanderStatic
The configured CLI instance.
Exampleβ
const cli = getGraphQLMarkdownCli(
{ id: "custom" },
"custom-logger",
true
);
await cli.parseAsync(process.argv);
runGraphQLMarkdown()β
function runGraphQLMarkdown(
options,
cliOptions,
loggerModule?): Promise<void>
Defined in: index.ts:47
Runs the GraphQL Markdown CLI to generate documentation from a GraphQL schema.
Parametersβ
optionsβ
GraphQLMarkdownCliOptions
Options for configuring the GraphQL Markdown CLI.
cliOptionsβ
CliOptions
Command-line options passed to the CLI.
loggerModule?β
string
Optional logger module to use.
Returnsβ
Promise
<void
>
Exampleβ
await runGraphQLMarkdown(
{ id: "custom" },
{ schema: "./schema.graphql", root: "./docs" },
"custom-logger"
);