/** * @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a> */ public class EdgeObjectType<T> { private T node; @GraphQLNonNull private String cursor; public T getNode() { return node; } public void setNode(T node) { this.node = node; } public String getCursor() { return cursor; } public void setCursor(String cursor) { this.cursor = cursor; } }
@GraphQLID("id") @GraphQLNonNull @GraphQLDescription("GraphQL Relay global object unique identifier") String getId(RelayNode relayNode); }
@GraphQLNonNull @GraphQLField("id") String getId() throws InterruptedException; }
@Override @GraphQLNonNull @GraphQLField("id") public String getId() throws InterruptedException { Thread.sleep(DELAY_MS); return null; } }
@GraphQLNonNull @GraphQLField("id") String getId();
@GraphQLField public long event(@GraphQLNonNull @GraphQLIn(value = "id") final Long event) { return new Date().getTime(); }
public class PageInfoObjectType { @GraphQLNonNull @GraphQLDescription("When paginating forwards") private Boolean hasNextPage; @GraphQLNonNull @GraphQLDescription("When paginating backwards") private Boolean hasPreviousPage;
@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; }
@GraphQLID("id") @GraphQLNonNull @GraphQLDescription("Global object unique identifier") public String getId(RelayNode relayNode) { BaseObjectType baseObjectType = (BaseObjectType) relayNode; return baseObjectType.id; }
@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 public Human human(@GraphQLNonNull @GraphQLIn("id") String id) { return null /** StarWarsData.getHumanDataFetcher() **/; }
public class RootObjectType { @GraphQLNonNull @GraphQLField("version") @GraphQLDescription("GraphQL Schema Version")
@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; } }