operation
Module for handling GraphQL operation printing functionality. Provides utilities to print operation types, metadata, and code representations.
printCodeOperation()β
const printCodeOperation: (type, options?, indentationLevel) => string | MDXString = printCodeField;
Defined in: graphql/operation.ts:57
Prints the code representation of an operation.
Generates a string representation of a GraphQL field including its arguments, return type, and deprecation status.
Parametersβ
typeβ
unknown
The GraphQL field type object to print
options?β
PrintTypeOptions
Optional configuration for printing the type
indentationLevel?β
number
= 0
The level of indentation to apply (default: 0)
Returnsβ
string
| MDXString
A formatted string representing the field or an empty string if the field should not be printed
Exampleβ
printCodeField({ name: 'user', type: 'User!', args: [{ name: 'id', type: 'ID!' }] })
// Returns: user(
// id: ID!
// ): User!
Seeβ
printCodeField
printOperationMetadata()β
function printOperationMetadata(type, options): string | MDXString
Defined in: graphql/operation.ts:39
Prints the operation metadata including arguments and type information.
Parametersβ
typeβ
unknown
The operation type to print metadata for
optionsβ
PrintTypeOptions
Print type options for customizing output
Returnsβ
string
| MDXString
Formatted string containing operation metadata or empty string if invalid
printOperationType()β
function printOperationType(type, options): string | MDXString
Defined in: graphql/operation.ts:18
Prints the operation type information.
Parametersβ
typeβ
unknown
The operation type to print
optionsβ
PrintTypeOptions
Print type options for customizing output
Returnsβ
string
| MDXString
Formatted string representation of the operation type or empty string if invalid