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

Bug: pgSettings turn value types into strings #566

Closed
lifeiscontent opened this issue Aug 26, 2017 · 4 comments
Closed

Bug: pgSettings turn value types into strings #566

lifeiscontent opened this issue Aug 26, 2017 · 4 comments

Comments

@lifeiscontent
Copy link

given the following pgSettings:

pgSettings: req => ({
            'user.user_id': req.ctx.session.user_id || ''
          })

I expect the following:

when req.ctx.session.user_id === null to set user.user_id to
expected: "" or null
actual: "null"

when req.ctx.session.user_id === undefined to set user.user_id to
expected: "" or null
actual: "undefined"

@lifeiscontent lifeiscontent changed the title Bug: pgSettings turn value types into literal strings Bug: pgSettings turn value types into strings Aug 26, 2017
@benjie
Copy link
Member

benjie commented Aug 26, 2017

Suggestion: strings and numbers should be passed through, null/undefined should be dropped, and everything else should throw an error.

@lifeiscontent
Copy link
Author

@benjie if I was to make a PR for this, which branch or repo should I work in?

@benjie
Copy link
Member

benjie commented Aug 26, 2017

Master; I'll then merge into v3 and v4

@benjie
Copy link
Member

benjie commented Aug 26, 2017

Specifically you want to extract this line and add slightly more logic:

https://github.com/postgraphql/postgraphql/blob/master/src/postgraphql/http/createPostGraphQLHttpRequestHandler.js#L404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants