Skip to content
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

Merged
merged 2 commits into from
Apr 18, 2018
Merged

Use a named function for the middleware over an anonymous #827

merged 2 commits into from
Apr 18, 2018

Conversation

oliviertassinari
Copy link
Contributor

Copy link
Member

@abernix abernix left a 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 {
Copy link
Member

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?

oliviertassinari and others added 2 commits April 17, 2018 22:59
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
@abernix abernix merged commit f8ca710 into apollographql:master Apr 18, 2018
@oliviertassinari oliviertassinari deleted the patch-2 branch April 18, 2018 07:48
@abernix
Copy link
Member

abernix commented Apr 18, 2018

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!

@oliviertassinari
Copy link
Contributor Author

Thanks!

@abernix
Copy link
Member

abernix commented Apr 18, 2018

This should be published in 1.3.5. Please report back how it works!

ShiyamRajan pushed a commit to ShiyamRajan/apollo-server-lambda that referenced this pull request Nov 2, 2018
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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants