Class: GraphQL::Query::OperationResolver
- Inherits:
-
Object
- Object
- GraphQL::Query::OperationResolver
- Defined in:
- lib/graph_ql/query/operation_resolver.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Instance Method Summary collapse
-
#initialize(operation_definition, query) ⇒ OperationResolver
constructor
A new instance of OperationResolver.
- #result ⇒ Object
Constructor Details
#initialize(operation_definition, query) ⇒ OperationResolver
Returns a new instance of OperationResolver.
4 5 6 7 8 9 |
# File 'lib/graph_ql/query/operation_resolver.rb', line 4 def initialize(operation_definition, query) @operation_definition = operation_definition @variables = query.params @query = query @context = query.context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
2 3 4 |
# File 'lib/graph_ql/query/operation_resolver.rb', line 2 def context @context end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
2 3 4 |
# File 'lib/graph_ql/query/operation_resolver.rb', line 2 def query @query end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
2 3 4 |
# File 'lib/graph_ql/query/operation_resolver.rb', line 2 def variables @variables end |
Instance Method Details
#result ⇒ Object
13 14 15 |
# File 'lib/graph_ql/query/operation_resolver.rb', line 13 def result @result ||= execute(@operation_definition, query) end |