public abstract class GraphQLServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet, GraphQLMBean
| Modifier and Type | Class and Description |
|---|---|
protected static class |
GraphQLServlet.GraphQLRequest |
protected static class |
GraphQLServlet.GraphQLResponse |
protected static interface |
GraphQLServlet.GraphQLResponseHandler |
protected static interface |
GraphQLServlet.HttpRequestHandler |
protected static class |
GraphQLServlet.VariablesDeserializer |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
APPLICATION_JSON_UTF8 |
static org.slf4j.Logger |
log |
static int |
STATUS_BAD_REQUEST |
static int |
STATUS_OK |
| Constructor and Description |
|---|
GraphQLServlet() |
GraphQLServlet(ObjectMapperConfigurer objectMapperConfigurer,
java.util.List<GraphQLServletListener> listeners,
org.apache.commons.fileupload.FileItemFactory fileItemFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(GraphQLServletListener servletListener) |
protected abstract GraphQLContext |
createContext(java.util.Optional<javax.servlet.http.HttpServletRequest> request,
java.util.Optional<javax.servlet.http.HttpServletResponse> response) |
protected abstract java.lang.Object |
createRootObject(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 abstract ExecutionStrategyProvider |
getExecutionStrategyProvider() |
protected abstract GraphQLErrorHandler |
getGraphQLErrorHandler() |
protected abstract graphql.execution.instrumentation.Instrumentation |
getInstrumentation() |
protected com.fasterxml.jackson.databind.ObjectMapper |
getMapper() |
java.lang.String[] |
getMutations() |
protected abstract graphql.execution.preparsed.PreparsedDocumentProvider |
getPreparsedDocumentProvider() |
java.lang.String[] |
getQueries() |
protected abstract GraphQLSchemaProvider |
getSchemaProvider() |
void |
removeListener(GraphQLServletListener servletListener) |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, servicedestroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, logpublic static final org.slf4j.Logger log
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(ObjectMapperConfigurer objectMapperConfigurer, java.util.List<GraphQLServletListener> listeners, org.apache.commons.fileupload.FileItemFactory fileItemFactory)
protected abstract GraphQLSchemaProvider getSchemaProvider()
protected abstract GraphQLContext createContext(java.util.Optional<javax.servlet.http.HttpServletRequest> request, java.util.Optional<javax.servlet.http.HttpServletResponse> response)
protected abstract java.lang.Object createRootObject(java.util.Optional<javax.servlet.http.HttpServletRequest> request,
java.util.Optional<javax.servlet.http.HttpServletResponse> response)
protected abstract ExecutionStrategyProvider getExecutionStrategyProvider()
protected abstract graphql.execution.instrumentation.Instrumentation getInstrumentation()
protected abstract GraphQLErrorHandler getGraphQLErrorHandler()
protected abstract graphql.execution.preparsed.PreparsedDocumentProvider getPreparsedDocumentProvider()
protected com.fasterxml.jackson.databind.ObjectMapper getMapper()
public void addListener(GraphQLServletListener servletListener)
public void removeListener(GraphQLServletListener servletListener)
public java.lang.String[] getQueries()
getQueries in interface GraphQLMBeanpublic java.lang.String[] getMutations()
getMutations in interface GraphQLMBeanpublic java.lang.String executeQuery(java.lang.String query)
executeQuery in interface GraphQLMBeanprotected 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.HttpServletjavax.servlet.ServletExceptionjava.io.IOExceptionprotected 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.HttpServletjavax.servlet.ServletExceptionjava.io.IOException