fix: make Tracing::init_trace() void and call on add_action()
#3371
+2
−6
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.
What does this implement/fix? Explain your changes.
This PR fixes a code quality bug where the
do_graphql_requestwas incorrectly being called viaadd_filter()instead ofadd_action().As a result of this change, the
Tracing::init_trace()has been changed from returning afloatunused by the application to returningvoid.This is technically a breaking change, as that method is public, and the Tracing class is not marked
final. However, there doesn't seem to be a way in WPGraphQL to replace this version with an extended version (unlike some other filterable classes).Important
This PR is based on #3368 which should be merged first.Relevant diff for this PR is: 3f0de23Rebased ✔️
Does this close any currently open issues?
Not directly, but if we consider this a breaking change than it's part of #3370 . Converting the entire class to
finalwould be part of that ticket for sure.Any other comments?