Documentation ¶
Index ¶
Constants ¶
View Source
const ( ActionNoChange = "" ActionBreak = "BREAK" ActionSkip = "SKIP" ActionUpdate = "UPDATE" )
Variables ¶
View Source
var QueryDocumentKeys = KeyMap{ "Name": []string{}, "Document": []string{"Definitions"}, "OperationDefinition": []string{ "Name", "VariableDefinitions", "Directives", "SelectionSet", }, "VariableDefinition": []string{ "Variable", "Type", "DefaultValue", }, "Variable": []string{"Name"}, "SelectionSet": []string{"Selections"}, "Field": []string{ "Alias", "Name", "Arguments", "Directives", "SelectionSet", }, "Argument": []string{ "Name", "Value", }, "FragmentSpread": []string{ "Name", "Directives", }, "InlineFragment": []string{ "TypeCondition", "Directives", "SelectionSet", }, "FragmentDefinition": []string{ "Name", "TypeCondition", "Directives", "SelectionSet", }, "IntValue": []string{}, "FloatValue": []string{}, "StringValue": []string{}, "BooleanValue": []string{}, "EnumValue": []string{}, "ListValue": []string{"Values"}, "ObjectValue": []string{"Fields"}, "ObjectField": []string{ "Name", "Value", }, "Directive": []string{ "Name", "Arguments", }, "Named": []string{"Name"}, "List": []string{"Type"}, "NonNull": []string{"Type"}, "ObjectDefinition": []string{ "Name", "Interfaces", "Fields", }, "FieldDefinition": []string{ "Name", "Arguments", "Type", }, "InputValueDefinition": []string{ "Name", "Type", "DefaultValue", }, "InterfaceDefinition": []string{ "Name", "Fields", }, "UnionDefinition": []string{ "Name", "Types", }, "ScalarDefinition": []string{"Name"}, "EnumDefinition": []string{ "Name", "Values", }, "EnumValueDefinition": []string{"Name"}, "InputObjectDefinition": []string{ "Name", "Fields", }, "TypeExtensionDefinition": []string{"Definition"}, }
note that the keys are in Capital letters, equivalent to the ast.Node field Names
Functions ¶
Types ¶
type NamedVisitFuncs ¶
type VisitFunc ¶
type VisitFunc func(p VisitFuncParams) (string, interface{})
func GetVisitFn ¶
func GetVisitFn(visitorOpts *VisitorOptions, kind string, isLeaving bool) VisitFunc
GetVisitFn Given a visitor instance, if it is leaving or not, and a node kind, return the function the visitor runtime should call.
type VisitFuncParams ¶
type VisitorOptions ¶
type VisitorOptions struct { KindFuncMap map[string]NamedVisitFuncs Enter VisitFunc // 3) Generic visitors that trigger upon entering and leaving any node. Leave VisitFunc // 3) Generic visitors that trigger upon entering and leaving any node. EnterKindMap map[string]VisitFunc // 4) Parallel visitors for entering and leaving nodes of a specific kind LeaveKindMap map[string]VisitFunc // 4) Parallel visitors for entering and leaving nodes of a specific kind }
func VisitInParallel ¶
func VisitInParallel(visitorOptsSlice ...*VisitorOptions) *VisitorOptions
VisitInParallel Creates a new visitor instance which delegates to many visitors to run in parallel. Each visitor will be visited for each node before moving on.
If a prior visitor edits a node, no following visitors will see that node.
func VisitWithTypeInfo ¶
func VisitWithTypeInfo(ttypeInfo typeInfo.TypeInfoI, visitorOpts *VisitorOptions) *VisitorOptions
VisitWithTypeInfo Creates a new visitor instance which maintains a provided TypeInfo instance along with visiting visitor.
Click to show internal directories.
Click to hide internal directories.