-
-
Notifications
You must be signed in to change notification settings - Fork 570
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
hono/aws-lambda + @hono/graphql-server GET not working! #2723
Comments
I have noticed (and fixed) this issue a while back when updating my fork to align with hono's current update, you could patch the package for a workaround in the time being. I'll proceed to create a PR for official Hono now. |
Hi @mthmcalixto, coming back to this issue, graphql is using HTTP method and should be supported by the official adapter. For your case, it is actually because you were including a JSON body with a GET method, which is not supported by the Web Standard Request, you should put it as query parameter for GET requests. You could check the AWS doc to see the valid payload for testing. |
@NamesMT Yes, it seems that I passed an empty graphql body and this caused an internal error. What improvements are there in https://github.com/NamesMT/hono-adapter-aws-lambda? |
@NamesMT try to put the query empty and do a GET. This should return a json error, not an internal error. |
Hi @mthmcalixto, this is my response if I put the query empty and do a GET (Lambda): The response is a proper 400 with message, not a 502 |
|
@mthmcalixto |
Hi, |
That's exactly the error I'm saying, it should return 400, not a 502. The error is not handled. |
Having similar issue. On another note, in just using the Hello World example for AWS lambda in |
Would greatly appreciate it if you could have the time to create an issue detailing your issue :D |
A TL;DR FYI on the original issue for later comers, the issue was caused by user error, not Hono, more specifically, the HTTP client he is using: "HTTPie" will includes a JSON body with GET request, even when nothing is inputted, this will throw an error on AWS Lambda because it is not allowed according to web standards. |
What version of Hono are you using?
4.3.7
What runtime/platform is your app running on?
Lambda
What steps can reproduce the bug?
Any idea why the GET method doesn't work?
What is the expected behavior?
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: