-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a named function for the middleware over an anonymous #827
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this!
@@ -36,7 +36,7 @@ export function graphqlExpress( | |||
); | |||
} | |||
|
|||
return (req: express.Request, res: express.Response, next): void => { | |||
return function graphql(req: express.Request, res: express.Response, next): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to call this graphqlExpressHandler
?
It's making the investigation of performance issues easier.
As originally reported in [0], this should make debugging performance issues easier, since the name of the function will be properly displayed/shown in flame-graphs. [0]: #827
I've gone ahead and extended this (in 7d7aceb) to be a consistent pattern across the various middleware variants (Express, Koa, etc.) and also included the GraphiQL middlewares too. Thanks for opening this originally! |
Thanks! |
This should be published in |
As originally reported in [0], this should make debugging performance issues easier, since the name of the function will be properly displayed/shown in flame-graphs. [0]: apollographql/apollo-server#827
It's making the investigation of performance issues easier.
New Relic
Chrome Dev Tool (express-graphql but I'm considering moving to apollo-server)
Related to: