Package org.eclipse.microprofile.graphql
Annotation 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:
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
-
Element Details
-
value
String value- Returns:
- the name to use for the GraphQL argument.
- Default:
- ""
-