Documentation
¶
Overview ¶
Package typer is responsible for converting GraphQL schema types and query selections into Argo wire types. It processes GraphQL operations (queries, mutations, subscriptions) and their associated fragments to determine the static Argo type structure for the expected response, including handling of Argo-specific directives for codec and deduplication control.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ArgoDirectives = []*ast.DirectiveDefinition{ argoDirs.ArgoCodecDirective, argoDirs.ArgoDeduplicateDirective, }
ArgoDirectives lists the custom Argo-specific directives that the Typer recognizes and processes.
Functions ¶
This section is empty.
Types ¶
type SelectedFieldNode ¶
type SelectedFieldNode struct {
SelectedBy ast.Selection // The AST node (Field, FragmentSpread, InlineFragment) that selected this field.
Field *ast.Field // The actual ast.Field that was selected.
}
SelectedFieldNode represents a GraphQL field that is part of a selection set, along with the AST node (Field, FragmentSpread, or InlineFragment) that caused it to be selected. This is used during the collection of fields to track the origin of each selected field, which is important for resolving type conditions and merging fields from different paths.
type Typer ¶
type Typer struct {
// contains filtered or unexported fields
}
Typer translates GraphQL schema definitions and query documents into Argo wire types. It holds the context of the current GraphQL schema, the query document being processed, fragment definitions, and the resolved Argo wire types for various parts of the query. The Typer focuses on a single operation within the query document.
func NewTyper ¶
NewTyper creates a new Typer for a given GraphQL schema, query document, and operation name. If the query document contains multiple operations, an operationName must be provided. It initializes fragment definitions and identifies the target operation.
func (*Typer) DataWireType ¶
DataWireType computes the Argo wire.Type specifically for the 'data' part of a GraphQL response, based on the operation's selection set against the root operation type.
func (*Typer) Operation ¶
func (t *Typer) Operation() *ast.OperationDefinition
Operation returns the specific *ast.OperationDefinition that this Typer instance is processing.