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

No metrics appeared on graphql version "1.12.21" with deprecated behaviours. #7

Open
ngergis opened this issue Feb 7, 2024 · 1 comment

Comments

@ngergis
Copy link

ngergis commented Feb 7, 2024

Hi There,

I tried to use yabeda-graphql and yabeda-prometheus on ruby on rails application with graphql. The problem is there is no grapphql metrics appears.

I am using graphql version "1.12.21" but when it is upgraded from "1.10.9" to "1.12.21", there was problem of deprecated behaviours, for that reason we added these 2 lines to our schema as workaround till we rework all deprecated code:

use GraphQL::Execution::Execute
use GraphQL::Analysis

When I tried to use graphql "1.10.9" and remove those 2 lines, the yabeda-graphql works and start to add graphql metrics from running queries.

My Question: Do you think there is an workaround that makes it works without downgrade graphql?
I am not familiar about exactly what these 2 lines do and why they cause that issue. Appreciate your help!

Thanks!

@Envek
Copy link
Member

Envek commented Feb 8, 2024

That's weird. It seems that you upgrade to 1.12 and then switch off newer Interpreter mode (which became the default in 1.12) and using legacy executor instead (the same is in 1.10). yabeda-graphql worked both with and without interpreter, but we stopped to test against non-interpreter mode a while ago.

I can confirm that adding these two use directives makes yabeda-graphql tests to fail. So at least it is reproducible.

Use following command to run tests against 1.12:

bundle exec appraisal graphql-1.12 bundle exec rspec

However, I'm not sure what is the reason for this failure.


You can try from the opposite and explicitly enable newer Interpreter mode in Graphql-Ruby 1.10 by adding following directives to your schema:

use GraphQL::Execution::Interpreter
use GraphQL::Analysis::AST

and then fix your deprecations and then update to 1.12 (removing these use lines).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants