-
Notifications
You must be signed in to change notification settings - Fork 99
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
Empty request body parsing error for automatic persisted queries #614
Comments
I don't think it's related. This happens way before persisted queries. What is the body and content-type you're sending? I'd say we need an integration test for the HTTP implementation as a whole. For that, we could do what Apollo Server did and use JS It'd be nice to just use those as those should be a reference anyway, and those would be true integration tests. |
What's nice about |
Seems like all An improvement for |
I've played around with
|
@oprypkhantc Yea, the body is empty for a |
Probably unnecessary. I'm pretty sure It'd be nice to offload the whole HTTP handling thing to If we could offload this to |
So, I was able to run our integration tests for graphql with the request body parsing commented out and all tests are passing. That parsing and body validation check seems entirely unnecessary. I am, however, getting the following error now:
When making a I agree with primarily offloading the request handling to webonyx. I do think it's a good idea that we maintain some minimal integration test coverage for requests though. I don't think we need anything too extensive, but having some coverage there is wise. |
The
It seems like at least 15 of graphql-http tests fail when I comment out that body parsing part, so it seems like it is indeed needed :( Here's one of those:
Changing the check to |
Yea, so our boot stack is probably setting the parsedBody already, as we have to parse it for some authorization concerns. I don't know why that should be necessary though for webonyx.
Not sure what you mean by "top-level" here. You mean appended to the actual request URL, as opposed to being a request param on the request object? And why? |
They don't do any body parsing for requests that implement The implementation I used (
You mentioned it being under the |
Here is an excerpt of the dumped request object:
Ignore the superfulous params. They're just there b/c of our integration test implementation - should be harmless. |
Got it. I'm not sure why you're not getting a If you start that with
|
See #427 as possibly related issue. |
So, I don't know if this is a Laminas However, when digging into webonyx, the query params are built like so... \parse_str(\html_entity_decode($request->getUri()->getQuery()), $queryParams); As you can see, it's getting them from the It's worth pointing out that Laminas also has The issue is resolved by using The additional parsing of the request body logic does appear to be needed based on the |
@oprypkhantc I was giving the new persisted queries a go to test the implementation, since I wasn't able to do so prior. In doing so, I'm running into the following issue.
This is part of the
process
method for the middleware, which looks for the request body contents. For reference, theprocess
method is as follows:Was this overlooked? We need an integration test for persisted queries for sure. Am I missing something here?
The text was updated successfully, but these errors were encountered: