Skip to content

Conversation

marhub
Copy link
Contributor

@marhub marhub commented Jan 14, 2020

My setup: slim 4 using psr 15 middleware.

When performing any valid request error {"errors":[{"message":"GraphQL Request must include at least one of those two parameters: \"query\" or \"queryId\"","extensions":{"category":"request"}}]} is returned.
I've narrowed this to $request->getParsedBody() returning empty array instead of null in slim 4 framework when parsed body is empty. This will fix this issue.

When performing any valid request error ```{"errors":[{"message":"GraphQL Request must include at least one of those two parameters: \"query\" or \"queryId\"","extensions":{"category":"request"}}]}``` is returned.
I've narrowed this to $request->getParsedBody() returning empty array instead of null in slim 4 framework when parsed body is empty. This will fix this issue.
@moufmouf
Copy link
Member

Hey @marhub

Thanks a lot for the pull request.

I guess this is more of an issue with Slim4 than with GraphQLite. Slim4 should definitely not return an empty array if it did not parse the body of the request IMHO. Anyway, the fix is quite simple so let's apply it!

Thanks a lot!

@moufmouf moufmouf merged commit 9f8da88 into thecodingmachine:master Jan 15, 2020
@marhub marhub deleted the patch-1 branch January 16, 2020 19:47
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.

2 participants