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
getRelationLink()β
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
printLink()β
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
printParentLink()β
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
toLink()β
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