Class GraphQLServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- org.apache.sling.api.servlets.SlingSafeMethodsServlet
-
- org.apache.sling.api.servlets.SlingAllMethodsServlet
-
- org.apache.sling.graphql.core.servlet.GraphQLServlet
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class GraphQLServlet extends org.apache.sling.api.servlets.SlingAllMethodsServlet
Servlet that can be activated to implement the standard GraphQL "protocol" as per https://graphql.org/learn/serving-over-http/ This servlet is only active if the corresponding OSGi configurations are created. This allows is to be mounted either on a path to support the "traditional" GraphQL single-endpoint mode, or on specific resource types and selectors to turn specific Sling Resources into GraphQL endpoints.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
GraphQLServlet.Config
-
Constructor Summary
Constructors Constructor Description GraphQLServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doGet(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
void
doPost(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
-
Methods inherited from class org.apache.sling.api.servlets.SlingAllMethodsServlet
doDelete, doPut, getAllowedRequestMethods, isMethodValid, mayService
-
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet
doGeneric, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service
-
-
-
-
Field Detail
-
P_QUERY
public static final String P_QUERY
- See Also:
- Constant Field Values
-
-
Method Detail
-
doGet
public void doGet(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response) throws IOException
- Overrides:
doGet
in classorg.apache.sling.api.servlets.SlingSafeMethodsServlet
- Throws:
IOException
-
doPost
public void doPost(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response) throws IOException
- Overrides:
doPost
in classorg.apache.sling.api.servlets.SlingAllMethodsServlet
- Throws:
IOException
-
-