Class: GraphqlRails::Controller::Request
- Inherits:
-
Object
- Object
- GraphqlRails::Controller::Request
- Defined in:
- lib/graphql_rails/controller/request.rb,
lib/graphql_rails/controller/request/format_errors.rb
Overview
Contains all info related with single request to controller
Direct Known Subclasses
Defined Under Namespace
Classes: FormatErrors
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#lookahead ⇒ Object
readonly
Returns the value of attribute lookahead.
-
#object_to_return ⇒ Object
Returns the value of attribute object_to_return.
Instance Method Summary collapse
-
#initialize(graphql_object, inputs, context) ⇒ Request
constructor
A new instance of Request.
- #no_object_to_return? ⇒ Boolean
- #params ⇒ Object
Constructor Details
#initialize(graphql_object, inputs, context) ⇒ Request
Returns a new instance of Request.
12 13 14 15 16 17 |
# File 'lib/graphql_rails/controller/request.rb', line 12 def initialize(graphql_object, inputs, context) @graphql_object = graphql_object @inputs = inputs.except(:lookahead) @lookahead = inputs[:lookahead] @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
10 11 12 |
# File 'lib/graphql_rails/controller/request.rb', line 10 def context @context end |
#errors ⇒ Object
Returns the value of attribute errors.
10 11 12 |
# File 'lib/graphql_rails/controller/request.rb', line 10 def errors @errors end |
#lookahead ⇒ Object (readonly)
Returns the value of attribute lookahead.
10 11 12 |
# File 'lib/graphql_rails/controller/request.rb', line 10 def lookahead @lookahead end |
#object_to_return ⇒ Object
Returns the value of attribute object_to_return.
9 10 11 |
# File 'lib/graphql_rails/controller/request.rb', line 9 def object_to_return @object_to_return end |
Instance Method Details
#no_object_to_return? ⇒ Boolean
25 26 27 |
# File 'lib/graphql_rails/controller/request.rb', line 25 def no_object_to_return? !defined?(@object_to_return) end |
#params ⇒ Object
29 30 31 32 33 |
# File 'lib/graphql_rails/controller/request.rb', line 29 def params deep_transform_values(inputs.to_h) do |val| graphql_object_to_hash(val) end end |