question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: "applyMiddleware" updates the schema rather than replacing

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
davidgustyscommented, Feb 25, 2019

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

1reaction
BigsonLvrochacommented, Aug 7, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

API Reference: ApolloServer - Apollo GraphQL Docs
A custom resolver that will replace Apollo Server's default field resolvers. ... rather than as a single request object, an error will be...
Read more >
Hot schema reload with Apollo server v2 · Issue #1275 - GitHub
Ideally the schema type definitions stay the same. If the backend endpoints are changing, then updating the data source/connector layer might be ...
Read more >
Apollo Server Express - Playground cannot be reached
Try using 127.0.0.1 instead of localhost. It worked for me. ... Server cannot be reached/no visible schema but still able to execute a...
Read more >
applyMiddleware - Redux
Middleware is less powerful than a store enhancer, but it is easier to write. Middleware sounds much more complicated than it really is....
Read more >
graphql-middleware - npm
GraphQL Middleware is a schema wrapper which allows you to manage ... resolvers }) const schemaWithMiddleware = applyMiddleware(schema, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found