Annotation Type Key


  • @Description("Designates an object type as an entity and specifies its key fields (a set of fields that the subgraph can use to uniquely identify any instance of the entity). You can apply multiple @key directives to a single entity (to specify multiple valid sets of key fields).")
    @Retention(RUNTIME)
    @Repeatable(Keys.class)
    @Experimental("SmallRye GraphQL Federation is still subject to change.")
    public @interface Key
    directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE
    See Also:
    federation spec
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      @NonNull FieldSet fields  
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean resolvable  
    • Element Detail

      • fields

        @NonNull
        @Description("A GraphQL selection set (provided as a string) of fields and subfields that contribute to the entity\'s primary key.\nExamples:\n\"id\"\n\"username region\"\n\"name organization { id }\"")
        @NonNull FieldSet fields
      • resolvable

        @DefaultValue("true")
        @Description("If false, indicates to the router that this subgraph doesn\'t define a reference resolver for this entity. This means that router query plans can\'t \"jump to\" this subgraph to resolve fields that aren\'t defined in another subgraph.")
        boolean resolvable
        Default:
        true