@GraphQLID("id") @GraphQLNonNull @GraphQLDescription("GraphQL Relay global object unique identifier") String getId(RelayNode relayNode); }
@GraphQLMutation("updateTodoLongMutation") public @GraphQLOut("outLong") Long updateTodoLongMutation(@GraphQLIn(value = "longInput") Long newText) { return Long.MAX_VALUE; }
@GraphQLField public Droid droid(@GraphQLNonNull @GraphQLIn("id") String id) { return null /** StarWarsData.getDroidDataFetcher() **/; } }
@Override @GraphQLNonNull @GraphQLField("id") @GraphQLDescription("The id of the human.") public String getId() { 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 @GraphQLField("friends") @GraphQLDescription("The friends of the human, or an empty list if they have none.") public List<Character> getFriends() { return null /** StarWarsData.getFriendsDataFetcher() **/; }
@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; } }
@GraphQLNonNull @GraphQLField("id") String getId() throws InterruptedException; }
@GraphQLField public Character hero(@GraphQLIn("hero") Episode episode) { return null /** StarWarsData.getArtoo() **/; }
@GraphQLField("name") public String getName() { return name; } }
@GraphQLID("id") @GraphQLNonNull @GraphQLDescription("Global object unique identifier") public String getId(RelayNode relayNode) { BaseObjectType baseObjectType = (BaseObjectType) relayNode; return baseObjectType.id; }
@GraphQLField public Human human(@GraphQLNonNull @GraphQLIn("id") String id) { return null /** StarWarsData.getHumanDataFetcher() **/; }
@GraphQLMutation("updateTodoMutation") public @GraphQLOut("todoEdge") String updateTodoMutation(@GraphQLIn(value = "updateTodoInput") String newText) { return "Simple output string"; }
@Override @GraphQLField("name") @GraphQLDescription("The name of the human.") public String getName() { return null; }
@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; } }
@GraphQLField("friends") public List<Named> getFriends() { return friends; } }
@GraphQLField public DynamicMarker dynamic(@GraphQLNonNull @GraphQLIn("id") String id) throws InterruptedException { Thread.sleep(DELAY_MS); return null; }
@GraphQLMutation("updateTodoDateMutation") public @GraphQLOut("outDate") Date updateTodoDateMutation(@GraphQLIn(value = "dateInput") Date date) { return new Date(); }
@Override @GraphQLField("appearsIn") @GraphQLDescription("Which movies they appear in.") public List<Episode> getAppearsIn() { return null; } }
@GraphQLField public Marker any(@GraphQLNonNull @GraphQLIn("id") String id) throws InterruptedException { Thread.sleep(DELAY_MS); return null; }