@GraphQLField("name") public String getName() { return name; } }
@GraphQLField("friends") public List<Named> getFriends() { return friends; } }
@GraphQLField("name") public String getName() { return name; } }
@GraphQLField("name") public String getName() { return name; }
@GraphQLField("pets") public List<PetsUnionType> getPets() { List<PetsUnionType> pets = new ArrayList<>(); pets.addAll(cats); pets.addAll(dogs); return pets; }
@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 @GraphQLNonNull @GraphQLField("id") public String getId() throws InterruptedException { Thread.sleep(DELAY_MS); return null; } }
@GraphQLField public ColorMarker color(@GraphQLIn("id") String id) throws InterruptedException { Thread.sleep(DELAY_MS); return null; }
@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; } }
@GraphQLNonNull @GraphQLField("id") String getId() throws InterruptedException; }
@GraphQLField public Character hero(@GraphQLIn("hero") Episode episode) { return null /** StarWarsData.getArtoo() **/; }
@GraphQLField public Marker any(@GraphQLNonNull @GraphQLIn("id") String id) throws InterruptedException { Thread.sleep(DELAY_MS); return null; }
@GraphQLField public DynamicMarker dynamic(@GraphQLNonNull @GraphQLIn("id") String id) throws InterruptedException { Thread.sleep(DELAY_MS); return null; }
@Override @GraphQLNonNull @GraphQLField("id") @GraphQLDescription("The id of the human.") public String getId() { return null; }
@GraphQLField public Droid droid(@GraphQLNonNull @GraphQLIn("id") String id) { return null /** StarWarsData.getDroidDataFetcher() **/; } }
@GraphQLField("getAllUsersByRole") public List<UserObjectType> getAllUsersByRole(UserObjectType employee, @GraphQLIn("role") ROLE role) { UserObjectType userManagerObjectType = new UserObjectType(); userManagerObjectType.setId("user:id:manager:000001"); userManagerObjectType.setName("Adam Smith"); userManagerObjectType.setUpdated(new Date()); userManagerObjectType.setRole(UserObjectType.ROLE.MANAGER); return Lists.newArrayList(userManagerObjectType); }
@GraphQLField public UserObjectType viewer(/** no input parameters expected **/) { UserObjectType userObjectType = new UserObjectType(); userObjectType.setId("user:id:12345"); userObjectType.setName("Ash Nikolas Kaen"); userObjectType.setUpdated(new Date()); userObjectType.setRole(UserObjectType.ROLE.USER); return userObjectType; }
@GraphQLField("manager") public UserObjectType getManager(UserObjectType employee, @GraphQLIn(value = "ids", defaultSpel = "T(java.util.Collections).EMPTY_SET") Set<String> ids) { UserObjectType userManagerObjectType = new UserObjectType(); userManagerObjectType.setId("user:id:manager:1234567"); userManagerObjectType.setName("Wolf Adolf Riverswood"); userManagerObjectType.setUpdated(new Date()); userManagerObjectType.setRole(UserObjectType.ROLE.MANAGER); return userManagerObjectType; }
@GraphQLField public RelayNode node(@GraphQLID @GraphQLNonNull @GraphQLIn(value = "id") final String id) { /** data fetcher goes here **/ TodoObjectType todoObjectType = new TodoObjectType(); todoObjectType.setId(id); todoObjectType.setText("Node text for test!"); todoObjectType.setUpdated(new Date()); return todoObjectType; } }