Class: GraphQL::DSL::ExecutableDocument
- Defined in:
- lib/graphql/dsl/nodes/executable_document.rb
Overview
Executable document GraphQL node
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#fragment(name, type, directives = [], &block) ⇒ void
Create GraphQL fragment operation.
-
#initialize(&block) ⇒ ExecutableDocument
constructor
Create executable document.
-
#mutation(name = nil, variable_definitions = {}, directives = [], &block) ⇒ void
Create GraphQL mutation operation.
-
#query(name = nil, variable_definitions = {}, directives = [], &block) ⇒ void
Create GraphQL query operation.
-
#subscription(name = nil, variable_definitions = {}, directives = [], &block) ⇒ void
Create GraphQL subscription operation.
Methods inherited from Node
Constructor Details
#initialize(&block) ⇒ ExecutableDocument
Create executable document
12 13 14 |
# File 'lib/graphql/dsl/nodes/executable_document.rb', line 12 def initialize(&block) super(nil, &block) end |
Instance Method Details
#fragment(name, type, directives = [], &block) ⇒ void
This method returns an undefined value.
Create GraphQL fragment operation
64 65 66 |
# File 'lib/graphql/dsl/nodes/executable_document.rb', line 64 def fragment(name, type, directives = [], &block) @__nodes << FragmentOperation.new(name, type, directives, &block) end |
#mutation(name = nil, variable_definitions = {}, directives = [], &block) ⇒ void
This method returns an undefined value.
Create GraphQL mutation operation
38 39 40 |
# File 'lib/graphql/dsl/nodes/executable_document.rb', line 38 def mutation(name = nil, variable_definitions = {}, directives = [], &block) @__nodes << Operation.new(:mutation, name, variable_definitions, directives, &block) end |
#query(name = nil, variable_definitions = {}, directives = [], &block) ⇒ void
This method returns an undefined value.
Create GraphQL query operation
25 26 27 |
# File 'lib/graphql/dsl/nodes/executable_document.rb', line 25 def query(name = nil, variable_definitions = {}, directives = [], &block) @__nodes << Operation.new(:query, name, variable_definitions, directives, &block) end |
#subscription(name = nil, variable_definitions = {}, directives = [], &block) ⇒ void
This method returns an undefined value.
Create GraphQL subscription operation
51 52 53 |
# File 'lib/graphql/dsl/nodes/executable_document.rb', line 51 def subscription(name = nil, variable_definitions = {}, directives = [], &block) @__nodes << Operation.new(:subscription, name, variable_definitions, directives, &block) end |