@GraphQLDescription("Information about pagination in a connection") public class PageInfoObjectType { @GraphQLDescription("When paginating forwards") private Boolean hasNextPage; @GraphQLDescription("When paginating backwards") private Boolean hasPreviousPage; @GraphQLDescription("When paginating backwards, the cursor to continue") private String startCursor; @GraphQLDescription("When paginating forwards, the cursor to continue.") private String endCursor;
@GraphQLObject @GraphQLDescription("A mechanical creature in the Star Wars universe.") public static class Droid extends BaseCharacter { @GraphQLDescription("The primary function of the droid.") private String primaryFunction; public String getPrimaryFunction() { return primaryFunction; } public void setPrimaryFunction(String primaryFunction) { this.primaryFunction = primaryFunction; } }
@GraphQLObject @GraphQLDescription("A humanoid creature in the Star Wars universe.") public static class Human extends BaseCharacter { @GraphQLDescription("The home planet of the human, or null if unknown.") private String homePlanet; public String getHomePlanet() { return homePlanet; } public void setHomePlanet(String homePlanet) { this.homePlanet = homePlanet; } }
@GraphQLID("id") @GraphQLNonNull @GraphQLDescription("GraphQL Relay global object unique identifier") String getId(RelayNode relayNode); }
@Override @GraphQLField("friends") @GraphQLDescription("The friends of the human, or an empty list if they have none.") public List<Character> getFriends() { return null /** StarWarsData.getFriendsDataFetcher() **/; }
@Override @GraphQLField("name") @GraphQLDescription("The name of the human.") public String getName() { return null; }
@Override @GraphQLField("appearsIn") @GraphQLDescription("Which movies they appear in.") public List<Episode> getAppearsIn() { return null; } }
@GraphQLInterface @GraphQLDescription("A character in the Star Wars Trilogy") public interface Character { @GraphQLNonNull @GraphQLField("id") String getId(); @GraphQLField("name") String getName(); @GraphQLField("friends") List<Character> getFriends(); @GraphQLField("appearsIn") List<Episode> getAppearsIn(); }
@Override @GraphQLNonNull @GraphQLField("id") @GraphQLDescription("The id of the human.") public String getId() { return null; }
@GraphQLID("id") @GraphQLNonNull @GraphQLDescription("Global object unique identifier") public String getId(RelayNode relayNode) { BaseObjectType baseObjectType = (BaseObjectType) relayNode; return baseObjectType.id; }
@GraphQLDescription("Released in 1977.") NEWHOPE, @GraphQLDescription("Released in 1980.") EMPIRE, @GraphQLDescription("Released in 1983.") JEDI; @GraphQLDescription("Released in 1977.") NEWHOPE(4), @GraphQLDescription("Released in 1980.") EMPIRE(5), @GraphQLDescription("Released in 1983.") JEDI(6);
private UserObjectType manager; @GraphQLDescription("User roles") public enum ROLE { USER, ADMIN, MANAGER
@GraphQLDescription("Mutation to add new todo item") @GraphQLMutation("addTodoMutation") public @GraphQLOut("todoEdge") TodoObjectType.TodoEdgeObjectType addTodoMutation(@GraphQLIn(value = "addTodoInput", defaultProvider = "getAddTodoInputDefaultValue") AddTodoIn addTodoInput, AddTodoIn2 addTodoInput2) { TodoObjectType.TodoEdgeObjectType todoEdgeObjectType = new TodoObjectType.TodoEdgeObjectType(); todoEdgeObjectType.setCursor("test-cursor"); todoEdgeObjectType.setNode(new TodoObjectType()); todoEdgeObjectType.getNode().setId("id-12345"); todoEdgeObjectType.getNode().setText("simple text"); todoEdgeObjectType.getNode().setComplete(false); todoEdgeObjectType.getNode().setUpdated(new Date()); return todoEdgeObjectType; }