Package 

Annotation ComposeDirective

  • All Implemented Interfaces:

    
    public @interface ComposeDirective
    
                        
    directive @composeDirective(name: String!) repeatable on SCHEMA

    By default, Supergraph schema excludes all custom directives. The @composeDirective is used to specify custom directives that should be exposed in the Supergraph schema.

    Example: Given @custom directive we can preserve it in the Supergraph schema

    @GraphQLDirective(name = "custom", locations = [Introspection.DirectiveLocation.FIELD_DEFINITION])
    annotation class CustomDirective
    
    @ComposeDirective(name = "custom")
    class CustomSchema
    
    class SimpleQuery {
      @CustomDirective
      fun helloWorld(): String = "Hello World"
    }

    it will generate following schema

    schema @composeDirective(name: "@myDirective") @link(import : ["@composeDirective", "@extends", "@external", "@inaccessible", "@interfaceObject", "@key", "@override", "@provides", "@requires", "@shareable", "@tag", "FieldSet"], url : "https://specs.apollo.dev/federation/v2.3") {
       query: Query
    }
    
    directive @custom on FIELD_DEFINITION
    
    type Query {
      helloWorld: String! @custom
    }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final String name
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail