maticzav / graphql-middleware

Split up your GraphQL resolvers in middleware functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

High memory and CPU usage with a noop graphql-middleware

amitgud-doordash opened this issue · comments

We are experiencing very high memory usage when we add even a noop middleware to our express Apollo GraphQL application. Do we have an idea of what memory / CPU overhead we should expect with the graphql-middleware? Using the latest version (6.0.10).

Screen Shot 2021-07-09 at 10 38 10 AM

Just add some more color to this issue. The schema in the application is big, however the middleware itself is not going anything interesting.

+const noopMiddleware = async (
+  resolve: any,
+  root: any,
+  args: any,
+  context: Context,
+  info: any
+) => {
+  return await resolve(root, args, context, info)
+}