Skip to main content

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