common
Common printer utility functions for handling descriptions, directives, and warnings.
formatDescription()β
function formatDescription(type, replacement): string | MDXString
Defined in: common.ts:68
Formats a GraphQL type description or falls back to a default message.
Parametersβ
typeβ
unknown
GraphQL type to get description from
replacementβ
Maybe
<string
> = NO_DESCRIPTION_TEXT
Optional fallback text if no description exists
Returnsβ
string
| MDXString
Formatted description string or MDX content
printCustomDirectives()β
function printCustomDirectives(type, options?): string
Defined in: common.ts:28
Prints documentation for custom directives applied to a type.
Parametersβ
typeβ
unknown
GraphQL type to get directives from
options?β
PrintTypeOptions
Printer configuration options
Returnsβ
string
Formatted directive documentation string
printDeprecation()β
function printDeprecation(type, options): string
Defined in: common.ts:112
Prints deprecation information for a GraphQL type if it is deprecated.
Parametersβ
typeβ
unknown
The GraphQL type to check for deprecation
optionsβ
PrintTypeOptions
Configuration options for printing
Returnsβ
string
Formatted deprecation warning as MDX string, or empty string if not deprecated
printDescription()β
function printDescription(
type,
options,
noText?): string | MDXString
Defined in: common.ts:138
Prints the complete description for a GraphQL type, including deprecation warnings and custom directives.
Parametersβ
typeβ
unknown
The GraphQL type to document
optionsβ
PrintTypeOptions
Configuration options for printing
noText?β
string
Optional text to display when no description exists
Returnsβ
string
| MDXString
Combined description, deprecation notices, and custom directives as MDX content
printWarning()β
function printWarning(param0, options): string
Defined in: common.ts:91
Generates a warning message block in MDX format.
Parametersβ
param0β
Warning configuration object
text?β
string
The warning message text
title?β
string
Optional title for the warning block
optionsβ
PrintTypeOptions
Configuration options for printing
Returnsβ
string
Formatted warning message as MDX string