Skip to content
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

feat(postgraphql) Add EventListener object to Context object. (#501) #651

Closed
wants to merge 1 commit into from

Conversation

Belline
Copy link

@Belline Belline commented Dec 18, 2017

This implements the solution described in #501 , allowing Plugins to reach the req/res objects to set Cookies and other uses as well

@benjie
Copy link
Member

benjie commented Dec 19, 2017

Great PR: small, clean and simple. However, I think you could use:

#601

To achieve the same goal without requiring any code changes?

@chadfurman
Copy link
Collaborator

@benjie we need access to the response object, as well. #601 only provides the request object

@benjie
Copy link
Member

benjie commented Dec 19, 2017

You should be able to get res from req.res but feel free to open a PR adding res to #601

@chadfurman
Copy link
Collaborator

TIL we can get res from req

@fictorial
Copy link

I don't see how req.res is available since this call seems to happen before the graphql is executed.

I don't see a way to set a cookie or other header from within the current flow. It appears that postgraphile as a lib doesn't expect to be middleware and thus does not call any next function it is given so that option is out.

Is there a standard way to hook into the flow to be able to set a response header based on the graphql response?

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

Successfully merging this pull request may close these issues.

4 participants