Class: GraphitiGraphQL::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/graphiti_graphql.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



18
19
20
# File 'lib/graphiti_graphql.rb', line 18

def initialize
  self.schema_reloading = true
end

Instance Attribute Details

#federation_application_controllerObject

Returns the value of attribute federation_application_controller.



16
17
18
# File 'lib/graphiti_graphql.rb', line 16

def federation_application_controller
  @federation_application_controller
end

#schema_reloadingObject

Returns the value of attribute schema_reloading.



16
17
18
# File 'lib/graphiti_graphql.rb', line 16

def schema_reloading
  @schema_reloading
end

Instance Method Details

#define_context(&blk) ⇒ Object



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

def define_context(&blk)
  @define_context = blk
end

#get_contextObject



26
27
28
29
30
31
32
33
# File 'lib/graphiti_graphql.rb', line 26

def get_context
  obj = Graphiti.context[:object]
  if @define_context
    @define_context.call(obj)
  else
    {object: obj}
  end
end