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

SimplePerformantInstrumentation tags all Union'd result types instead of concrete resolved type #3417

Open
alexanderbaumann-toast opened this issue Jan 19, 2024 · 2 comments
Labels

Comments

@alexanderbaumann-toast
Copy link

Describe the bug

(This may be an issue with our implementation, but I'm having issues finding where this is happening or solutions in the documentation)

We have implemented SimplePerformantInstrumentation.instrumentExecutionResult to tag all resolved types, and then we post the tags to Datadog. This is helpful for us to know which results are being returned from our graph.

But if we have a union of types, then all union'd types are tagged instead of the concrete resolved type.

To Reproduce

  • Create a union of different types and a query (union UnionBarBaz = Bar | Baz)
  • Query the union'd type
  • See all union'd types are tagged
image
@dondonz dondonz added the keep-open Tells Stale Bot to keep PRs and issues open label Feb 11, 2024
@bbakerman
Copy link
Member

Yeah so you challenge is this

You are coming in at the end of the processing to tag data and a field has a union type but fact that the graphql.schema.TypeResolver has resolved non concrete types to concrete types has been lost

the only way I see forward for you would be this

  • use graphql.schema.idl.WiringFactory#getTypeResolver(graphql.schema.idl.InterfaceWiringEnvironment) to provide a type resolve that can record somewhere that the resolved types are -
  • probably put that into GraphQLContext - probably under file type + field name say in a map
  • Then in your in instrumentResult - look in the GraphQLContext for the values you recorded earlier

@dondonz dondonz removed the keep-open Tells Stale Bot to keep PRs and issues open label Feb 16, 2024
Copy link

github-actions bot commented May 5, 2024

Hello, this issue has been inactive for 60 days, so we're marking it as stale. If you would like to continue this discussion, please comment within the next 30 days or we'll close the issue.

@github-actions github-actions bot added the Stale label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@bbakerman @dondonz @alexanderbaumann-toast and others