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
Return reply from fastify handler #6431
Conversation
Hey @mwoenker thanks for your PR and patience! I thought I saw this brought up somewhere else, but I can't remember whether it was an issue, or on the forums or Discord. (I tried searching each briefly but couldn't find anything.) This change seems simple enough and adds up based on the doc you linked to. @dthyresson any thoughts? |
Do we need to make the change in redwood/packages/api-server/src/requestHandlers/awsLambdaFastify.ts Lines 69 to 78 in 8c6bc8a
|
Thanks @mwoenker Is there a way to test this behavior in Something like:
But for a stream? |
@dthyresson I've pushed a test. It tests to see if the stream is passed to |
@mwoenker thanks for your work here! @dthyresson confirming we don't actually want to add the test here? |
See https://www.fastify.io/docs/latest/Guides/Migration-Guide-V4/#need-to-return-reply-to-signal-a-fork-of-the-promise-chain
This fixes returning a Stream as the body of the response from an api function.