Class: ElasticGraph::GraphQL::QueryAdapter::RequestedFields::WithoutSchema

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_graph/graphql/query_adapter/requested_fields.rb

Overview

Partially applied ‘RequestedFields` – essentially the `RequestedFields` without the schema, so that it can be instantiated before the `Schema` instance exists, instead providing it from `context` at query time.

Instance Method Summary collapse

Instance Method Details

#call(field:, query:, lookahead:, args:, context:) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/elastic_graph/graphql/query_adapter/requested_fields.rb', line 21

def call(field:, query:, lookahead:, args:, context:)
  return query if field.type.unwrap_fully.indexed_aggregation?

  RequestedFields.new(context.fetch(:elastic_graph_schema)).call(
    field: field,
    query: query,
    lookahead: lookahead,
    args: args,
    context: context
  )
end