Servlet endpoint for GraphQL Java
The library received a major refactoring to allow part to be usable in other projects, such as in combination with spring-webflux. It could be import statements have to be updated because of this. Although most of it is internal, which means most people should not be affected by this.
The project has been reorganized a bit. While doing so we decided to take a look at certain parts and refactor those.
The GraphQLContext
had direct dependencies on several elements from javax.servlet.*
. It's now an interface exposing only the Subject
and DataLoaderRegistry
. All other components it exposed have now been moved to more specific interfaces GraphQLServletContext
and GraphQLWebSocketContext
.
GraphQLServletContext
is the interface representing the GraphQLContext for queries and mutations using the servlet. This class now exposes the HttpServletRequest
and HttpServletResponse
objects. Since this is created in a process where these are required to be available the getters are no longer returning Optionals but are always returning non null objects.
GraphQLWebSocketContext
is created for subscriptions.
Those can be overridden as before by your own custom context.
Thanks to the contributors this release contains the following changes:
init()
instead of init(ServletConfig)
in AbstractGraphQLHttpServlet
#175warn
to debug
EOFException
exception on websocket error by removing and closing the sessionFixed issue with NPE when running query without variables
Upgraded to graphql-java 12.0