Class: GraphQL::SmartSelect::Resolver
- Inherits:
-
Object
- Object
- GraphQL::SmartSelect::Resolver
- Defined in:
- lib/graphql/smart_select/resolver.rb
Overview
Resolve the minimum required fields for the query
Instance Attribute Summary collapse
-
#ctx ⇒ Object
readonly
Returns the value of attribute ctx.
-
#relation ⇒ Object
readonly
Returns the value of attribute relation.
-
#smart_select ⇒ Object
readonly
Returns the value of attribute smart_select.
Instance Method Summary collapse
-
#initialize(relation, ctx, smart_select) ⇒ Resolver
constructor
A new instance of Resolver.
- #resolve ⇒ Object
Constructor Details
#initialize(relation, ctx, smart_select) ⇒ Resolver
Returns a new instance of Resolver.
15 16 17 18 19 |
# File 'lib/graphql/smart_select/resolver.rb', line 15 def initialize(relation, ctx, smart_select) @smart_select = smart_select @relation = relation @ctx = ctx end |
Instance Attribute Details
#ctx ⇒ Object (readonly)
Returns the value of attribute ctx.
13 14 15 |
# File 'lib/graphql/smart_select/resolver.rb', line 13 def ctx @ctx end |
#relation ⇒ Object (readonly)
Returns the value of attribute relation.
13 14 15 |
# File 'lib/graphql/smart_select/resolver.rb', line 13 def relation @relation end |
#smart_select ⇒ Object (readonly)
Returns the value of attribute smart_select.
13 14 15 |
# File 'lib/graphql/smart_select/resolver.rb', line 13 def smart_select @smart_select end |
Instance Method Details
#resolve ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/graphql/smart_select/resolver.rb', line 21 def resolve reject_virtual_fields( query_fields | Assosiations.new(relation, query_fields).expose | Options.new(list_of_nodes, smart_select).expose ).map(&:to_sym) end |