-
Notifications
You must be signed in to change notification settings - Fork 544
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
fix: adding nested input variables in graphql plugin #720
fix: adding nested input variables in graphql plugin #720
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.
one concern to improve, other than that lgtm
plugins/node/opentelemetry-instrumentation-graphql/src/utils.ts
Outdated
Show resolved
Hide resolved
Force pushed with suggested modification EDIT: |
Please use conventional commits in your PR title as they are used to autogenerate new versions when packages are released. Your current title is not in the correct format and would be ignored, causing the package to not be released. If it is a bugfix that should only modify the PATCH version, please use |
Codecov Report
@@ Coverage Diff @@
## main #720 +/- ##
=======================================
Coverage 96.87% 96.87%
=======================================
Files 11 11
Lines 640 640
Branches 126 126
=======================================
Hits 620 620
Misses 20 20 |
Force pushed to amend commit message and fix linting. |
Thanks. Fixing the commit message doesn't matter as much as the PR title since the commits get squashed anyway and the PR title is used as the commit message. |
GraphQL inputs are frequently nested like: { "input": { "value1": 1, "value2": 2 } } Currently this would result the following call: span.setAttribute("input", Object({ value1: 1, value2: 2})) But since SpanAttribute doesn't accept an Object type it silently fails and doesn't add the attribute at all. This commit goes depth-first into the nested structure and adds each variable with the appropriate path.
Another attempt to fix linting |
Which problem is this PR solving?
GraphQL inputs are frequently nested like:
Currently this would result the following call:
But since
SpanAttribute
doesn't accept anObject
type it silently failsand doesn't add the attribute at all.
Short description of the changes
This PR goes depth-first into the nested structure and adds each
variable with the appropriate path like: