diff --git a/CHANGELOG.md b/CHANGELOG.md index fa89c494cbb..84280eeb4b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,10 @@ The version headers in this history reflect the versions of Apollo Server itself ## vNEXT -## 3.7.0 (RESTDataSource only) +## v3.10.2 -- [apollo-datasource-rest] Add option `memoizeGetRequests` to disable GET cache [PR #6650](https://github.com/apollographql/apollo-server/pull/6650) and [PR #6834](https://github.com/apollographql/apollo-server/pull/6834) +- `apollo-server-fastify`: Use `return reply.send` in handlers to match the pattern encouraged by Fastify 4 (although [`apollo-server-fastify@3` only works with Fastify 3](https://github.com/apollographql/apollo-server/issues/6576#issuecomment-1159249244)). [PR #6798](https://github.com/apollographql/apollo-server/pull/6798) +- `apollo-datasource-rest@3.7.0`: Add option `memoizeGetRequests` to disable GET cache [PR #6650](https://github.com/apollographql/apollo-server/pull/6650) and [PR #6834](https://github.com/apollographql/apollo-server/pull/6834) ## v3.10.1 diff --git a/packages/apollo-server-fastify/src/ApolloServer.ts b/packages/apollo-server-fastify/src/ApolloServer.ts index dd70b2f2e98..15b0e577fcc 100644 --- a/packages/apollo-server-fastify/src/ApolloServer.ts +++ b/packages/apollo-server-fastify/src/ApolloServer.ts @@ -56,12 +56,12 @@ export class ApolloServer< if (onHealthCheck) { try { await onHealthCheck(request); - reply.send('{"status":"pass"}'); + return reply.send('{"status":"pass"}'); } catch (e) { - reply.status(503).send('{"status":"fail"}'); + return reply.status(503).send('{"status":"fail"}'); } } else { - reply.send('{"status":"pass"}'); + return reply.send('{"status":"pass"}'); } }); } @@ -94,9 +94,11 @@ export class ApolloServer< if (prefersHtml) { reply.type('text/html'); - reply.send(landingPage.html); + return reply.send(landingPage.html); } } + + return undefined; } : undefined; @@ -129,7 +131,7 @@ export class ApolloServer< } reply.status(responseInit.status || 200); reply.serializer((payload: string) => payload); - reply.send(graphqlResponse); + return reply.send(graphqlResponse); } catch (error) { if (!isHttpQueryError(error)) { throw error; @@ -143,7 +145,7 @@ export class ApolloServer< reply.code(error.statusCode); reply.serializer((payload: string) => payload); - reply.send(error.message); + return reply.send(error.message); } }, });