graphql.servlet.StaticGraphQLRootObjectBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graphql-java-servlet Show documentation
Show all versions of graphql-java-servlet Show documentation
relay.js-compatible GraphQL servlet
package graphql.servlet;
import javax.servlet.http.HttpServletRequest;
import javax.websocket.server.HandshakeRequest;
public class StaticGraphQLRootObjectBuilder implements GraphQLRootObjectBuilder {
private final Object rootObject;
public StaticGraphQLRootObjectBuilder(Object rootObject) {
this.rootObject = rootObject;
}
@Override
public Object build(HttpServletRequest req) {
return rootObject;
}
@Override
public Object build(HandshakeRequest req) {
return rootObject;
}
@Override
public Object build() {
return rootObject;
}
}