-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Server crashes on every calls when extension returns a promise #2038
Comments
Am I the only one in need of async actions in extensions? |
✋🏻In need too |
Yes, facing the same issue. |
Actually this bug prevents us to use Apollo Server. We have the following case: for some queries we want to have export files that contains the same data as result of the query. To send export file I spent entire day to find workaround but failed. Any suggestions? @nick-keller what about adding label |
✋🏻 it would be very useful for us also! We have a use case in which we need to do some async post procesing in willSendResponse. Is there any workaround? |
✋🏻 Same here |
This is supported by the new request pipeline plugin API. The The new API (which can be utilized by providing While the new API is still growing, the documentation is taking form in #2008 (there's a preview link on that PR so you can view them in a more glorious form than the raw markdown) and building out the API further is on our roadmap for Apollo Server 3.0, as noted in #2360. I'll close this, but if you take a look at the documentation and the source types in In the case of apollo-server/packages/apollo-server-plugin-base/src/index.ts Lines 62 to 67 in d1a0d16
I didn't finish writing the text blurb for |
Intended outcome
Returning a promise in the method
willSendResponse
of an extension should be supportedActual outcome
If the method
willSendResponse
returns a promise or isasync
the server crashes on every calls and the client receives the errors:[{"message": "Cannot read property 'errors' of undefined"}]
How to reproduce the issue
Create a simple logging extension for an Apollo server 2:
And the logger:
I'm assuming this is unintended and this sould be an easy fix ;)
The text was updated successfully, but these errors were encountered: