Bug: "applyMiddleware" updates the schema rather than replacing
See original GitHub issueThe 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:
- Created 5 years ago
- Reactions:4
- Comments:16 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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.