Class: ElasticGraph::GraphQL::Resolvers::IndexedTypeRootFieldsResolver
- Inherits:
-
Object
- Object
- ElasticGraph::GraphQL::Resolvers::IndexedTypeRootFieldsResolver
- Defined in:
- lib/elastic_graph/graphql/resolvers/indexed_type_root_fields_resolver.rb
Overview
Responsible for resolving the list and aggregation root fields generated for each indexed type.
Instance Method Summary collapse
-
#initialize(elasticgraph_graphql:, config:) ⇒ IndexedTypeRootFieldsResolver
constructor
A new instance of IndexedTypeRootFieldsResolver.
- #resolve(field:, object:, args:, context:, lookahead:) ⇒ Object
Constructor Details
#initialize(elasticgraph_graphql:, config:) ⇒ IndexedTypeRootFieldsResolver
Returns a new instance of IndexedTypeRootFieldsResolver.
17 18 19 |
# File 'lib/elastic_graph/graphql/resolvers/indexed_type_root_fields_resolver.rb', line 17 def initialize(elasticgraph_graphql:, config:) # Nothing to initialize, but needs to be defined to satisfy the resolver interface. end |
Instance Method Details
#resolve(field:, object:, args:, context:, lookahead:) ⇒ Object
21 22 23 24 25 |
# File 'lib/elastic_graph/graphql/resolvers/indexed_type_root_fields_resolver.rb', line 21 def resolve(field:, object:, args:, context:, lookahead:) query = yield response = QuerySource.execute_one(query, for_context: context) RelayConnection.maybe_wrap(response, field: field, context: context, lookahead: lookahead, query: query) end |