Skip to main content

link

Module for handling links and link-related operations in GraphQL Markdown printer. Provides utilities for creating, formatting, and managing links to GraphQL types and operations.

API_GROUPS​

const API_GROUPS: Required<ApiGroupOverrideType>;

Defined in: link.ts:48


getCategoryLocale()​

function getCategoryLocale(type): Maybe<TypeLocale>

Defined in: link.ts:102

Gets the locale category for a given GraphQL type.

Parameters​

type​

unknown

The GraphQL type to get the category for

Returns​

Maybe<TypeLocale>

The locale category for the type, or undefined if not found


getLinkApiGroupFolder()​

function getLinkApiGroupFolder(type, groups?): string

Defined in: link.ts:188

Gets the folder name for an API group based on the GraphQL type and group options.

Parameters​

type​

unknown

The GraphQL type to get the folder name for

groups?​

Maybe<boolean | ApiGroupOverrideType>

The group options

Returns​

string

The folder name for the API group


getLinkCategoryFolder()​

function getLinkCategoryFolder(type, operationLocale?): Maybe<string>

Defined in: link.ts:131

Gets the folder name for a link category based on the GraphQL type and operation locale.

Parameters​

type​

unknown

The GraphQL type to get the folder name for

operationLocale?​

Maybe<TypeLocale>

The locale of the operation

Returns​

Maybe<string>

The folder name for the link category, or undefined if not found


getLinkDeprecatedFolder()​

function getLinkDeprecatedFolder(type, option): string

Defined in: link.ts:206

Gets the folder name for deprecated types based on the GraphQL type and deprecation option.

Parameters​

type​

unknown

The GraphQL type to get the folder name for

option​

Maybe<TypeDeprecatedOption>

The deprecation option

Returns​

string

The folder name for deprecated types


function getRelationLink(
category,
type,
options): Maybe<TypeLink>

Defined in: link.ts:306

Gets the link for a relation based on the category, type, and options.

Parameters​

category​

Maybe<TypeLocale>

The locale category of the relation

type​

unknown

The GraphQL type of the relation

options​

PrintLinkOptions

Configuration options for link generation

Returns​

Maybe<TypeLink>

The link object for the relation, or undefined if not found


hasOptionParentType()​

function hasOptionParentType(options): boolean

Defined in: link.ts:172

Checks if the options include the parentTypePrefix attribute.

Parameters​

options​

PrintLinkOptions

The options to check

Returns​

boolean

true if the options include parentTypePrefix, false otherwise


hasOptionWithAttributes()​

function hasOptionWithAttributes(options): boolean

Defined in: link.ts:162

Checks if the options include the withAttributes attribute.

Parameters​

options​

PrintLinkOptions

The options to check

Returns​

boolean

true if the options include withAttributes, false otherwise


hasPrintableDirective()​

function hasPrintableDirective(type, options?): boolean

Defined in: link.ts:63

Checks if a type has printable directives based on the provided options.

Parameters​

type​

unknown

The GraphQL type to check

options?​

Pick<PrintTypeOptions, "deprecated" | "onlyDocDirectives" | "skipDocDirectives">

Configuration options for directive printing

Returns​

boolean

true if the type should be printed, false otherwise


function printLink(type, options): string

Defined in: link.ts:363

Prints a link for a GraphQL type based on the provided options.

Parameters​

type​

unknown

The GraphQL type to print a link for

options​

PrintLinkOptions

Configuration options for link generation

Returns​

string

The formatted link as a string


printLinkAttributes()​

function printLinkAttributes(type, text): string

Defined in: link.ts:329

Prints the attributes of a link based on the GraphQL type.

Parameters​

type​

unknown

The GraphQL type to print attributes for

text​

Maybe<string> = ""

The text to append attributes to

Returns​

string

The text with appended attributes


function printParentLink(type, options): string | MDXString

Defined in: link.ts:395

Prints a parent link for a GraphQL type based on the provided options.

Parameters​

type​

unknown

The GraphQL type to print a parent link for

options​

PrintLinkOptions

Configuration options for link generation

Returns​

string | MDXString

The formatted parent link as a string or MDX string


function toLink(
type,
name,
operation,
options): TypeLink

Defined in: link.ts:229

Converts a GraphQL type to a link object.

Parameters​

type​

unknown

The GraphQL type to convert

name​

string

The name of the type

operation​

Maybe<TypeLocale>

The locale of the operation

options​

PrintLinkOptions

Configuration options for link generation

Returns​

TypeLink

The link object for the type