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

Add a name to the middleware function #7988

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gsoltis
Copy link

@gsoltis gsoltis commented Nov 15, 2024

This is a small quality-of-life improvement. As the code comment says, some observability/instrumentation libraries rely on Function.name for the name of express middleware to use in a span. @opentelemetry/instrumentation-express is one example.

This PR returns a named function, rather than an anonymous function, and adds a test to ensure that the middleware is named.

@apollo-cla
Copy link

@gsoltis: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Nov 15, 2024

✅ Docs Preview Ready

No new or changed pages found.

Copy link

codesandbox-ci bot commented Nov 15, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants