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



43
44
45
# File 'lib/gqli/dsl.rb', line 43

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

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

Creates a Fragment object

Can be used at a class level



36
37
38
# File 'lib/gqli/dsl.rb', line 36

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

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

Creates a Mutation object

Can be used at a class level



29
30
31
# File 'lib/gqli/dsl.rb', line 29

def self.mutation(name = nil, &block)
  Mutation.new(name, &block)
end

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

Creates a Query object

Can be used at a class level



15
16
17
# File 'lib/gqli/dsl.rb', line 15

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

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

Creates a Subscription object

Can be used at a class level



22
23
24
# File 'lib/gqli/dsl.rb', line 22

def self.subscription(name = nil, &block)
  Subscription.new(name, &block)
end

Instance Method Details

#enum(value) ⇒ Object

Creates a EnumValue object

Can be used at an instance level



78
79
80
# File 'lib/gqli/dsl.rb', line 78

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

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

Creates a Fragment object

Can be used at an instance level



71
72
73
# File 'lib/gqli/dsl.rb', line 71

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

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

Creates a Mutation object

Can be used at a instance level



57
58
59
# File 'lib/gqli/dsl.rb', line 57

def mutation(name = nil, &block)
  Mutation.new(name, &block)
end

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

Creates a Query object

Can be used at an instance level



50
51
52
# File 'lib/gqli/dsl.rb', line 50

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

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

Creates a Subscription object

Can be used at a instance level



64
65
66
# File 'lib/gqli/dsl.rb', line 64

def subscription(name = nil, &block)
  Subscription.new(name, &block)
end