Open kleydon opened 2 years ago
Please share a minimal and clear reproduction on CodeSandbox or StackBlitz
Yes, I am also facing this issue. made sure the body-parser
is working. but still the same issue. it's working with only url params. for me, I was using v0.15.0
.
I'm facing the same issue, too. I have tried it with version 0.15.1.
Same issue here.
Seems like POST routes doesn't accept Content-Type: application/json
as a header, only Content-Type: text/plain
I've run into this issue while integrating SOFA with Nest. Disabling bodyParser
on app instance actually solved the problem.
After upgrading from Sofa v0.11.2 to v0.12.0, parameters provided in the body of my REST requests are no longer found/recognized by SOFA's auto-generated REST API. If I switch back to SOFA v0.11.2, my requests work again.
For example, my login request
http://localhost:2020/auto-rest/auth-login-by-phone
, made with the body:{ "phone": "+12676146833" }
yields the error:It doesn't matter whether I'm running on
localhost
on a MacBook (http) or ongcloud run
(https); it doesn't matter whether I make the request via Postman or via a Swagger REST UI - the error is consistently the same. The error occurs in response to multiple requests with body parameters (that correspond to mutations).When I examine the request (above), as received by the
context
function provided to myuseSofa()
function (below), the request DOES (at this point) contain the expectedstring
value forphone
;{ "phone": "+12676146833" }
Some additional context:
The relevant portion of my GraphQL Schema:
My
authLoginByEmail()
resolver, created usingtype-graphql
:I've looked through the release notes for v0.12.0, and don't yet see anything that would need to change in my code, between v0.11.2 and v.0.12.0 - but perhaps I'm wrong? If you have any recommendations - or know how I could debug further "downstream" than the body of the context function, (mentioned above) - I'd love to know about it. It does seem like this is a bug though, from what I can see so far.