badge
Module for handling GraphQL type badges in MDX documentation. Provides functionality to generate and format badges for different GraphQL types and their properties like deprecation status, nullability, and relationships.
CSS_BADGE_CLASSNAMEβ
const CSS_BADGE_CLASSNAME: object;
Defined in: badge.ts:31
Type declarationβ
DEPRECATEDβ
DEPRECATED: string = "DEPRECATED";
NON_NULLβ
NON_NULL: string = "NON_NULL";
RELATIONβ
RELATION: string = "RELATION";
getTypeBadges()β
function getTypeBadges(type, groups?): Badge[]
Defined in: badge.ts:43
Gets an array of badges for a given GraphQL type.
Parametersβ
typeβ
unknown
The GraphQL type to generate badges for
groups?β
Maybe
<Partial
<Record
<SchemaEntity
, Record
<string
, Maybe
<string
>>>>>
Optional map of schema entities to their groups
Returnsβ
Badge
[]
Array of Badge objects containing text and optional classnames
printBadge()β
function printBadge(badge, options): MDXString
Defined in: badge.ts:97
Formats a single badge into MDX string format.
Parametersβ
badgeβ
Badge
The badge object containing text and optional classname
optionsβ
PrintTypeOptions
Options for printing/formatting the badge
Returnsβ
MDXString
Formatted MDX string representation of the badge
printBadges()β
function printBadges(type, options): string | MDXString
Defined in: badge.ts:115
Generates and formats all applicable badges for a GraphQL type.
Parametersβ
typeβ
unknown
The GraphQL type to generate badges for
optionsβ
PrintTypeOptions
Options for printing/formatting the badges
Returnsβ
string
| MDXString
Formatted MDX string containing all badges, or empty string if no badges or badges disabled