graphql-middleware: Bug: "applyMiddleware" updates the schema rather than replacing

The cause is where addResolveFunctionsToSchema from graphql-tools is used which is actually updating the schema rather than replacing it, causing continues re-wrap of middleware on resolver when it is called and this in turn makes queries against the schema slower and slower.

showcase: https://github.com/gdeividas/graphql-middleware for demonstration run:

yarn
npx tsc && npx ava dist/test/showcase.test.js

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 4
  • Comments: 16 (5 by maintainers)

Commits related to this issue

Most upvoted comments

This probably should not be closed by the bot as its still relevant.

I’ve just noticed this issue could be fixed by updating graphql-tools to the newest version, but it drops support for node 10.17.0 or lower.