graphql-ruby icon indicating copy to clipboard operation
graphql-ruby copied to clipboard

Graphql 2.4.12 introduces a breaking change for graphql-hive

Open desheikh opened this issue 1 year ago • 2 comments

Describe the bug

The change adding a required timeout property in version 2.4.12 breaks graphql-hive because of it usage of the Visitor class here

Versions

graphql version: 2.4.12 graphql-hive: 0.5.4

Based on the code it looks like timeout can be nil. If this is considered a public interface, can we change the interface to default timeout to nil, so it's backwards compatible.

def initialize(query:, analyzers:, timeout: nil)

desheikh avatar Mar 13 '25 20:03 desheikh

Closing as this is being fixed downstream in graphql-hive.

desheikh avatar Mar 13 '25 20:03 desheikh

Hey, sorry for the trouble on this! I definitely didn't imagine that there would be direct calls to Analysis::Visitor in the wild. The intended public API here is Analysis.analyze_multplex and Analysis.analyze_query. If you need to, you can detect this new "feature" downstream with:

GraphQL::Analysis::Visitor.instance_method(:initialize).parameters.size 
# => 2 or 3

Let me know if I can help with anything as you address the issue :+1:

rmosolgo avatar Mar 14 '25 10:03 rmosolgo