Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use .trace_with on graphql-ruby 2.3+ #91

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

janko
Copy link
Contributor

@janko janko commented Mar 25, 2024

graphql-ruby 2.3 switched to new module-based tracing, which requires passing a module to .trace_with. This module should then implement instance methods for events it wants to intercept. So basically, instead of a case statement, we now have method calls.

Also, the naming convention for modules within graphql-ruby is "trace", while the legacy classes were called "tracer". So, I chose to name the module Trace as well.

I could have called BatchLoader::GraphQL.trace("execute_field", data) to be more DRY, but I didn't want new API to call into legacy API, so I chose a bit of duplication.

Closes #90

@exAspArk
Copy link
Owner

Awesome! Thanks a lot 🙌

@exAspArk exAspArk merged commit 8664e09 into exAspArk:master Mar 25, 2024
@janko janko deleted the graphql-trace-with branch April 2, 2024 10:29
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incompatibility with graphql-ruby 2.3.x
2 participants