Annotation ShareableDirective
-
- All Implemented Interfaces:
public @interface ShareableDirectivedirective @shareable repeatable on FIELD_DEFINITION | OBJECTShareable directive indicates that given object and/or field can be resolved by multiple subgraphs. If an object is marked as
@shareablethen all its fields are automatically shareable without the need for explicitly marking them with@shareabledirective. All fields referenced from@keydirective are automatically shareable as well.NOTE: Objects/fields have to specify same shareability (i.e.
@shareableor not) mode across ALL subgraphs.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 }