enisdenjo / graphql-sse

Zero-dependency, HTTP/1 safe, simple, GraphQL over Server-Sent Events Protocol server and client.
https://the-guild.dev/graphql/sse
MIT License
384 stars 19 forks source link

fix(use/koa): use correct parsed body #87

Closed henrinormak closed 9 months ago

henrinormak commented 9 months ago

Did not notice this with my previous work, but seems like use/koa handler was not using the correct parsed body (it was using the ctx.body alias, which is for the response, not the request) and thus got hung up on waiting for data on the request while some body parser middleware had already consumed it.

Also updated the test to cover it, although not sure whether that aligns with how the test is structured (I can add a dedicated test case if that seems more appropriate). Without the code changes in this PR, the new test would just hang and timeout at 5s.

enisdenjo commented 9 months ago

:tada: This PR is included in version 2.5.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: