Class: GraphitiGraphQL::Configuration
- Inherits:
-
Object
- Object
- GraphitiGraphQL::Configuration
- Defined in:
- lib/graphiti_graphql.rb
Instance Attribute Summary collapse
-
#federation_application_controller ⇒ Object
Returns the value of attribute federation_application_controller.
-
#schema_reloading ⇒ Object
Returns the value of attribute schema_reloading.
Instance Method Summary collapse
- #define_context(&blk) ⇒ Object
- #get_context ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_controller ⇒ Object
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_reloading ⇒ Object
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_context ⇒ Object
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 |