Documentation
¶
Overview ¶
Package gqltagoperations ports @graphql-codegen/gql-tag-operations — the "gen-dts" plugin used by the client preset to emit gql.ts (the Documents registry + graphql() function with typed overloads).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintDocument ¶
func PrintDocument(doc *ast.QueryDocument) string
PrintDocument returns the printed SDL of an entire document. graphql-js joins definitions in AST order (fragments and operations interleaved), so we merge each document's ops and fragments by source line.
Types ¶
type OperationOrFragment ¶
type OperationOrFragment struct {
InitialName string
Definition any // *ast.OperationDefinition | *ast.FragmentDefinition
}
OperationOrFragment is a named operation or fragment with its initial variable name (e.g. GetUserDocument).
type Plugin ¶
type Plugin struct{}
Plugin implements plugin.Plugin for the "gen-dts" plugin (the name the client preset registers gql-tag-operations under).
type SourceWithOperations ¶
type SourceWithOperations struct {
Source *plugin.DocumentFile
Operations []OperationOrFragment
}
SourceWithOperations mirrors the upstream type: one document source plus the named operations/fragments it contains.