Closed gastonmorixe closed 4 years ago
Oh, that's unfortunate. I will investigate how to work around it the next week. Thank you for the report!
@Envek pushed a PR, works for me but it's not clean, let me know your thoughts! thanks
I ended up not using this because it's hard to set up in Heroku but I hope it helps to fix this issue.
I tried to upgrade one of my application to GraphQL-Ruby 1.10 and it works well without any changes to graphql-anycable. Can you please share how do you use your subscriptions and what isn't working?
Namely:
GraphqlChannel
looks like?I will try to reproduce and investigate further.
I used the new interpreter/runtime.
Have you added following extend
to your root Subscription
type?
extend GraphQL::Subscriptions::SubscriptionRoot
As per https://github.com/rmosolgo/graphql-ruby/issues/2727#issuecomment-584870542
When I started to add testing for interpreter runtime, specs failed.
What is helped to fix them is to redefine subscription resolver methods as per https://github.com/rmosolgo/graphql-ruby/issues/2754#issuecomment-587557702
class SubscriptionType < GraphQL::Schema::Object
extend GraphQL::Subscriptions::SubscriptionRoot
field :product_created, Product, null: false, resolver_method: :default_resolver
field :product_updated, Product, null: false, resolver_method: :default_resolver
def default_resolver
return object if context.query.subscription_update?
context.skip
end
end
Closing as it works in production apps and tests also pass. If you find any issues, feel free to open new issue with reproduction steps, schema and so on.
I just created why here rmosolgo/graphql-ruby#2692