Annotation Interface DefaultValue


@Target({PARAMETER,FIELD,METHOD}) @Retention(RUNTIME) @Documented public @interface DefaultValue
Controls the mapping of a method's parameter to an argument of a GraphQL operation (query/mutation/subscription).

For example, a user might annotate a method's parameter as such:
 public class CharacterService {
     @Query("searchByName"),
     public List<Character> getByName(
                       @Name("name")
                       @DefaultValue("Han Solo")
                       String name) {
         //...
     }
 }
 
Schema generation of this would result in a stanza such as:
 type Query {
     searchByName(name: String = "Han Solo"): [Character]
 }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • value

      String value
      Returns:
      the name to use for the GraphQL argument.
      Default:
      ""