fix: Add super calls to GraphqlTrace #1090
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Oops -- these trace modules are supposed to call
super
, where other trace modules may add instrumentation. (Calling&block
hands control to GraphQL-Ruby, but skips other trace module code.)My guess is that these weren't converted to
super
when this module was migrated off of GraphQL-Ruby's ownPlatformTrace
module which worked differently (or used to have this same bug?).Fixes rmosolgo/graphql-ruby#5044
TODO:
Along the way, I found an issue with how GraphQL::Ruby handlesNever mind, I think I misunderstood because of the ivar reset-related code in the test suite. When I modified my test to use a "fresh" schema class (and manually re-call the setup code), the test failed as expected, then passed when my patch was applied. So I think this is ready to go as-is.GraphQL::Schema.trace_with(trace_mod)
when subclasses already exist and those subclasses have already received.trace_with(...)
calls of their own. I'm trying to work that out in Fix default traces added to parent classes after default traces added to child class rmosolgo/graphql-ruby#5045, but that issue is making this test fail (I think...)