public abstract class GraphQLServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet, GraphQLMBean, GraphQLSchemaProvider
Modifier and Type | Class and Description |
---|---|
protected static class |
GraphQLServlet.GraphQLRequest |
protected static interface |
GraphQLServlet.RequestHandler |
protected static class |
GraphQLServlet.VariablesDeserializer |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPLICATION_JSON_UTF8 |
static int |
STATUS_BAD_REQUEST |
static int |
STATUS_OK |
Constructor and Description |
---|
GraphQLServlet() |
GraphQLServlet(java.util.List<GraphQLOperationListener> operationListeners,
java.util.List<GraphQLServletListener> servletListeners,
org.apache.commons.fileupload.FileItemFactory fileItemFactory) |
Modifier and Type | Method and Description |
---|---|
void |
addOperationListener(GraphQLOperationListener operationListener) |
void |
addServletListener(GraphQLServletListener servletListener) |
protected abstract GraphQLContext |
createContext(java.util.Optional<javax.servlet.http.HttpServletRequest> request,
java.util.Optional<javax.servlet.http.HttpServletResponse> response) |
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
java.lang.String |
executeQuery(java.lang.String query) |
protected java.util.List<graphql.GraphQLError> |
filterGraphQLErrors(java.util.List<graphql.GraphQLError> errors) |
protected abstract graphql.execution.ExecutionStrategy |
getExecutionStrategy() |
java.lang.String[] |
getMutations() |
java.lang.String[] |
getQueries() |
void |
removeOperationListener(GraphQLOperationListener operationListener) |
void |
removeServletListener(GraphQLServletListener servletListener) |
protected abstract java.util.Map<java.lang.String,java.lang.Object> |
transformVariables(graphql.schema.GraphQLSchema schema,
java.lang.String query,
java.util.Map<java.lang.String,java.lang.Object> variables) |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, getServletConfig, getServletInfo, init, service
getReadOnlySchema, getSchema
public static final java.lang.String APPLICATION_JSON_UTF8
public static final int STATUS_OK
public static final int STATUS_BAD_REQUEST
public GraphQLServlet()
public GraphQLServlet(java.util.List<GraphQLOperationListener> operationListeners, java.util.List<GraphQLServletListener> servletListeners, org.apache.commons.fileupload.FileItemFactory fileItemFactory)
protected abstract GraphQLContext createContext(java.util.Optional<javax.servlet.http.HttpServletRequest> request, java.util.Optional<javax.servlet.http.HttpServletResponse> response)
protected abstract graphql.execution.ExecutionStrategy getExecutionStrategy()
protected abstract java.util.Map<java.lang.String,java.lang.Object> transformVariables(graphql.schema.GraphQLSchema schema, java.lang.String query, java.util.Map<java.lang.String,java.lang.Object> variables)
public void addOperationListener(GraphQLOperationListener operationListener)
public void removeOperationListener(GraphQLOperationListener operationListener)
public void addServletListener(GraphQLServletListener servletListener)
public void removeServletListener(GraphQLServletListener servletListener)
public java.lang.String[] getQueries()
getQueries
in interface GraphQLMBean
public java.lang.String[] getMutations()
getMutations
in interface GraphQLMBean
public java.lang.String executeQuery(java.lang.String query)
executeQuery
in interface GraphQLMBean
protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException
protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
doPost
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException
protected java.util.List<graphql.GraphQLError> filterGraphQLErrors(java.util.List<graphql.GraphQLError> errors)