Class: ElasticGraph::Apollo::GraphQL::EntitiesFieldResolver::RepresentationWithId
- Inherits:
-
Object
- Object
- ElasticGraph::Apollo::GraphQL::EntitiesFieldResolver::RepresentationWithId
- Defined in:
- lib/elastic_graph/apollo/graphql/entities_field_resolver.rb
Overview
A simple value object containing a parsed form of an ‘_Any` representation when there’s an ‘id` field.
Defined Under Namespace
Classes: Adapter
Instance Method Summary collapse
-
#initialize(type:, id:, other_fields:, schema_element_names:) ⇒ RepresentationWithId
constructor
A new instance of RepresentationWithId.
Constructor Details
#initialize(type:, id:, other_fields:, schema_element_names:) ⇒ RepresentationWithId
Returns a new instance of RepresentationWithId.
149 150 151 152 153 154 155 156 |
# File 'lib/elastic_graph/apollo/graphql/entities_field_resolver.rb', line 149 def initialize(type:, id:, other_fields:, schema_element_names:) super( type: type, id: id, other_fields: other_fields, schema_element_names: schema_element_names, # All `RepresentationWithId` instances with the same `type` can be handled by the same adapter, # since we can combine them into a single query filtering on `id`. adapter: Adapter.new(type, schema_element_names) ) end |