Module: GraphQL::DSL
- Defined in:
- lib/graphql_dsl.rb,
lib/graphql/dsl.rb,
lib/graphql/dsl/error.rb,
lib/graphql/dsl/version.rb,
lib/graphql/dsl/constants.rb,
lib/graphql/dsl/nodes/node.rb,
lib/graphql/dsl/nodes/field.rb,
lib/graphql/dsl/formatter/field.rb,
lib/graphql/dsl/nodes/operation.rb,
lib/graphql/dsl/formatter/values.rb,
lib/graphql/dsl/formatter/arguments.rb,
lib/graphql/dsl/formatter/formatter.rb,
lib/graphql/dsl/formatter/operation.rb,
lib/graphql/dsl/formatter/directives.rb,
lib/graphql/dsl/nodes/fragment_spread.rb,
lib/graphql/dsl/nodes/inline_fragment.rb,
lib/graphql/dsl/nodes/fragment_operation.rb,
lib/graphql/dsl/formatter/fragment_spread.rb,
lib/graphql/dsl/formatter/inline_fragment.rb,
lib/graphql/dsl/nodes/executable_document.rb,
lib/graphql/dsl/nodes/containers/directive.rb,
lib/graphql/dsl/nodes/mixins/selection_set.rb,
lib/graphql/dsl/formatter/fragment_operation.rb,
lib/graphql/dsl/formatter/executable_document.rb,
lib/graphql/dsl/formatter/variable_definitions.rb,
lib/graphql/dsl/nodes/containers/variable_definition.rb
Overview
GraphQL DSL entry-point
Defined Under Namespace
Modules: SelectionSet Classes: Directive, Error, ExecutableDocument, Field, Formatter, FragmentOperation, FragmentSpread, InlineFragment, Node, Operation, VariableDefinition
Constant Summary collapse
- VERSION =
Gem version
'1.0.0'
- UNDEFINED =
Help to mark default parameter as undefined
Object.new
Refinement Method Summary collapse
-
.directive(name, **arguments) ⇒ Object
Create GraphQL directive.
-
.variable(type, default = UNDEFINED, *directives) ⇒ Object
Create GraphQL variable.
Class Method Summary collapse
-
.executable_document(&block) ⇒ ExecutableDocument
Create executable GraphQL document.
-
.fragment(name, type, directives = [], &block) ⇒ FragmentOperation
Create GraphQL fragment operation.
-
.mutation(name = nil, variable_definitions = {}, directives = [], &block) ⇒ Operation
Create GraphQL mutation operation.
-
.query(name = nil, variable_definitions = {}, directives = [], &block) ⇒ Operation
Create GraphQL query operation.
-
.subscription(name = nil, variable_definitions = {}, directives = [], &block) ⇒ Operation
Create GraphQL subscription operation.
Class Method Details
.directive(name, **arguments) ⇒ Object
Create GraphQL directive
205 206 207 208 209 |
# File 'lib/graphql/dsl.rb', line 205 refine Kernel do def directive(name, **arguments) Directive.new(name, **arguments) end end |
.executable_document(&block) ⇒ ExecutableDocument
Create executable GraphQL document
54 55 56 |
# File 'lib/graphql/dsl.rb', line 54 def executable_document(&block) ExecutableDocument.new(&block) end |
.fragment(name, type, directives = [], &block) ⇒ FragmentOperation
Create GraphQL fragment operation
187 188 189 |
# File 'lib/graphql/dsl.rb', line 187 def fragment(name, type, directives = [], &block) FragmentOperation.new(name, type, directives, &block) end |
.mutation(name = nil, variable_definitions = {}, directives = [], &block) ⇒ Operation
Create GraphQL mutation operation
122 123 124 |
# File 'lib/graphql/dsl.rb', line 122 def mutation(name = nil, variable_definitions = {}, directives = [], &block) Operation.new(:mutation, name, variable_definitions, directives, &block) end |
.query(name = nil, variable_definitions = {}, directives = [], &block) ⇒ Operation
Create GraphQL query operation
87 88 89 |
# File 'lib/graphql/dsl.rb', line 87 def query(name = nil, variable_definitions = {}, directives = [], &block) Operation.new(:query, name, variable_definitions, directives, &block) end |
.subscription(name = nil, variable_definitions = {}, directives = [], &block) ⇒ Operation
Create GraphQL subscription operation
157 158 159 |
# File 'lib/graphql/dsl.rb', line 157 def subscription(name = nil, variable_definitions = {}, directives = [], &block) Operation.new(:subscription, name, variable_definitions, directives, &block) end |
.variable(type, default = UNDEFINED, *directives) ⇒ Object
Create GraphQL variable
222 223 224 225 226 |
# File 'lib/graphql/dsl.rb', line 222 refine Kernel do def variable(type, default = UNDEFINED, *directives) VariableDefinition.new(type, default, directives) end end |