Module: GQLi::DSL

Included in:
Introspection
Defined in:
lib/gqli/dsl.rb

Overview

GraphQL-like DSL methods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.enum(value) ⇒ Object

Creates a EnumValue object

Can be used at a class level



27
28
29
# File 'lib/gqli/dsl.rb', line 27

def self.enum(value)
  EnumValue.new(value)
end

.fragment(name, on, &block) ⇒ Object

Creates a Fragment object

Can be used at a class level



20
21
22
# File 'lib/gqli/dsl.rb', line 20

def self.fragment(name, on, &block)
  Fragment.new(name, on, &block)
end

.query(name = nil, &block) ⇒ Object

Creates a Query object

Can be used at a class level



13
14
15
# File 'lib/gqli/dsl.rb', line 13

def self.query(name = nil, &block)
  Query.new(name, &block)
end

Instance Method Details

#enum(value) ⇒ Object

Creates a EnumValue object

Can be used at an instance level



48
49
50
# File 'lib/gqli/dsl.rb', line 48

def enum(value)
  EnumValue.new(value)
end

#fragment(name, on, &block) ⇒ Object

Creates a Fragment object

Can be used at an instance level



41
42
43
# File 'lib/gqli/dsl.rb', line 41

def fragment(name, on, &block)
  Fragment.new(name, on, &block)
end

#query(name = nil, &block) ⇒ Object

Creates a Query object

Can be used at an instance level



34
35
36
# File 'lib/gqli/dsl.rb', line 34

def query(name = nil, &block)
  Query.new(name, &block)
end