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"),
@Description("Search characters by name")
public List<Character> getByName(
@Argument("name")
@Description("Name to search for")
@DefaultValue("Han Solo")
String name) {
//...
}
}
Schema generation of this would result in a stanza such as:
type Query {
# Search characters by name
# name: Name to search for. Default value: Han Solo.
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:
- ""
-