-
- All Implemented Interfaces:
public @interface ShareableDirective
directive @shareable on FIELD_DEFINITION | OBJECT
Shareable directive indicates that given object and/or field can be resolved by multiple subgraphs. If an object is marked as
@shareable
then all its fields are automatically shareable without the need for explicitly marking them with@shareable
directive. All fields referenced from@key
directive are automatically shareable as well.Example:
type Product @key(fields: "id") { id: ID! # shareable because id is a key field name: String # non-shareable description: String @shareable # shareable } type User @key(fields: "email") @shareable { email: String # shareable because User is marked shareable name: String # shareable because User is marked shareable }