Skip to content

Make AbstractGraphQLHttpServlet to be more customisable #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
drupalspring opened this issue Jun 30, 2019 · 1 comment
Closed

Make AbstractGraphQLHttpServlet to be more customisable #194

drupalspring opened this issue Jun 30, 2019 · 1 comment
Milestone

Comments

@drupalspring
Copy link

drupalspring commented Jun 30, 2019

Maybe related to #182 .

Currently , all of the request handling logic are implemented in the getHandler and postHandler , but all of its internal methods are private methods which make the subclass cannot customise the request handling logic by override the corresponding methods.

My use-case is that I would like to override the logic of setting the HttpServletResponse (e.g its status code , the content write to the outputStream)(i.e the following codes in query() )

        if (!(result.getData() instanceof Publisher)) {
            resp.setContentType(APPLICATION_JSON_UTF8);
            resp.setStatus(STATUS_OK);
            resp.getWriter().write(graphQLObjectMapper.serializeResultAsJson(result));
        }

I am thinking perhaps to refactor the logic of getHandler/postHandler into many sensible protected methods such that subclass can override it
(e.g queryIntroSpectionRequest() , setResponse() .....)

@oliemansm
Copy link
Member

The refactoring that needs to be done is a lot more extensive. The AbtractGraphQLHttpServlet has way too much responsibilities at the moment. Make sure you keep an eye on the PR for #182 once that work is being done to see if it suits your needs too.

@oliemansm oliemansm added this to the 9.0.0 milestone Nov 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants