For use cases like authentication it may be of use to add custom directives to a GraphQL schema as shown in the documentation: https://www.graphql-java.com/documentation/v16/sdl-directives
For example the Employee type has a salary field that had a directive on it meaning that only the manager role is allowed to read it:
directive @auth(role: String!) on FIELD_DEFINITION
type Employee {
id: ID
name: String!
startDate: String!
salary: Float @auth(role: "manager")
}
From the client side I would like to be able to read these directives on the Employee type using an Introspection query.
Is that possible at all? Would you be able provide a sample query for the example above?