Documentation ¶
Overview ¶
Package astvisitor enables efficient and powerful traversal of GraphQL document AST's.
Visitor has more options to configure the behaviour and offers more meta data than SimpleVisitor. SimpleVisitor on the other hand is more performant.
If all Nodes should be visited and not much meta data is needed, go with SimpleVisitor. If you only need to visit a subset of Nodes or want specific meta data, e.g. TypeDefinitions you should go with Visitor.
Index ¶
- Variables
- type AllNodesVisitor
- type ArgumentVisitor
- type DirectiveDefinitionVisitor
- type DirectiveLocationVisitor
- type DirectiveVisitor
- type DocumentVisitor
- type EnterArgumentVisitor
- type EnterDirectiveDefinitionVisitor
- type EnterDirectiveLocationVisitor
- type EnterDirectiveVisitor
- type EnterDocumentVisitor
- type EnterEnumTypeDefinitionVisitor
- type EnterEnumTypeExtensionVisitor
- type EnterEnumValueDefinitionVisitor
- type EnterFieldDefinitionVisitor
- type EnterFieldVisitor
- type EnterFragmentDefinitionVisitor
- type EnterFragmentSpreadVisitor
- type EnterInlineFragmentVisitor
- type EnterInputObjectTypeDefinitionVisitor
- type EnterInputObjectTypeExtensionVisitor
- type EnterInputValueDefinitionVisitor
- type EnterInterfaceTypeDefinitionVisitor
- type EnterInterfaceTypeExtensionVisitor
- type EnterObjectTypeDefinitionVisitor
- type EnterObjectTypeExtensionVisitor
- type EnterOperationDefinitionVisitor
- type EnterRootOperationTypeDefinitionVisitor
- type EnterScalarTypeDefinitionVisitor
- type EnterScalarTypeExtensionVisitor
- type EnterSchemaDefinitionVisitor
- type EnterSchemaExtensionVisitor
- type EnterSelectionSetVisitor
- type EnterUnionMemberTypeVisitor
- type EnterUnionTypeDefinitionVisitor
- type EnterUnionTypeExtensionVisitor
- type EnterVariableDefinitionVisitor
- type EnumTypeDefinitionVisitor
- type EnumTypeExtensionVisitor
- type EnumValueDefinitionVisitor
- type ExecutableVisitor
- type FieldDefinitionVisitor
- type FieldVisitor
- type FragmentDefinitionVisitor
- type FragmentSpreadVisitor
- type InlineFragmentVisitor
- type InputObjectTypeDefinitionVisitor
- type InputObjectTypeExtensionVisitor
- type InputValueDefinitionVisitor
- type InterfaceTypeDefinitionVisitor
- type InterfaceTypeExtensionVisitor
- type LeaveArgumentVisitor
- type LeaveDirectiveDefinitionVisitor
- type LeaveDirectiveLocationVisitor
- type LeaveDirectiveVisitor
- type LeaveDocumentVisitor
- type LeaveEnumTypeDefinitionVisitor
- type LeaveEnumTypeExtensionVisitor
- type LeaveEnumValueDefinitionVisitor
- type LeaveFieldDefinitionVisitor
- type LeaveFieldVisitor
- type LeaveFragmentDefinitionVisitor
- type LeaveFragmentSpreadVisitor
- type LeaveInlineFragmentVisitor
- type LeaveInputObjectTypeDefinitionVisitor
- type LeaveInputObjectTypeExtensionVisitor
- type LeaveInputValueDefinitionVisitor
- type LeaveInterfaceTypeDefinitionVisitor
- type LeaveInterfaceTypeExtensionVisitor
- type LeaveObjectTypeDefinitionVisitor
- type LeaveObjectTypeExtensionVisitor
- type LeaveOperationDefinitionVisitor
- type LeaveRootOperationTypeDefinitionVisitor
- type LeaveScalarTypeDefinitionVisitor
- type LeaveScalarTypeExtensionVisitor
- type LeaveSchemaDefinitionVisitor
- type LeaveSchemaExtensionVisitor
- type LeaveSelectionSetVisitor
- type LeaveUnionMemberTypeVisitor
- type LeaveUnionTypeDefinitionVisitor
- type LeaveUnionTypeExtensionVisitor
- type LeaveVariableDefinitionVisitor
- type ObjectTypeDefinitionVisitor
- type ObjectTypeExtensionVisitor
- type OperationDefinitionVisitor
- type RootOperationTypeDefinitionVisitor
- type ScalarTypeDefinitionVisitor
- type ScalarTypeExtensionVisitor
- type SchemaDefinitionVisitor
- type SchemaExtensionVisitor
- type SelectionSetVisitor
- type SimpleWalker
- type SkipVisitors
- type TypeSystemVisitor
- type UnionMemberTypeVisitor
- type UnionTypeDefinitionVisitor
- type UnionTypeExtensionVisitor
- type VariableDefinitionVisitor
- type VisitorFilter
- type VisitorIdentifier
- type VisitorKind
- type Walker
- func (w *Walker) Ancestor() ast.Node
- func (w *Walker) AncestorNameBytes() ast.ByteSlice
- func (w *Walker) ArgumentInputValueDefinition(argument int) (definition int, exits bool)
- func (w *Walker) DefferOnEnterField(fn func())
- func (w *Walker) FieldDefinition(field int) (definition int, exists bool)
- func (w *Walker) FieldDefinitionDirectiveArgumentValueByName(field int, directiveName, argumentName ast.ByteSlice) (ast.Value, bool)
- func (w *Walker) FieldDefinitionWithExists(field int) (definition int, exists bool)
- func (w *Walker) HandleInternalErr(err error) bool
- func (w *Walker) RegisterAllNodesVisitor(visitor AllNodesVisitor)
- func (w *Walker) RegisterArgumentVisitor(visitor ArgumentVisitor)
- func (w *Walker) RegisterDirectiveDefinitionVisitor(visitor DirectiveDefinitionVisitor)
- func (w *Walker) RegisterDirectiveLocationVisitor(visitor DirectiveLocationVisitor)
- func (w *Walker) RegisterDirectiveVisitor(visitor DirectiveVisitor)
- func (w *Walker) RegisterDocumentVisitor(visitor DocumentVisitor)
- func (w *Walker) RegisterEnterArgumentVisitor(visitor EnterArgumentVisitor)
- func (w *Walker) RegisterEnterDirectiveDefinitionVisitor(visitor EnterDirectiveDefinitionVisitor)
- func (w *Walker) RegisterEnterDirectiveLocationVisitor(visitor EnterDirectiveLocationVisitor)
- func (w *Walker) RegisterEnterDirectiveVisitor(visitor EnterDirectiveVisitor)
- func (w *Walker) RegisterEnterDocumentVisitor(visitor EnterDocumentVisitor)
- func (w *Walker) RegisterEnterEnumTypeDefinitionVisitor(visitor EnterEnumTypeDefinitionVisitor)
- func (w *Walker) RegisterEnterEnumTypeExtensionVisitor(visitor EnterEnumTypeExtensionVisitor)
- func (w *Walker) RegisterEnterEnumValueDefinitionVisitor(visitor EnterEnumValueDefinitionVisitor)
- func (w *Walker) RegisterEnterFieldDefinitionVisitor(visitor EnterFieldDefinitionVisitor)
- func (w *Walker) RegisterEnterFieldVisitor(visitor EnterFieldVisitor)
- func (w *Walker) RegisterEnterFragmentDefinitionVisitor(visitor EnterFragmentDefinitionVisitor)
- func (w *Walker) RegisterEnterFragmentSpreadVisitor(visitor EnterFragmentSpreadVisitor)
- func (w *Walker) RegisterEnterInlineFragmentVisitor(visitor EnterInlineFragmentVisitor)
- func (w *Walker) RegisterEnterInputObjectTypeDefinitionVisitor(visitor EnterInputObjectTypeDefinitionVisitor)
- func (w *Walker) RegisterEnterInputObjectTypeExtensionVisitor(visitor EnterInputObjectTypeExtensionVisitor)
- func (w *Walker) RegisterEnterInputValueDefinitionVisitor(visitor EnterInputValueDefinitionVisitor)
- func (w *Walker) RegisterEnterInterfaceTypeDefinitionVisitor(visitor EnterInterfaceTypeDefinitionVisitor)
- func (w *Walker) RegisterEnterInterfaceTypeExtensionVisitor(visitor EnterInterfaceTypeExtensionVisitor)
- func (w *Walker) RegisterEnterObjectTypeDefinitionVisitor(visitor EnterObjectTypeDefinitionVisitor)
- func (w *Walker) RegisterEnterObjectTypeExtensionVisitor(visitor EnterObjectTypeExtensionVisitor)
- func (w *Walker) RegisterEnterOperationVisitor(visitor EnterOperationDefinitionVisitor)
- func (w *Walker) RegisterEnterRootOperationTypeDefinitionVisitor(visitor EnterRootOperationTypeDefinitionVisitor)
- func (w *Walker) RegisterEnterScalarTypeDefinitionVisitor(visitor EnterScalarTypeDefinitionVisitor)
- func (w *Walker) RegisterEnterScalarTypeExtensionVisitor(visitor EnterScalarTypeExtensionVisitor)
- func (w *Walker) RegisterEnterSchemaDefinitionVisitor(visitor EnterSchemaDefinitionVisitor)
- func (w *Walker) RegisterEnterSchemaExtensionVisitor(visitor EnterSchemaExtensionVisitor)
- func (w *Walker) RegisterEnterSelectionSetVisitor(visitor EnterSelectionSetVisitor)
- func (w *Walker) RegisterEnterUnionMemberTypeVisitor(visitor EnterUnionMemberTypeVisitor)
- func (w *Walker) RegisterEnterUnionTypeDefinitionVisitor(visitor EnterUnionTypeDefinitionVisitor)
- func (w *Walker) RegisterEnterUnionTypeExtensionVisitor(visitor EnterUnionTypeExtensionVisitor)
- func (w *Walker) RegisterEnterVariableDefinitionVisitor(visitor EnterVariableDefinitionVisitor)
- func (w *Walker) RegisterEnumTypeDefinitionVisitor(visitor EnumTypeDefinitionVisitor)
- func (w *Walker) RegisterEnumTypeExtensionVisitor(visitor EnumTypeExtensionVisitor)
- func (w *Walker) RegisterEnumValueDefinitionVisitor(visitor EnumValueDefinitionVisitor)
- func (w *Walker) RegisterExecutableVisitor(visitor ExecutableVisitor)
- func (w *Walker) RegisterFieldDefinitionVisitor(visitor FieldDefinitionVisitor)
- func (w *Walker) RegisterFieldVisitor(visitor FieldVisitor)
- func (w *Walker) RegisterFragmentDefinitionVisitor(visitor FragmentDefinitionVisitor)
- func (w *Walker) RegisterFragmentSpreadVisitor(visitor FragmentSpreadVisitor)
- func (w *Walker) RegisterInlineFragmentVisitor(visitor InlineFragmentVisitor)
- func (w *Walker) RegisterInputObjectTypeDefinitionVisitor(visitor InputObjectTypeDefinitionVisitor)
- func (w *Walker) RegisterInputObjectTypeExtensionVisitor(visitor InputObjectTypeExtensionVisitor)
- func (w *Walker) RegisterInputValueDefinitionVisitor(visitor InputValueDefinitionVisitor)
- func (w *Walker) RegisterInterfaceTypeDefinitionVisitor(visitor InterfaceTypeDefinitionVisitor)
- func (w *Walker) RegisterInterfaceTypeExtensionVisitor(visitor InterfaceTypeExtensionVisitor)
- func (w *Walker) RegisterLeaveArgumentVisitor(visitor LeaveArgumentVisitor)
- func (w *Walker) RegisterLeaveDirectiveDefinitionVisitor(visitor LeaveDirectiveDefinitionVisitor)
- func (w *Walker) RegisterLeaveDirectiveLocationVisitor(visitor LeaveDirectiveLocationVisitor)
- func (w *Walker) RegisterLeaveDirectiveVisitor(visitor LeaveDirectiveVisitor)
- func (w *Walker) RegisterLeaveDocumentVisitor(visitor LeaveDocumentVisitor)
- func (w *Walker) RegisterLeaveEnumTypeDefinitionVisitor(visitor LeaveEnumTypeDefinitionVisitor)
- func (w *Walker) RegisterLeaveEnumTypeExtensionVisitor(visitor LeaveEnumTypeExtensionVisitor)
- func (w *Walker) RegisterLeaveEnumValueDefinitionVisitor(visitor LeaveEnumValueDefinitionVisitor)
- func (w *Walker) RegisterLeaveFieldDefinitionVisitor(visitor LeaveFieldDefinitionVisitor)
- func (w *Walker) RegisterLeaveFieldVisitor(visitor LeaveFieldVisitor)
- func (w *Walker) RegisterLeaveFragmentDefinitionVisitor(visitor LeaveFragmentDefinitionVisitor)
- func (w *Walker) RegisterLeaveFragmentSpreadVisitor(visitor LeaveFragmentSpreadVisitor)
- func (w *Walker) RegisterLeaveInlineFragmentVisitor(visitor LeaveInlineFragmentVisitor)
- func (w *Walker) RegisterLeaveInputObjectTypeDefinitionVisitor(visitor LeaveInputObjectTypeDefinitionVisitor)
- func (w *Walker) RegisterLeaveInputObjectTypeExtensionVisitor(visitor LeaveInputObjectTypeExtensionVisitor)
- func (w *Walker) RegisterLeaveInputValueDefinitionVisitor(visitor LeaveInputValueDefinitionVisitor)
- func (w *Walker) RegisterLeaveInterfaceTypeDefinitionVisitor(visitor LeaveInterfaceTypeDefinitionVisitor)
- func (w *Walker) RegisterLeaveInterfaceTypeExtensionVisitor(visitor LeaveInterfaceTypeExtensionVisitor)
- func (w *Walker) RegisterLeaveObjectTypeDefinitionVisitor(visitor LeaveObjectTypeDefinitionVisitor)
- func (w *Walker) RegisterLeaveObjectTypeExtensionVisitor(visitor LeaveObjectTypeExtensionVisitor)
- func (w *Walker) RegisterLeaveOperationVisitor(visitor LeaveOperationDefinitionVisitor)
- func (w *Walker) RegisterLeaveRootOperationTypeDefinitionVisitor(visitor LeaveRootOperationTypeDefinitionVisitor)
- func (w *Walker) RegisterLeaveScalarTypeDefinitionVisitor(visitor LeaveScalarTypeDefinitionVisitor)
- func (w *Walker) RegisterLeaveScalarTypeExtensionVisitor(visitor LeaveScalarTypeExtensionVisitor)
- func (w *Walker) RegisterLeaveSchemaDefinitionVisitor(visitor LeaveSchemaDefinitionVisitor)
- func (w *Walker) RegisterLeaveSchemaExtensionVisitor(visitor LeaveSchemaExtensionVisitor)
- func (w *Walker) RegisterLeaveSelectionSetVisitor(visitor LeaveSelectionSetVisitor)
- func (w *Walker) RegisterLeaveUnionMemberTypeVisitor(visitor LeaveUnionMemberTypeVisitor)
- func (w *Walker) RegisterLeaveUnionTypeDefinitionVisitor(visitor LeaveUnionTypeDefinitionVisitor)
- func (w *Walker) RegisterLeaveUnionTypeExtensionVisitor(visitor LeaveUnionTypeExtensionVisitor)
- func (w *Walker) RegisterLeaveVariableDefinitionVisitor(visitor LeaveVariableDefinitionVisitor)
- func (w *Walker) RegisterObjectTypeDefinitionVisitor(visitor ObjectTypeDefinitionVisitor)
- func (w *Walker) RegisterObjectTypeExtensionVisitor(visitor ObjectTypeExtensionVisitor)
- func (w *Walker) RegisterOperationDefinitionVisitor(visitor OperationDefinitionVisitor)
- func (w *Walker) RegisterRootOperationTypeDefinitionVisitor(visitor RootOperationTypeDefinitionVisitor)
- func (w *Walker) RegisterScalarTypeDefinitionVisitor(visitor ScalarTypeDefinitionVisitor)
- func (w *Walker) RegisterScalarTypeExtensionVisitor(visitor ScalarTypeExtensionVisitor)
- func (w *Walker) RegisterSchemaDefinitionVisitor(visitor SchemaDefinitionVisitor)
- func (w *Walker) RegisterSchemaExtensionVisitor(visitor SchemaExtensionVisitor)
- func (w *Walker) RegisterSelectionSetVisitor(visitor SelectionSetVisitor)
- func (w *Walker) RegisterTypeSystemVisitor(visitor TypeSystemVisitor)
- func (w *Walker) RegisterUnionMemberTypeVisitor(visitor UnionMemberTypeVisitor)
- func (w *Walker) RegisterUnionTypeDefinitionVisitor(visitor UnionTypeDefinitionVisitor)
- func (w *Walker) RegisterUnionTypeExtensionVisitor(visitor UnionTypeExtensionVisitor)
- func (w *Walker) RegisterVariableDefinitionVisitor(visitor VariableDefinitionVisitor)
- func (w *Walker) Release()
- func (w *Walker) ResetVisitors()
- func (w *Walker) RevisitNode()
- func (w *Walker) SetVisitorFilter(filter VisitorFilter)
- func (w *Walker) SkipNode()
- func (w *Walker) Stop()
- func (w *Walker) StopWithErr(internal error, external operationreport.ExternalError)
- func (w *Walker) StopWithExternalErr(err operationreport.ExternalError)
- func (w *Walker) StopWithInternalErr(err error)
- func (w *Walker) Walk(document, definition *ast.Document, report *operationreport.Report)
Constants ¶
This section is empty.
Variables ¶
var ( ErrDocumentMustNotBeNil = fmt.Errorf("document must not be nil") ErrDefinitionMustNotBeNil = fmt.Errorf("definition must not be nil when walking operations") )
Functions ¶
This section is empty.
Types ¶
type AllNodesVisitor ¶
type AllNodesVisitor interface { DocumentVisitor TypeSystemVisitor ExecutableVisitor }
AllNodesVisitor is the callback when the walker enters or leaves any Node
type ArgumentVisitor ¶
type ArgumentVisitor interface { EnterArgumentVisitor LeaveArgumentVisitor }
ArgumentVisitor is the callback when the walker enters or leaves an argument
type DirectiveDefinitionVisitor ¶
type DirectiveDefinitionVisitor interface { EnterDirectiveDefinitionVisitor LeaveDirectiveDefinitionVisitor }
DirectiveDefinitionVisitor is the callback when the walker enters or leaves a directive definition
type DirectiveLocationVisitor ¶
type DirectiveLocationVisitor interface { EnterDirectiveLocationVisitor LeaveDirectiveLocationVisitor }
DirectiveLocationVisitor is the callback when the walker enters or leaves a directive location
type DirectiveVisitor ¶
type DirectiveVisitor interface { EnterDirectiveVisitor LeaveDirectiveVisitor }
DirectiveVisitor is the callback when the walker enters or leaves a directive
type DocumentVisitor ¶
type DocumentVisitor interface { EnterDocumentVisitor LeaveDocumentVisitor }
DocumentVisitor is the callback when the walker enters or leaves a document
type EnterArgumentVisitor ¶
type EnterArgumentVisitor interface { // EnterArgument gets called when the walker enters an argument // ref is the reference to the selection set on the AST EnterArgument(ref int) }
EnterArgumentVisitor is the callback when the walker enters an argument
type EnterDirectiveDefinitionVisitor ¶
type EnterDirectiveDefinitionVisitor interface { // EnterDirectiveDefinition gets called when the walker enters a directive definition // ref is the reference to the selection set on the AST EnterDirectiveDefinition(ref int) }
EnterDirectiveDefinitionVisitor is the callback when the walker enters a directive definition
type EnterDirectiveLocationVisitor ¶
type EnterDirectiveLocationVisitor interface { // EnterDirectiveLocation gets called when the walker enters a directive location // ref is the reference to the selection set on the AST EnterDirectiveLocation(location ast.DirectiveLocation) }
EnterDirectiveLocationVisitor is the callback when the walker enters a directive location
type EnterDirectiveVisitor ¶
type EnterDirectiveVisitor interface { // EnterDirective gets called when the walker enters a directive // ref is the reference to the selection set on the AST EnterDirective(ref int) }
EnterDirectiveVisitor is the callback when the walker enters a directive
type EnterDocumentVisitor ¶
type EnterDocumentVisitor interface { // EnterDocument gets called when the walker enters a document EnterDocument(operation, definition *ast.Document) }
EnterDocumentVisitor is the callback when the walker enters a document
type EnterEnumTypeDefinitionVisitor ¶
type EnterEnumTypeDefinitionVisitor interface { // EnterEnumTypeDefinition gets called when the walker enters an enum type definition // ref is the reference to the selection set on the AST EnterEnumTypeDefinition(ref int) }
EnterEnumTypeDefinitionVisitor is the callback when the walker enters an enum type definition
type EnterEnumTypeExtensionVisitor ¶
type EnterEnumTypeExtensionVisitor interface { // EnterEnumTypeExtension gets called when the walker enters an enum type extension // ref is the reference to the selection set on the AST EnterEnumTypeExtension(ref int) }
EnterEnumTypeExtensionVisitor is the callback when the walker enters an enum type extension
type EnterEnumValueDefinitionVisitor ¶
type EnterEnumValueDefinitionVisitor interface { // EnterEnumValueDefinition gets called when the walker enters an enum value definition // ref is the reference to the selection set on the AST EnterEnumValueDefinition(ref int) }
EnterEnumValueDefinitionVisitor is the callback when the walker enters an enum value definition
type EnterFieldDefinitionVisitor ¶
type EnterFieldDefinitionVisitor interface { // EnterFieldDefinition gets called when the walker enters a field definition // ref is the reference to the selection set on the AST EnterFieldDefinition(ref int) }
EnterFieldDefinitionVisitor is the callback when the walker enters a field definition
type EnterFieldVisitor ¶
type EnterFieldVisitor interface { // EnterField gets called when the walker enters a field // ref is the reference to the selection set on the AST EnterField(ref int) }
EnterFieldVisitor is the callback when the walker enters a field
type EnterFragmentDefinitionVisitor ¶
type EnterFragmentDefinitionVisitor interface { // EnterFragmentDefinition gets called when the walker enters a fragment definition // ref is the reference to the selection set on the AST EnterFragmentDefinition(ref int) }
EnterFragmentDefinitionVisitor is the callback when the walker enters a fragment definition
type EnterFragmentSpreadVisitor ¶
type EnterFragmentSpreadVisitor interface { // EnterFragmentSpread gets called when the walker enters a fragment spread // ref is the reference to the selection set on the AST EnterFragmentSpread(ref int) }
EnterFragmentSpreadVisitor is the callback when the walker enters a fragment spread
type EnterInlineFragmentVisitor ¶
type EnterInlineFragmentVisitor interface { // EnterInlineFragment gets called when the walker enters an inline fragment // ref is the reference to the selection set on the AST EnterInlineFragment(ref int) }
EnterInlineFragmentVisitor is the callback when the walker enters an inline fragment
type EnterInputObjectTypeDefinitionVisitor ¶
type EnterInputObjectTypeDefinitionVisitor interface { // EnterInputObjectTypeDefinition gets called when the walker enters an input object type definition // ref is the reference to the selection set on the AST EnterInputObjectTypeDefinition(ref int) }
EnterInputObjectTypeDefinitionVisitor is the callback when the walker enters an input object type definition
type EnterInputObjectTypeExtensionVisitor ¶
type EnterInputObjectTypeExtensionVisitor interface { // EnterInputObjectTypeExtension gets called when the walker enters an input object type extension // ref is the reference to the selection set on the AST EnterInputObjectTypeExtension(ref int) }
EnterInputObjectTypeExtensionVisitor is the callback when the walker enters an input object type extension
type EnterInputValueDefinitionVisitor ¶
type EnterInputValueDefinitionVisitor interface { // EnterInputValueDefinition gets called when the walker enters an input value definition // ref is the reference to the selection set on the AST EnterInputValueDefinition(ref int) }
EnterInputValueDefinitionVisitor is the callback when the walker enters an input value definition
type EnterInterfaceTypeDefinitionVisitor ¶
type EnterInterfaceTypeDefinitionVisitor interface { // EnterInterfaceTypeDefinition gets called when the walker enters an interface type definition // ref is the reference to the selection set on the AST EnterInterfaceTypeDefinition(ref int) }
EnterInterfaceTypeDefinitionVisitor is the callback when the walker enters an interface type definition
type EnterInterfaceTypeExtensionVisitor ¶
type EnterInterfaceTypeExtensionVisitor interface { // EnterInterfaceTypeExtension gets called when the walker enters an interface type extension // ref is the reference to the selection set on the AST EnterInterfaceTypeExtension(ref int) }
EnterInterfaceTypeExtensionVisitor is the callback when the walker enters an interface type extension
type EnterObjectTypeDefinitionVisitor ¶
type EnterObjectTypeDefinitionVisitor interface { // EnterObjectTypeDefinition gets called when the walker enters an object type definition // ref is the reference to the selection set on the AST EnterObjectTypeDefinition(ref int) }
EnterObjectTypeDefinitionVisitor is the callback when the walker enters an object type definition
type EnterObjectTypeExtensionVisitor ¶
type EnterObjectTypeExtensionVisitor interface { // EnterObjectTypeExtension gets called when the walker enters an object type extension // ref is the reference to the selection set on the AST EnterObjectTypeExtension(ref int) }
EnterObjectTypeExtensionVisitor is the callback when the walker enters an object type extension
type EnterOperationDefinitionVisitor ¶
type EnterOperationDefinitionVisitor interface { // EnterOperationDefinition gets called when the walker enters an operation definition // ref is the reference to the operation definition on the AST EnterOperationDefinition(ref int) }
EnterOperationDefinitionVisitor is the callback when the walker enters an operation definition
type EnterRootOperationTypeDefinitionVisitor ¶
type EnterRootOperationTypeDefinitionVisitor interface { // EnterRootOperationTypeDefinition gets called when the walker enters a root operation type definition // ref is the reference to the selection set on the AST EnterRootOperationTypeDefinition(ref int) }
EnterRootOperationTypeDefinitionVisitor is the callback when the walker enters a root operation type definition
type EnterScalarTypeDefinitionVisitor ¶
type EnterScalarTypeDefinitionVisitor interface { // EnterScalarTypeDefinition gets called when the walker enters a scalar type definition // ref is the reference to the selection set on the AST EnterScalarTypeDefinition(ref int) }
EnterScalarTypeDefinitionVisitor is the callback when the walker enters a scalar type definition
type EnterScalarTypeExtensionVisitor ¶
type EnterScalarTypeExtensionVisitor interface { // EnterScalarTypeExtension gets called when the walker enters a scalar type extension // ref is the reference to the selection set on the AST EnterScalarTypeExtension(ref int) }
EnterScalarTypeExtensionVisitor is the callback when the walker enters a scalar type extension
type EnterSchemaDefinitionVisitor ¶
type EnterSchemaDefinitionVisitor interface { // EnterSchemaDefinition gets called when the walker enters a schema definition // ref is the reference to the selection set on the AST EnterSchemaDefinition(ref int) }
EnterSchemaDefinitionVisitor is the callback when the walker enters a schema definition
type EnterSchemaExtensionVisitor ¶
type EnterSchemaExtensionVisitor interface { // EnterSchemaExtension gets called when the walker enters a schema extension // ref is the reference to the selection set on the AST EnterSchemaExtension(ref int) }
EnterSchemaExtensionVisitor is the callback when the walker enters a schema extension
type EnterSelectionSetVisitor ¶
type EnterSelectionSetVisitor interface { // EnterSelectionSet gets called when the walker enters a selection set // ref is the reference to the selection set on the AST EnterSelectionSet(ref int) }
EnterSelectionSetVisitor is the callback when the walker enters a selection set
type EnterUnionMemberTypeVisitor ¶
type EnterUnionMemberTypeVisitor interface { // EnterUnionMemberType gets called when the walker enters a union member type // ref is the reference to the selection set on the AST EnterUnionMemberType(ref int) }
EnterUnionMemberTypeVisitor is the callback when the walker enters a union member type
type EnterUnionTypeDefinitionVisitor ¶
type EnterUnionTypeDefinitionVisitor interface { // EnterUnionTypeDefinition gets called when the walker enters a union type definition // ref is the reference to the selection set on the AST EnterUnionTypeDefinition(ref int) }
EnterUnionTypeDefinitionVisitor is the callback when the walker enters a union type definition
type EnterUnionTypeExtensionVisitor ¶
type EnterUnionTypeExtensionVisitor interface { // EnterUnionTypeExtension gets called when the walker enters a union type extension // ref is the reference to the selection set on the AST EnterUnionTypeExtension(ref int) }
EnterUnionTypeExtensionVisitor is the callback when the walker enters a union type extension
type EnterVariableDefinitionVisitor ¶
type EnterVariableDefinitionVisitor interface { // EnterVariableDefinition gets called when the walker enters a variable definition // ref is the reference to the selection set on the AST EnterVariableDefinition(ref int) }
EnterVariableDefinitionVisitor is the callback when the walker enters a variable definition
type EnumTypeDefinitionVisitor ¶
type EnumTypeDefinitionVisitor interface { EnterEnumTypeDefinitionVisitor LeaveEnumTypeDefinitionVisitor }
EnumTypeDefinitionVisitor is the callback when the walker enters or leaves an enum type definition
type EnumTypeExtensionVisitor ¶
type EnumTypeExtensionVisitor interface { EnterEnumTypeExtensionVisitor LeaveEnumTypeExtensionVisitor }
EnumTypeExtensionVisitor is the callback when the walker enters or leaves an enum type extension
type EnumValueDefinitionVisitor ¶
type EnumValueDefinitionVisitor interface { EnterEnumValueDefinitionVisitor LeaveEnumValueDefinitionVisitor }
EnumValueDefinitionVisitor is the callback when the walker enters or leaves an enum value definition
type ExecutableVisitor ¶
type ExecutableVisitor interface { OperationDefinitionVisitor SelectionSetVisitor FieldVisitor ArgumentVisitor FragmentSpreadVisitor InlineFragmentVisitor FragmentDefinitionVisitor VariableDefinitionVisitor DirectiveVisitor }
ExecutableVisitor is the callback when the walker enters or leaves any of the executable definitions
type FieldDefinitionVisitor ¶
type FieldDefinitionVisitor interface { EnterFieldDefinitionVisitor LeaveFieldDefinitionVisitor }
FieldDefinitionVisitor is the callback when the walker enters or leaves a field definition
type FieldVisitor ¶
type FieldVisitor interface { EnterFieldVisitor LeaveFieldVisitor }
FieldVisitor is the callback when the walker enters or leaves a field
type FragmentDefinitionVisitor ¶
type FragmentDefinitionVisitor interface { EnterFragmentDefinitionVisitor LeaveFragmentDefinitionVisitor }
FragmentDefinitionVisitor is the callback when the walker enters or leaves a fragment definition
type FragmentSpreadVisitor ¶
type FragmentSpreadVisitor interface { EnterFragmentSpreadVisitor LeaveFragmentSpreadVisitor }
FragmentSpreadVisitor is the callback when the walker enters or leaves a fragment spread
type InlineFragmentVisitor ¶
type InlineFragmentVisitor interface { EnterInlineFragmentVisitor LeaveInlineFragmentVisitor }
InlineFragmentVisitor is the callback when the walker enters or leaves an inline fragment
type InputObjectTypeDefinitionVisitor ¶
type InputObjectTypeDefinitionVisitor interface { EnterInputObjectTypeDefinitionVisitor LeaveInputObjectTypeDefinitionVisitor }
InputObjectTypeDefinitionVisitor is the callback when the walker enters or leaves an input object type definition
type InputObjectTypeExtensionVisitor ¶
type InputObjectTypeExtensionVisitor interface { EnterInputObjectTypeExtensionVisitor LeaveInputObjectTypeExtensionVisitor }
InputObjectTypeExtensionVisitor is the callback when the walker enters or leaves an input object type extension
type InputValueDefinitionVisitor ¶
type InputValueDefinitionVisitor interface { EnterInputValueDefinitionVisitor LeaveInputValueDefinitionVisitor }
InputValueDefinitionVisitor is the callback when the walker enters or leaves an input value definition
type InterfaceTypeDefinitionVisitor ¶
type InterfaceTypeDefinitionVisitor interface { EnterInterfaceTypeDefinitionVisitor LeaveInterfaceTypeDefinitionVisitor }
InterfaceTypeDefinitionVisitor is the callback when the walker enters or leaves an interface type definition
type InterfaceTypeExtensionVisitor ¶
type InterfaceTypeExtensionVisitor interface { EnterInterfaceTypeExtensionVisitor LeaveInterfaceTypeExtensionVisitor }
InterfaceTypeExtensionVisitor is the callback when the walker enters or leaves an interface type extension
type LeaveArgumentVisitor ¶
type LeaveArgumentVisitor interface { // LeaveArgument gets called when the walker leaves an argument // ref is the reference to the selection set on the AST LeaveArgument(ref int) }
LeaveArgumentVisitor is the callback when the walker leaves an argument
type LeaveDirectiveDefinitionVisitor ¶
type LeaveDirectiveDefinitionVisitor interface { // LeaveDirectiveDefinition gets called when the walker leaves a directive definition // ref is the reference to the selection set on the AST LeaveDirectiveDefinition(ref int) }
LeaveDirectiveDefinitionVisitor is the callback when the walker leaves a directive definition
type LeaveDirectiveLocationVisitor ¶
type LeaveDirectiveLocationVisitor interface { // LeaveDirectiveLocation gets called when the walker leaves a directive location // ref is the reference to the selection set on the AST LeaveDirectiveLocation(location ast.DirectiveLocation) }
LeaveDirectiveLocationVisitor is the callback when the walker leaves a directive location
type LeaveDirectiveVisitor ¶
type LeaveDirectiveVisitor interface { // LeaveDirective gets called when the walker leaves a directive // ref is the reference to the selection set on the AST LeaveDirective(ref int) }
LeaveDirectiveVisitor is the callback when the walker leaves a directive
type LeaveDocumentVisitor ¶
type LeaveEnumTypeDefinitionVisitor ¶
type LeaveEnumTypeDefinitionVisitor interface { // LeaveEnumTypeDefinition gets called when the walker leaves an enum type definition // ref is the reference to the selection set on the AST LeaveEnumTypeDefinition(ref int) }
LeaveEnumTypeDefinitionVisitor is the callback when the walker leaves an enum type definition
type LeaveEnumTypeExtensionVisitor ¶
type LeaveEnumTypeExtensionVisitor interface { // LeaveEnumTypeExtension gets called when the walker leaves an enum type extension // ref is the reference to the selection set on the AST LeaveEnumTypeExtension(ref int) }
LeaveEnumTypeExtensionVisitor is the callback when the walker leaves an enum type extension
type LeaveEnumValueDefinitionVisitor ¶
type LeaveEnumValueDefinitionVisitor interface { // LeaveEnumValueDefinition gets called when the walker leaves an enum value definition // ref is the reference to the selection set on the AST LeaveEnumValueDefinition(ref int) }
LeaveEnumValueDefinitionVisitor is the callback when the walker leaves an enum value definition
type LeaveFieldDefinitionVisitor ¶
type LeaveFieldDefinitionVisitor interface { // LeaveFieldDefinition gets called when the walker leaves a field definition // ref is the reference to the selection set on the AST LeaveFieldDefinition(ref int) }
LeaveFieldDefinitionVisitor is the callback when the walker leaves a field definition
type LeaveFieldVisitor ¶
type LeaveFieldVisitor interface { // LeaveField gets called when the walker leaves a field // ref is the reference to the selection set on the AST LeaveField(ref int) }
LeaveFieldVisitor is the callback when the walker leaves a field
type LeaveFragmentDefinitionVisitor ¶
type LeaveFragmentDefinitionVisitor interface { // LeaveFragmentDefinition gets called when the walker leaves a fragment definition // ref is the reference to the selection set on the AST LeaveFragmentDefinition(ref int) }
LeaveFragmentDefinitionVisitor is the callback when the walker leaves a fragment definition
type LeaveFragmentSpreadVisitor ¶
type LeaveFragmentSpreadVisitor interface { // LeaveFragmentSpread gets called when the walker leaves a fragment spread // ref is the reference to the selection set on the AST LeaveFragmentSpread(ref int) }
LeaveFragmentSpreadVisitor is the callback when the walker leaves a fragment spread
type LeaveInlineFragmentVisitor ¶
type LeaveInlineFragmentVisitor interface { // LeaveInlineFragment gets called when the walker leaves an inline fragment // ref is the reference to the selection set on the AST LeaveInlineFragment(ref int) }
LeaveInlineFragmentVisitor is the callback when the walker leaves an inline fragment
type LeaveInputObjectTypeDefinitionVisitor ¶
type LeaveInputObjectTypeDefinitionVisitor interface { // LeaveInputObjectTypeDefinition gets called when the walker leaves an input object type definition // ref is the reference to the selection set on the AST LeaveInputObjectTypeDefinition(ref int) }
LeaveInputObjectTypeDefinitionVisitor is the callback when the walker leaves an input object type definition
type LeaveInputObjectTypeExtensionVisitor ¶
type LeaveInputObjectTypeExtensionVisitor interface { // LeaveInputObjectTypeExtension gets called when the walker leaves an input object type extension // ref is the reference to the selection set on the AST LeaveInputObjectTypeExtension(ref int) }
LeaveInputObjectTypeExtensionVisitor is the callback when the walker leaves an input object type extension
type LeaveInputValueDefinitionVisitor ¶
type LeaveInputValueDefinitionVisitor interface { // LeaveInputValueDefinition gets called when the walker leaves an input value definition // ref is the reference to the selection set on the AST LeaveInputValueDefinition(ref int) }
LeaveInputValueDefinitionVisitor is the callback when the walker leaves an input value definition
type LeaveInterfaceTypeDefinitionVisitor ¶
type LeaveInterfaceTypeDefinitionVisitor interface { // LeaveInterfaceTypeDefinition gets called when the walker leaves an interface type definition // ref is the reference to the selection set on the AST LeaveInterfaceTypeDefinition(ref int) }
LeaveInterfaceTypeDefinitionVisitor is the callback when the walker leaves an interface type definition
type LeaveInterfaceTypeExtensionVisitor ¶
type LeaveInterfaceTypeExtensionVisitor interface { // LeaveInterfaceTypeExtension gets called when the walker leaves an interface type extension // ref is the reference to the selection set on the AST LeaveInterfaceTypeExtension(ref int) }
LeaveInterfaceTypeExtensionVisitor is the callback when the walker leaves an interface type extension
type LeaveObjectTypeDefinitionVisitor ¶
type LeaveObjectTypeDefinitionVisitor interface { // LeaveObjectTypeDefinition gets called when the walker leaves an object type definition // ref is the reference to the selection set on the AST LeaveObjectTypeDefinition(ref int) }
LeaveObjectTypeDefinitionVisitor is the callback when the walker leaves an object type definition
type LeaveObjectTypeExtensionVisitor ¶
type LeaveObjectTypeExtensionVisitor interface { // LeaveObjectTypeExtension gets called when the walker leaves an object type extension // ref is the reference to the selection set on the AST LeaveObjectTypeExtension(ref int) }
LeaveObjectTypeExtensionVisitor is the callback when the walker leaves an object type extension
type LeaveOperationDefinitionVisitor ¶
type LeaveOperationDefinitionVisitor interface { // LeaveOperationDefinition gets called when the walker leaves an operation definition // ref is the reference to the operation definition on the AST LeaveOperationDefinition(ref int) }
LeaveOperationDefinitionVisitor is the callback when the walker leaves an operation definition
type LeaveRootOperationTypeDefinitionVisitor ¶
type LeaveRootOperationTypeDefinitionVisitor interface { // LeaveRootOperationTypeDefinition gets called when the walker leaves a root operation type definition // ref is the reference to the selection set on the AST LeaveRootOperationTypeDefinition(ref int) }
LeaveRootOperationTypeDefinitionVisitor is the callback when the walker leaves a root operation type definition
type LeaveScalarTypeDefinitionVisitor ¶
type LeaveScalarTypeDefinitionVisitor interface { // LeaveScalarTypeDefinition gets called when the walker leaves a scalar type definition // ref is the reference to the selection set on the AST LeaveScalarTypeDefinition(ref int) }
LeaveScalarTypeDefinitionVisitor is the callback when the walker leaves a scalar type definition
type LeaveScalarTypeExtensionVisitor ¶
type LeaveScalarTypeExtensionVisitor interface { // LeaveScalarTypeExtension gets called when the walker leaves a scalar type extension // ref is the reference to the selection set on the AST LeaveScalarTypeExtension(ref int) }
LeaveScalarTypeExtensionVisitor is the callback when the walker leaves a scalar type extension
type LeaveSchemaDefinitionVisitor ¶
type LeaveSchemaDefinitionVisitor interface { // LeaveSchemaDefinition gets called when the walker leaves a schema definition // ref is the reference to the selection set on the AST LeaveSchemaDefinition(ref int) }
LeaveSchemaDefinitionVisitor is the callback when the walker leaves a schema definition
type LeaveSchemaExtensionVisitor ¶
type LeaveSchemaExtensionVisitor interface { // LeaveSchemaExtension gets called when the walker leaves a schema extension // ref is the reference to the selection set on the AST LeaveSchemaExtension(ref int) }
LeaveSchemaExtensionVisitor is the callback when the walker leaves a schema extension
type LeaveSelectionSetVisitor ¶
type LeaveSelectionSetVisitor interface { // LeaveSelectionSet gets called when the walker leaves a selection set // ref is the reference to the selection set on the AST LeaveSelectionSet(ref int) }
LeaveSelectionSetVisitor is the callback when the walker leaves a selection set visitor
type LeaveUnionMemberTypeVisitor ¶
type LeaveUnionMemberTypeVisitor interface { // LeaveUnionMemberType gets called when the walker leaves a union member type // ref is the reference to the selection set on the AST LeaveUnionMemberType(ref int) }
LeaveUnionMemberTypeVisitor is the callback when the walker leaves a union member type
type LeaveUnionTypeDefinitionVisitor ¶
type LeaveUnionTypeDefinitionVisitor interface { // LeaveUnionTypeDefinition gets called when the walker leaves a union type definition // ref is the reference to the selection set on the AST LeaveUnionTypeDefinition(ref int) }
LeaveUnionTypeDefinitionVisitor is the callback when the walker leaves a union type definition
type LeaveUnionTypeExtensionVisitor ¶
type LeaveUnionTypeExtensionVisitor interface { // LeaveUnionTypeExtension gets called when the walker leaves a union type extension // ref is the reference to the selection set on the AST LeaveUnionTypeExtension(ref int) }
LeaveUnionTypeExtensionVisitor is the callback when the walker leaves a union type extension
type LeaveVariableDefinitionVisitor ¶
type LeaveVariableDefinitionVisitor interface { // LeaveVariableDefinition gets called when the walker leaves a variable definition // ref is the reference to the selection set on the AST LeaveVariableDefinition(ref int) }
LeaveVariableDefinitionVisitor is the callback when the walker leaves a variable definition
type ObjectTypeDefinitionVisitor ¶
type ObjectTypeDefinitionVisitor interface { EnterObjectTypeDefinitionVisitor LeaveObjectTypeDefinitionVisitor }
ObjectTypeDefinitionVisitor is the callback when the walker enters or leaves an object type definition
type ObjectTypeExtensionVisitor ¶
type ObjectTypeExtensionVisitor interface { EnterObjectTypeExtensionVisitor LeaveObjectTypeExtensionVisitor }
ObjectTypeExtensionVisitor is the callback when the walker enters or leaves an object type extension
type OperationDefinitionVisitor ¶
type OperationDefinitionVisitor interface { EnterOperationDefinitionVisitor LeaveOperationDefinitionVisitor }
OperationDefinitionVisitor is the callback when the walker enters or leaves an operation
type RootOperationTypeDefinitionVisitor ¶
type RootOperationTypeDefinitionVisitor interface { EnterRootOperationTypeDefinitionVisitor LeaveRootOperationTypeDefinitionVisitor }
RootOperationTypeDefinitionVisitor is the callback when the walker enters or leaves a root operation type definition
type ScalarTypeDefinitionVisitor ¶
type ScalarTypeDefinitionVisitor interface { EnterScalarTypeDefinitionVisitor LeaveScalarTypeDefinitionVisitor }
ScalarTypeDefinitionVisitor is the callback when the walker enters or leaves a scalar type definition
type ScalarTypeExtensionVisitor ¶
type ScalarTypeExtensionVisitor interface { EnterScalarTypeExtensionVisitor LeaveScalarTypeExtensionVisitor }
ScalarTypeExtensionVisitor is the callback when the walker enters or leaves a scalar type extension
type SchemaDefinitionVisitor ¶
type SchemaDefinitionVisitor interface { EnterSchemaDefinitionVisitor LeaveSchemaDefinitionVisitor }
SchemaDefinitionVisitor is the callback when the walker enters or leaves a schema definition
type SchemaExtensionVisitor ¶
type SchemaExtensionVisitor interface { EnterSchemaExtensionVisitor LeaveSchemaExtensionVisitor }
SchemaExtensionVisitor is the callback when the walker enters or leaves a schema extension
type SelectionSetVisitor ¶
type SelectionSetVisitor interface { EnterSelectionSetVisitor LeaveSelectionSetVisitor }
SelectionSetVisitor is the callback when the walker enters or leaves a selection set
type SimpleWalker ¶
type SimpleWalker struct { Depth int Ancestors []ast.Node SelectionsBefore []int SelectionsAfter []int // contains filtered or unexported fields }
func NewSimpleWalker ¶
func NewSimpleWalker(ancestorSize int) SimpleWalker
func (*SimpleWalker) SetVisitor ¶
func (w *SimpleWalker) SetVisitor(visitor AllNodesVisitor)
func (*SimpleWalker) WalkDocument ¶
func (w *SimpleWalker) WalkDocument(document *ast.Document) error
type SkipVisitors ¶
type SkipVisitors []int
func (SkipVisitors) Allow ¶
func (s SkipVisitors) Allow(planner interface{}) bool
type TypeSystemVisitor ¶
type TypeSystemVisitor interface { ObjectTypeDefinitionVisitor ObjectTypeExtensionVisitor FieldDefinitionVisitor InputValueDefinitionVisitor InterfaceTypeDefinitionVisitor InterfaceTypeExtensionVisitor ScalarTypeDefinitionVisitor ScalarTypeExtensionVisitor UnionTypeDefinitionVisitor UnionTypeExtensionVisitor UnionMemberTypeVisitor EnumTypeDefinitionVisitor EnumTypeExtensionVisitor EnumValueDefinitionVisitor InputObjectTypeDefinitionVisitor InputObjectTypeExtensionVisitor DirectiveDefinitionVisitor DirectiveLocationVisitor SchemaDefinitionVisitor SchemaExtensionVisitor RootOperationTypeDefinitionVisitor }
TypeSystemVisitor is the callback when the walker enters or leaves any of the type definitions
type UnionMemberTypeVisitor ¶
type UnionMemberTypeVisitor interface { EnterUnionMemberTypeVisitor LeaveUnionMemberTypeVisitor }
UnionMemberTypeVisitor is the callback when the walker enters or leaves a union member type
type UnionTypeDefinitionVisitor ¶
type UnionTypeDefinitionVisitor interface { EnterUnionTypeDefinitionVisitor LeaveUnionTypeDefinitionVisitor }
UnionTypeDefinitionVisitor is the callback when the walker enters or leaves a union type definition
type UnionTypeExtensionVisitor ¶
type UnionTypeExtensionVisitor interface { EnterUnionTypeExtensionVisitor LeaveUnionTypeExtensionVisitor }
UnionTypeExtensionVisitor is the callback when the walker enters or leaves a union type extension
type VariableDefinitionVisitor ¶
type VariableDefinitionVisitor interface { EnterVariableDefinitionVisitor LeaveVariableDefinitionVisitor }
VariableDefinitionVisitor is the callback when the walker enters or leaves a variable definition
type VisitorFilter ¶
type VisitorFilter interface {
AllowVisitor(kind VisitorKind, ref int, visitor interface{}, ancestorSkip SkipVisitors) bool
}
VisitorFilter can be defined to prevent specific visitors from getting invoked
type VisitorIdentifier ¶
type VisitorKind ¶
type VisitorKind int
const ( EnterOperation VisitorKind = iota + 1 LeaveOperation EnterSelectionSet LeaveSelectionSet EnterField LeaveField EnterArgument LeaveArgument EnterFragmentSpread LeaveFragmentSpread EnterInlineFragment LeaveInlineFragment EnterFragmentDefinition LeaveFragmentDefinition EnterDocument LeaveDocument EnterVariableDefinition LeaveVariableDefinition EnterDirective LeaveDirective EnterObjectTypeDefinition LeaveObjectTypeDefinition EnterFieldDefinition LeaveFieldDefinition EnterInputValueDefinition LeaveInputValueDefinition EnterInterfaceTypeDefinition LeaveInterfaceTypeDefinition EnterInterfaceTypeExtension LeaveInterfaceTypeExtension EnterObjectTypeExtension LeaveObjectTypeExtension EnterScalarTypeDefinition LeaveScalarTypeDefinition EnterScalarTypeExtension LeaveScalarTypeExtension EnterUnionTypeDefinition LeaveUnionTypeDefinition EnterUnionTypeExtension LeaveUnionTypeExtension EnterUnionMemberType LeaveUnionMemberType EnterEnumTypeDefinition LeaveEnumTypeDefinition EnterEnumTypeExtension LeaveEnumTypeExtension EnterEnumValueDefinition LeaveEnumValueDefinition EnterInputObjectTypeDefinition LeaveInputObjectTypeDefinition EnterInputObjectTypeExtension LeaveInputObjectTypeExtension EnterDirectiveDefinition LeaveDirectiveDefinition EnterDirectiveLocation LeaveDirectiveLocation EnterSchemaDefinition LeaveSchemaDefinition EnterSchemaExtension LeaveSchemaExtension EnterRootOperationTypeDefinition LeaveRootOperationTypeDefinition )
type Walker ¶
type Walker struct { // Ancestors is the slice of Nodes to the current Node in a callback // don't keep a reference to this slice, always copy it if you want to work with it after the callback returned Ancestors []ast.Node // Path is the slice of PathItems leading to the current Node // don't keep a reference to this slice, always copy it if you want to work with it after the callback returned Path ast.Path // EnclosingTypeDefinition is the TypeDefinition Node of the parent object of the current callback // e.g. if the current callback is a Field the EnclosingTypeDefinition will be the TypeDefinition of the parent object of such Field EnclosingTypeDefinition ast.Node // SelectionsBefore is the slice of references to selections before the current selection // This is only valid when inside a SelectionSet SelectionsBefore []int // SelectionsAfter is the slice of references to selections before the current selection // This is only valid when inside a SelectionSet SelectionsAfter []int // Report is the object to collect errors when walking the AST Report *operationreport.Report CurrentRef int CurrentKind ast.NodeKind Depth int TypeDefinitions []ast.Node // contains filtered or unexported fields }
Walker orchestrates the process of walking an AST and calling all registered callbacks Always use NewWalker to instantiate a new Walker
func WalkerFromPool ¶
func WalkerFromPool() *Walker
func (*Walker) AncestorNameBytes ¶
func (*Walker) ArgumentInputValueDefinition ¶
func (*Walker) DefferOnEnterField ¶
func (w *Walker) DefferOnEnterField(fn func())
DefferOnEnterField runs the provided func() after the current batch of visitors This gives you the possibility to execute some code that should e.g. run after all EnterField Visitors
func (*Walker) FieldDefinition ¶
FieldDefinition - returns field definition ref from schema definition field - ref to a field from operation returns: definition - ref to a field definition from schema definition document if it is exists otherwise returns ast.InvalidRef exists - true if field exists
func (*Walker) FieldDefinitionDirectiveArgumentValueByName ¶
func (*Walker) FieldDefinitionWithExists ¶
FieldDefinitionWithExists Deprecated: use FieldDefinition
func (*Walker) HandleInternalErr ¶
func (*Walker) RegisterAllNodesVisitor ¶
func (w *Walker) RegisterAllNodesVisitor(visitor AllNodesVisitor)
func (*Walker) RegisterArgumentVisitor ¶
func (w *Walker) RegisterArgumentVisitor(visitor ArgumentVisitor)
func (*Walker) RegisterDirectiveDefinitionVisitor ¶
func (w *Walker) RegisterDirectiveDefinitionVisitor(visitor DirectiveDefinitionVisitor)
func (*Walker) RegisterDirectiveLocationVisitor ¶
func (w *Walker) RegisterDirectiveLocationVisitor(visitor DirectiveLocationVisitor)
func (*Walker) RegisterDirectiveVisitor ¶
func (w *Walker) RegisterDirectiveVisitor(visitor DirectiveVisitor)
func (*Walker) RegisterDocumentVisitor ¶
func (w *Walker) RegisterDocumentVisitor(visitor DocumentVisitor)
func (*Walker) RegisterEnterArgumentVisitor ¶
func (w *Walker) RegisterEnterArgumentVisitor(visitor EnterArgumentVisitor)
func (*Walker) RegisterEnterDirectiveDefinitionVisitor ¶
func (w *Walker) RegisterEnterDirectiveDefinitionVisitor(visitor EnterDirectiveDefinitionVisitor)
func (*Walker) RegisterEnterDirectiveLocationVisitor ¶
func (w *Walker) RegisterEnterDirectiveLocationVisitor(visitor EnterDirectiveLocationVisitor)
func (*Walker) RegisterEnterDirectiveVisitor ¶
func (w *Walker) RegisterEnterDirectiveVisitor(visitor EnterDirectiveVisitor)
func (*Walker) RegisterEnterDocumentVisitor ¶
func (w *Walker) RegisterEnterDocumentVisitor(visitor EnterDocumentVisitor)
func (*Walker) RegisterEnterEnumTypeDefinitionVisitor ¶
func (w *Walker) RegisterEnterEnumTypeDefinitionVisitor(visitor EnterEnumTypeDefinitionVisitor)
func (*Walker) RegisterEnterEnumTypeExtensionVisitor ¶
func (w *Walker) RegisterEnterEnumTypeExtensionVisitor(visitor EnterEnumTypeExtensionVisitor)
func (*Walker) RegisterEnterEnumValueDefinitionVisitor ¶
func (w *Walker) RegisterEnterEnumValueDefinitionVisitor(visitor EnterEnumValueDefinitionVisitor)
func (*Walker) RegisterEnterFieldDefinitionVisitor ¶
func (w *Walker) RegisterEnterFieldDefinitionVisitor(visitor EnterFieldDefinitionVisitor)
func (*Walker) RegisterEnterFieldVisitor ¶
func (w *Walker) RegisterEnterFieldVisitor(visitor EnterFieldVisitor)
func (*Walker) RegisterEnterFragmentDefinitionVisitor ¶
func (w *Walker) RegisterEnterFragmentDefinitionVisitor(visitor EnterFragmentDefinitionVisitor)
func (*Walker) RegisterEnterFragmentSpreadVisitor ¶
func (w *Walker) RegisterEnterFragmentSpreadVisitor(visitor EnterFragmentSpreadVisitor)
func (*Walker) RegisterEnterInlineFragmentVisitor ¶
func (w *Walker) RegisterEnterInlineFragmentVisitor(visitor EnterInlineFragmentVisitor)
func (*Walker) RegisterEnterInputObjectTypeDefinitionVisitor ¶
func (w *Walker) RegisterEnterInputObjectTypeDefinitionVisitor(visitor EnterInputObjectTypeDefinitionVisitor)
func (*Walker) RegisterEnterInputObjectTypeExtensionVisitor ¶
func (w *Walker) RegisterEnterInputObjectTypeExtensionVisitor(visitor EnterInputObjectTypeExtensionVisitor)
func (*Walker) RegisterEnterInputValueDefinitionVisitor ¶
func (w *Walker) RegisterEnterInputValueDefinitionVisitor(visitor EnterInputValueDefinitionVisitor)
func (*Walker) RegisterEnterInterfaceTypeDefinitionVisitor ¶
func (w *Walker) RegisterEnterInterfaceTypeDefinitionVisitor(visitor EnterInterfaceTypeDefinitionVisitor)
func (*Walker) RegisterEnterInterfaceTypeExtensionVisitor ¶
func (w *Walker) RegisterEnterInterfaceTypeExtensionVisitor(visitor EnterInterfaceTypeExtensionVisitor)
func (*Walker) RegisterEnterObjectTypeDefinitionVisitor ¶
func (w *Walker) RegisterEnterObjectTypeDefinitionVisitor(visitor EnterObjectTypeDefinitionVisitor)
func (*Walker) RegisterEnterObjectTypeExtensionVisitor ¶
func (w *Walker) RegisterEnterObjectTypeExtensionVisitor(visitor EnterObjectTypeExtensionVisitor)
func (*Walker) RegisterEnterOperationVisitor ¶
func (w *Walker) RegisterEnterOperationVisitor(visitor EnterOperationDefinitionVisitor)
func (*Walker) RegisterEnterRootOperationTypeDefinitionVisitor ¶
func (w *Walker) RegisterEnterRootOperationTypeDefinitionVisitor(visitor EnterRootOperationTypeDefinitionVisitor)
func (*Walker) RegisterEnterScalarTypeDefinitionVisitor ¶
func (w *Walker) RegisterEnterScalarTypeDefinitionVisitor(visitor EnterScalarTypeDefinitionVisitor)
func (*Walker) RegisterEnterScalarTypeExtensionVisitor ¶
func (w *Walker) RegisterEnterScalarTypeExtensionVisitor(visitor EnterScalarTypeExtensionVisitor)
func (*Walker) RegisterEnterSchemaDefinitionVisitor ¶
func (w *Walker) RegisterEnterSchemaDefinitionVisitor(visitor EnterSchemaDefinitionVisitor)
func (*Walker) RegisterEnterSchemaExtensionVisitor ¶
func (w *Walker) RegisterEnterSchemaExtensionVisitor(visitor EnterSchemaExtensionVisitor)
func (*Walker) RegisterEnterSelectionSetVisitor ¶
func (w *Walker) RegisterEnterSelectionSetVisitor(visitor EnterSelectionSetVisitor)
func (*Walker) RegisterEnterUnionMemberTypeVisitor ¶
func (w *Walker) RegisterEnterUnionMemberTypeVisitor(visitor EnterUnionMemberTypeVisitor)
func (*Walker) RegisterEnterUnionTypeDefinitionVisitor ¶
func (w *Walker) RegisterEnterUnionTypeDefinitionVisitor(visitor EnterUnionTypeDefinitionVisitor)
func (*Walker) RegisterEnterUnionTypeExtensionVisitor ¶
func (w *Walker) RegisterEnterUnionTypeExtensionVisitor(visitor EnterUnionTypeExtensionVisitor)
func (*Walker) RegisterEnterVariableDefinitionVisitor ¶
func (w *Walker) RegisterEnterVariableDefinitionVisitor(visitor EnterVariableDefinitionVisitor)
func (*Walker) RegisterEnumTypeDefinitionVisitor ¶
func (w *Walker) RegisterEnumTypeDefinitionVisitor(visitor EnumTypeDefinitionVisitor)
func (*Walker) RegisterEnumTypeExtensionVisitor ¶
func (w *Walker) RegisterEnumTypeExtensionVisitor(visitor EnumTypeExtensionVisitor)
func (*Walker) RegisterEnumValueDefinitionVisitor ¶
func (w *Walker) RegisterEnumValueDefinitionVisitor(visitor EnumValueDefinitionVisitor)
func (*Walker) RegisterExecutableVisitor ¶
func (w *Walker) RegisterExecutableVisitor(visitor ExecutableVisitor)
func (*Walker) RegisterFieldDefinitionVisitor ¶
func (w *Walker) RegisterFieldDefinitionVisitor(visitor FieldDefinitionVisitor)
func (*Walker) RegisterFieldVisitor ¶
func (w *Walker) RegisterFieldVisitor(visitor FieldVisitor)
func (*Walker) RegisterFragmentDefinitionVisitor ¶
func (w *Walker) RegisterFragmentDefinitionVisitor(visitor FragmentDefinitionVisitor)
func (*Walker) RegisterFragmentSpreadVisitor ¶
func (w *Walker) RegisterFragmentSpreadVisitor(visitor FragmentSpreadVisitor)
func (*Walker) RegisterInlineFragmentVisitor ¶
func (w *Walker) RegisterInlineFragmentVisitor(visitor InlineFragmentVisitor)
func (*Walker) RegisterInputObjectTypeDefinitionVisitor ¶
func (w *Walker) RegisterInputObjectTypeDefinitionVisitor(visitor InputObjectTypeDefinitionVisitor)
func (*Walker) RegisterInputObjectTypeExtensionVisitor ¶
func (w *Walker) RegisterInputObjectTypeExtensionVisitor(visitor InputObjectTypeExtensionVisitor)
func (*Walker) RegisterInputValueDefinitionVisitor ¶
func (w *Walker) RegisterInputValueDefinitionVisitor(visitor InputValueDefinitionVisitor)
func (*Walker) RegisterInterfaceTypeDefinitionVisitor ¶
func (w *Walker) RegisterInterfaceTypeDefinitionVisitor(visitor InterfaceTypeDefinitionVisitor)
func (*Walker) RegisterInterfaceTypeExtensionVisitor ¶
func (w *Walker) RegisterInterfaceTypeExtensionVisitor(visitor InterfaceTypeExtensionVisitor)
func (*Walker) RegisterLeaveArgumentVisitor ¶
func (w *Walker) RegisterLeaveArgumentVisitor(visitor LeaveArgumentVisitor)
func (*Walker) RegisterLeaveDirectiveDefinitionVisitor ¶
func (w *Walker) RegisterLeaveDirectiveDefinitionVisitor(visitor LeaveDirectiveDefinitionVisitor)
func (*Walker) RegisterLeaveDirectiveLocationVisitor ¶
func (w *Walker) RegisterLeaveDirectiveLocationVisitor(visitor LeaveDirectiveLocationVisitor)
func (*Walker) RegisterLeaveDirectiveVisitor ¶
func (w *Walker) RegisterLeaveDirectiveVisitor(visitor LeaveDirectiveVisitor)
func (*Walker) RegisterLeaveDocumentVisitor ¶
func (w *Walker) RegisterLeaveDocumentVisitor(visitor LeaveDocumentVisitor)
func (*Walker) RegisterLeaveEnumTypeDefinitionVisitor ¶
func (w *Walker) RegisterLeaveEnumTypeDefinitionVisitor(visitor LeaveEnumTypeDefinitionVisitor)
func (*Walker) RegisterLeaveEnumTypeExtensionVisitor ¶
func (w *Walker) RegisterLeaveEnumTypeExtensionVisitor(visitor LeaveEnumTypeExtensionVisitor)
func (*Walker) RegisterLeaveEnumValueDefinitionVisitor ¶
func (w *Walker) RegisterLeaveEnumValueDefinitionVisitor(visitor LeaveEnumValueDefinitionVisitor)
func (*Walker) RegisterLeaveFieldDefinitionVisitor ¶
func (w *Walker) RegisterLeaveFieldDefinitionVisitor(visitor LeaveFieldDefinitionVisitor)
func (*Walker) RegisterLeaveFieldVisitor ¶
func (w *Walker) RegisterLeaveFieldVisitor(visitor LeaveFieldVisitor)
func (*Walker) RegisterLeaveFragmentDefinitionVisitor ¶
func (w *Walker) RegisterLeaveFragmentDefinitionVisitor(visitor LeaveFragmentDefinitionVisitor)
func (*Walker) RegisterLeaveFragmentSpreadVisitor ¶
func (w *Walker) RegisterLeaveFragmentSpreadVisitor(visitor LeaveFragmentSpreadVisitor)
func (*Walker) RegisterLeaveInlineFragmentVisitor ¶
func (w *Walker) RegisterLeaveInlineFragmentVisitor(visitor LeaveInlineFragmentVisitor)
func (*Walker) RegisterLeaveInputObjectTypeDefinitionVisitor ¶
func (w *Walker) RegisterLeaveInputObjectTypeDefinitionVisitor(visitor LeaveInputObjectTypeDefinitionVisitor)
func (*Walker) RegisterLeaveInputObjectTypeExtensionVisitor ¶
func (w *Walker) RegisterLeaveInputObjectTypeExtensionVisitor(visitor LeaveInputObjectTypeExtensionVisitor)
func (*Walker) RegisterLeaveInputValueDefinitionVisitor ¶
func (w *Walker) RegisterLeaveInputValueDefinitionVisitor(visitor LeaveInputValueDefinitionVisitor)
func (*Walker) RegisterLeaveInterfaceTypeDefinitionVisitor ¶
func (w *Walker) RegisterLeaveInterfaceTypeDefinitionVisitor(visitor LeaveInterfaceTypeDefinitionVisitor)
func (*Walker) RegisterLeaveInterfaceTypeExtensionVisitor ¶
func (w *Walker) RegisterLeaveInterfaceTypeExtensionVisitor(visitor LeaveInterfaceTypeExtensionVisitor)
func (*Walker) RegisterLeaveObjectTypeDefinitionVisitor ¶
func (w *Walker) RegisterLeaveObjectTypeDefinitionVisitor(visitor LeaveObjectTypeDefinitionVisitor)
func (*Walker) RegisterLeaveObjectTypeExtensionVisitor ¶
func (w *Walker) RegisterLeaveObjectTypeExtensionVisitor(visitor LeaveObjectTypeExtensionVisitor)
func (*Walker) RegisterLeaveOperationVisitor ¶
func (w *Walker) RegisterLeaveOperationVisitor(visitor LeaveOperationDefinitionVisitor)
func (*Walker) RegisterLeaveRootOperationTypeDefinitionVisitor ¶
func (w *Walker) RegisterLeaveRootOperationTypeDefinitionVisitor(visitor LeaveRootOperationTypeDefinitionVisitor)
func (*Walker) RegisterLeaveScalarTypeDefinitionVisitor ¶
func (w *Walker) RegisterLeaveScalarTypeDefinitionVisitor(visitor LeaveScalarTypeDefinitionVisitor)
func (*Walker) RegisterLeaveScalarTypeExtensionVisitor ¶
func (w *Walker) RegisterLeaveScalarTypeExtensionVisitor(visitor LeaveScalarTypeExtensionVisitor)
func (*Walker) RegisterLeaveSchemaDefinitionVisitor ¶
func (w *Walker) RegisterLeaveSchemaDefinitionVisitor(visitor LeaveSchemaDefinitionVisitor)
func (*Walker) RegisterLeaveSchemaExtensionVisitor ¶
func (w *Walker) RegisterLeaveSchemaExtensionVisitor(visitor LeaveSchemaExtensionVisitor)
func (*Walker) RegisterLeaveSelectionSetVisitor ¶
func (w *Walker) RegisterLeaveSelectionSetVisitor(visitor LeaveSelectionSetVisitor)
func (*Walker) RegisterLeaveUnionMemberTypeVisitor ¶
func (w *Walker) RegisterLeaveUnionMemberTypeVisitor(visitor LeaveUnionMemberTypeVisitor)
func (*Walker) RegisterLeaveUnionTypeDefinitionVisitor ¶
func (w *Walker) RegisterLeaveUnionTypeDefinitionVisitor(visitor LeaveUnionTypeDefinitionVisitor)
func (*Walker) RegisterLeaveUnionTypeExtensionVisitor ¶
func (w *Walker) RegisterLeaveUnionTypeExtensionVisitor(visitor LeaveUnionTypeExtensionVisitor)
func (*Walker) RegisterLeaveVariableDefinitionVisitor ¶
func (w *Walker) RegisterLeaveVariableDefinitionVisitor(visitor LeaveVariableDefinitionVisitor)
func (*Walker) RegisterObjectTypeDefinitionVisitor ¶
func (w *Walker) RegisterObjectTypeDefinitionVisitor(visitor ObjectTypeDefinitionVisitor)
func (*Walker) RegisterObjectTypeExtensionVisitor ¶
func (w *Walker) RegisterObjectTypeExtensionVisitor(visitor ObjectTypeExtensionVisitor)
func (*Walker) RegisterOperationDefinitionVisitor ¶
func (w *Walker) RegisterOperationDefinitionVisitor(visitor OperationDefinitionVisitor)
func (*Walker) RegisterRootOperationTypeDefinitionVisitor ¶
func (w *Walker) RegisterRootOperationTypeDefinitionVisitor(visitor RootOperationTypeDefinitionVisitor)
func (*Walker) RegisterScalarTypeDefinitionVisitor ¶
func (w *Walker) RegisterScalarTypeDefinitionVisitor(visitor ScalarTypeDefinitionVisitor)
func (*Walker) RegisterScalarTypeExtensionVisitor ¶
func (w *Walker) RegisterScalarTypeExtensionVisitor(visitor ScalarTypeExtensionVisitor)
func (*Walker) RegisterSchemaDefinitionVisitor ¶
func (w *Walker) RegisterSchemaDefinitionVisitor(visitor SchemaDefinitionVisitor)
func (*Walker) RegisterSchemaExtensionVisitor ¶
func (w *Walker) RegisterSchemaExtensionVisitor(visitor SchemaExtensionVisitor)
func (*Walker) RegisterSelectionSetVisitor ¶
func (w *Walker) RegisterSelectionSetVisitor(visitor SelectionSetVisitor)
func (*Walker) RegisterTypeSystemVisitor ¶
func (w *Walker) RegisterTypeSystemVisitor(visitor TypeSystemVisitor)
func (*Walker) RegisterUnionMemberTypeVisitor ¶
func (w *Walker) RegisterUnionMemberTypeVisitor(visitor UnionMemberTypeVisitor)
func (*Walker) RegisterUnionTypeDefinitionVisitor ¶
func (w *Walker) RegisterUnionTypeDefinitionVisitor(visitor UnionTypeDefinitionVisitor)
func (*Walker) RegisterUnionTypeExtensionVisitor ¶
func (w *Walker) RegisterUnionTypeExtensionVisitor(visitor UnionTypeExtensionVisitor)
func (*Walker) RegisterVariableDefinitionVisitor ¶
func (w *Walker) RegisterVariableDefinitionVisitor(visitor VariableDefinitionVisitor)
func (*Walker) ResetVisitors ¶
func (w *Walker) ResetVisitors()
ResetVisitors empties all registered visitors / unregisters all callbacks
func (*Walker) RevisitNode ¶
func (w *Walker) RevisitNode()
func (*Walker) SetVisitorFilter ¶
func (w *Walker) SetVisitorFilter(filter VisitorFilter)
func (*Walker) StopWithErr ¶
func (w *Walker) StopWithErr(internal error, external operationreport.ExternalError)
func (*Walker) StopWithExternalErr ¶
func (w *Walker) StopWithExternalErr(err operationreport.ExternalError)