@Retention(value=RUNTIME) @Target(value={FIELD,METHOD}) @Documented public @interface NonNull
@Type(name = "Starship", description = "A starship in StarWars")
@InputType(name = "StarshipInput", description = "Input type for a starship")
public class Starship {
private String id;
@NonNull
private String name;
private float length;
// getters/setters...
}
Schema generation of this would result in a stanza such as:
# A starship from Starwars
type Starship {
id: String
name: String!
length: Float!
}
# Input type for a starship
input StarshipInput {
# uuid of a new Starship
id: String
name: String!
length: Float!
}
DefaultValue annotation.Copyright © 2019 Eclipse Foundation. All rights reserved.