class GraphQL::Language::OperationDefinition
- GraphQL::Language::OperationDefinition
- GraphQL::Language::AbstractNode
- GraphQL::Language::ASTNode
- Reference
- Object
Overview
A query, mutation or subscription.
May be anonymous or named.
May be explicitly typed (eg mutation { ... }
) or implicitly a query (eg { ... }
).
Defined in:
graphql-crystal/language/nodes.crConstant Summary
-
GRAPHQL_FIELDS =
[{:__typename, "", args, ""}] of Tuple(Symbol, String, Hash(String, String) | ::Nil, String)
-
VALUES =
[{operation_type, String}, {name, ::Union(String, ::Nil)}, {variables, Array(VariableDefinition)}, {directives, Array(Directive)}, {selections, Array(Selection)}] of Tuple(Symbol, Object.class)
-
A query, mutation or subscription. May be anonymous or named. May be explicitly typed (eg
mutation { ... }
) or implicitly a query (eg{ ... }
). -
VISITS =
[{:children, [:variables, :directives, :selections]}] of Tuple(Symbol, Array(Symbol))
-
A query, mutation or subscription. May be anonymous or named. May be explicitly typed (eg
mutation { ... }
) or implicitly a query (eg{ ... }
).
Constructors
Class Method Summary
Instance Method Summary
- #==(other : GraphQL::Language::OperationDefinition)
-
#clone
Returns a copy of
self
with all instance variables cloned. - #directives : Array(Directive)
- #directives=(directives : Array(Directive))
- #map_children(&block : ASTNode -> UNDERSCORE)
- #name : ::Union(String, Nil)
- #name=(name : ::Union(String, Nil))
- #operation_type : String
- #operation_type=(operation_type : String)
-
#resolve_field(name : String, arguments, context : GraphQL::Schema::Context)
resolve a named field on this object with query arguments and context
- #selections : Array(Selection)
- #selections=(selections : Array(Selection))
- #values
- #variables : Array(VariableDefinition)
- #variables=(variables : Array(VariableDefinition))
-
#visit(name, visited_ids = [] of UInt64, block = Proc(ASTNode, ASTNode | ::Nil).new do
end)
Recursively apply the given block to each node that gets visited with the given key which nodes get traverses for a given key can be set on a class via the:
traverse :name, :child_1, :child2
macro.
Macro Summary
- accessors(name, type, default)
- field(name, &block)
- field(name, description, args, typename, &block)
- inject
- injection
- traverse(name, *values)
- values(args)
Instance methods inherited from class GraphQL::Language::AbstractNode
==(other : GraphQL::Language::AbstractNode)
==,
clone
clone,
resolve_field(name : String, arguments, context : GraphQL::Schema::Context)
resolve_field,
values
values,
visit(name, visited_ids = [] of UInt64, block = Proc(ASTNode, ASTNode | ::Nil).new do
end)
visit
Constructor methods inherited from class GraphQL::Language::AbstractNode
new(**rest)
new
Class methods inherited from class GraphQL::Language::AbstractNode
values
values
Instance methods inherited from module GraphQL::ObjectType
graphql_type
graphql_type,
resolve_field(name, arguments, context)
resolve_field
Instance methods inherited from class GraphQL::Language::ASTNode
==(other)
==,
clone
clone,
values
values
Class methods inherited from class GraphQL::Language::ASTNode
values
values
Instance methods inherited from class Object
debug
debug
Constructor Detail
Class Method Detail
Instance Method Detail
resolve a named field on this object with query arguments and context
Recursively apply the given block to each
node that gets visited with the given key
which nodes get traverses for a given key
can be set on a class via the:
traverse :name, :child_1, :child2
macro. If no children are defined for a
given traversal path name the block is invoked
only with self.