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

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

Creates a Fragment object

Can be used at a class level



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

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



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

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

Instance Method Details

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

Creates a Fragment object

Can be used at an instance level



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

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



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

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