-
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
fix(fastify): return reply object from async handlers #6798
Conversation
|
✅ Deploy Preview for apollo-server-docs canceled.Built without sensitive environment variables
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit ef350dc:
|
Not sure how to add a changeset, doesn't seem set up? $ npx changeset
npm ERR! could not determine executable to run
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/simen/.npm/_logs/2022-08-11T11_38_58_808Z-debug-0.log |
We've come to the conclusion that supporting Fastify v3 and v4 in the same release of apollo-server-fastify is not feasible (#6576 (comment) and some other comments). The forthcoming AS4 disentangles the precise versions of web framework integrations from Apollo Server's own version and should make supporting any Fastify version easy. (It will also allow us to hand off maintenance of the framework integration to people who actually use Fastify in any context other than trying to evaluate PRs like this one.) (Also, we're not using changeset yet on Is this PR also helpful for Fastify v3 users? |
Yes, making sure to return So while I don't think this is necessary for |
Reviewing this is on my todo list, but every time I review a Fastify PR I basically have to re-learn how Fastify works from scratch (which is why we're passing that responsibility over to community members who actually use Fastify as part of AS4). But yes, high on my todo list, and certainly the contributor's reputation makes me suspect it will be fine :) |
5f72a7e
to
ef350dc
Compare
Published in v3.10.2. |
Thanks! ❤️ |
Should this theoretically enable support for Fastify v4? I am getting this error with the newest version: Does something else need to be upgraded in the |
This is the only code change needed, but you also need to update the deps (which would be a breaking change, so won't happen in this repo). With yarn 2 or 3 like {
"resolutions": {
"apollo-server-fastify/@fastify/accepts": "^4.0.0",
"apollo-server-fastify/@fastify/cors": "^8.0.0"
}
} I have no idea how to do it for npm or pnpm, but there are probably ways (npm use |
yes, as mentioned above (#6576 (comment)), we can't support multiple incompatible versions of Fastify from the same major version of the same apollo-server-fastify package. We are fixing this by decoupling "apollo server package version" from "apollo server web package X integration package version" in AS4 but will not be fixing it for AS3. |
For anyone interested that works with npm to add Fastify v4 support. I had to add this to my package.json, and then I ran
|
I'm trying to use this module with
fastify@4
, but we never got a response. Adding thereturn
statements fixed that issue. It's somewhat mentioned in the migration guide (https://medium.com/@fastifyjs/fastify-v4-ga-59f2103b5f0e).Note that this also works in fastify 3