Skip to main content

directive

Provides utilities for handling and printing GraphQL directives in Markdown format

getCustomDirectiveResolver()

function getCustomDirectiveResolver(
resolver,
type,
constDirectiveOption,
fallback?,
): Maybe<string>;

Defined in: printer-legacy/src/directive.ts:30

Resolves a custom directive using the provided resolver function

Parameters

resolver

CustomDirectiveResolver

The resolver function name to execute

type

unknown

The GraphQL type to resolve the directive for

constDirectiveOption

CustomDirectiveMapItem

The directive configuration options

fallback?

Maybe<string>

Optional fallback value if resolution fails

Returns

Maybe<string>

The resolved directive value or fallback/undefined


getCustomTags()

function getCustomTags(type, options): Badge[];

Defined in: printer-legacy/src/directive.ts:120

Extracts custom tags from directives for a given type

Parameters

type

unknown

The GraphQL type to get tags for

options

PrintTypeOptions

General printing options

Returns

Badge[]

Array of badge configurations from directive tags


printCustomDirective()

function printCustomDirective(
type,
constDirectiveOption,
options,
): Maybe<string>;

Defined in: printer-legacy/src/directive.ts:56

Prints a custom directive as a Markdown string

Parameters

type

unknown

The GraphQL type to print the directive for

constDirectiveOption

CustomDirectiveMapItem

The directive configuration options

options

PrintTypeOptions

General printing options

Returns

Maybe<string>

Formatted Markdown string for the directive or undefined


printCustomDirectives()

function printCustomDirectives(type, options): string;

Defined in: printer-legacy/src/directive.ts:84

Prints all custom directives for a type as a Markdown section

Parameters

type

unknown

The GraphQL type to print directives for

options

PrintTypeOptions

General printing options

Returns

string

Markdown string containing all formatted directives


printCustomTags()

function printCustomTags(type, options): string | MDXString;

Defined in: printer-legacy/src/directive.ts:152

Prints custom directive tags as Markdown badges

Parameters

type

unknown

The GraphQL type to print tags for

options

PrintTypeOptions

General printing options

Returns

string | MDXString

Formatted Markdown string of badges or empty string