Module: ElasticGraph::Apollo::SchemaDefinition::ApolloDirectives::Override

Included in:
FieldExtension
Defined in:
elasticgraph-apollo/lib/elastic_graph/apollo/schema_definition/apollo_directives.rb

Overview

Supports Apollo’s @override directive.

Instance Method Summary collapse

Instance Method Details

#apollo_override(from:) ⇒ void

This method returns an undefined value.

Adds the @override directive to the schema element.

Examples:

Add @override to a field

ElasticGraph.define_schema do |schema|
  schema.object_type "Product" do |t|
    t.field "inStock", "Boolean" do |f|
      f.apollo_override from: "Products"
    end
  end
end

Parameters:

  • from (String)

    The name of the other subgraph that no longer resolves the field.



150
151
152
# File 'elasticgraph-apollo/lib/elastic_graph/apollo/schema_definition/apollo_directives.rb', line 150

def apollo_override(from:)
  directive "override", from: from
end