Annotation InaccessibleDirective
-
- All Implemented Interfaces:
public @interface InaccessibleDirective
directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ENUM | ENUM_VALUE | SCALAR | INPUT_OBJECT | INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION
Inaccessible directive marks location within schema as inaccessible from the GraphQL Gateway. While
@inaccessible
fields are not exposed by the gateway to the clients, they are still available for query plans and can be referenced from@key
and@requires
directives. This allows you to not expose sensitive fields to your clients but still make them available for computations. Inaccessible can also be used to incrementally add schema elements (e.g. fields) to multiple subgraphs without breaking composition.NOTE: Location within schema will be inaccessible from the GraphQL Gateway as long as any of the subgraphs marks that location as
@inacessible
.Example:
class Product( val id: String, @InaccessibleDirective val secret: String )
will be generated by the subgraph as
type Product { id: String! secret: String! @inaccessible }
but will exposed on the GraphQL Gateway as
type Product { id: String! }