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
Tracing inconsistency #3393
Comments
It might be as simple as not calling |
Thanks for reporting this -- I agree it would be better if it was consistent!
I believe it -- since execution will eventually call some other method that causes the query to prepare its AST. |
eapache
added a commit
to Shopify/graphql-metrics
that referenced
this issue
Mar 29, 2021
Since rmosolgo/graphql-ruby#3393 it should at least be consistent.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The order of tracing events is inconsistent depending on how you execute a query.
If you instantiate a
GraphQL::Query
with a query string and schema, then call#result
on it, then thelex
andparse
trace events fire outside ofexecute_multiplex
.If instead you call
Schema.execute
orSchema.multiplex
, then thelex
andparse
trace events fire inside ofexecute_multiplex
.This is because
Query
callsMultiplex.run_queries
inside ofwith_prepared_ast
:graphql-ruby/lib/graphql/query.rb
Lines 198 to 200 in 5c3a8ec
Where-as
Schema.multiplex
callsMultiplex.run_all
directly which fires theexecute_multiplex
tracer before it does anything that triggers lexing and parsing.@rmosolgo maybe this isn't technically a bug but it's surprising enough it should at least be called out in the documentation.
Versions
1.12.5, efcedef, probably master
cc @chrisbutcher
The text was updated successfully, but these errors were encountered: