Module: ElasticGraph::Apollo::SchemaDefinition::ApolloDirectives::Key
- Included in:
- InterfaceTypeExtension, ObjectTypeExtension
- Defined in:
- elasticgraph-apollo/lib/elastic_graph/apollo/schema_definition/apollo_directives.rb
Overview
Supports Apollo’s directive[https://www.apollographql.com/docs/federation/federated-types/federated-directives/#key].
Instance Method Summary collapse
-
#apollo_key(fields:, resolvable: true) ⇒ void
Adds the directive[https://www.apollographql.com/docs/federation/federated-types/federated-directives/#key] to the schema element.
Instance Method Details
#apollo_key(fields:, resolvable: true) ⇒ void
Note:
ElasticGraph automatically defines an apollo_key
of id
for every indexed type. This API is only needed when defining additional keys on an indexed type, or defining a key for a non-indexed type.
This method returns an undefined value.
Adds the directive[https://www.apollographql.com/docs/federation/federated-types/federated-directives/#key] to the schema element.
129 130 131 |
# File 'elasticgraph-apollo/lib/elastic_graph/apollo/schema_definition/apollo_directives.rb', line 129 def apollo_key(fields:, resolvable: true) directive "key", fields: fields, resolvable: resolvable end |