Class IntrospectionWithDirectivesSupport


  • @PublicApi
    public class IntrospectionWithDirectivesSupport
    extends java.lang.Object
    The graphql specification does not allow you to retrieve the directives and their argument values that are present on types, enums, fields and input fields, so this class allows you to change the schema and enhance the Introspection types to contain this information. This allows you to get a directive say like `@example(argName : "someValue")` that is on a field or type at introspection time and act on it. This class takes a predicate that allows you to filter the directives you want to expose to the world. An `appliedDirectives` field is added and this contains extra fields that hold the directives and their applied values. For example the `__Field` type becomes as follows:
          type __Field {
              name: String!
              // other fields ...
              appliedDirectives: [_AppliedDirective!]!   // NEW FIELD
          }
    
         type _AppliedDirective {                        // NEW INTROSPECTION TYPE
              name: String!
              args: [_DirectiveArgument!]!
          }
    
          type _DirectiveArgument {                      // NEW INTROSPECTION TYPE
              name: String!
              value: String!
          }