apollo-server-fastify warning `beforeHandler` has been deprecated

Created on 6 Nov 2019  ·  6Comments  ·  Source: apollographql/apollo-server

Packages

  • apollo-server 2.9.4
  • apollo-server-fastify 2.9.4
  • fastify 2.10.0

When registering the graphql server with fastify like this:

  const server = new ApolloServer({
    typeDefs,
    resolvers,
    context,
  });
  fastify.register(server.createHandler());

Current behavior

The following warning gets printed to the console:

(node:220) Warning: The route option `beforeHandler` has been deprecated, use `preHandler` instead

Expected behavoir

No warnings get printed to the console.

Simple runnable reproduction

See this Glitch remix

🖇️ fastify

All 6 comments

This is about to become even more pressing for you guys. The first alpha for Fastify v3 is available https://github.com/fastify/fastify/releases/tag/v3.0.0-alpha.1

Fastify v3 removes this deprecated feature -- https://github.com/fastify/fastify/commit/bf95bbf737d98212d4c2249841e2eb16973ab5cf

Any progress on this? I'm assuming its going to be a v3 thing inline with apollo-client's v3 ?

Fastify v3 was released last week https://github.com/fastify/fastify/releases/tag/v3.0.0

Related #4355 and #4356.

Hey guys, waiting this issue to be resolved for so long. Any updates?

Please see the update I just posted on https://github.com/apollographql/apollo-server/pull/4356#issuecomment-677515901 for the availability of the Fastify v3 support on Apollo Server.

Was this page helpful?
0 / 5 - 0 ratings