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

Upgrade to 2.3.8 breaks subscriptions in the schema #5017

Closed
aub opened this issue Jul 15, 2024 · 3 comments · Fixed by #5019
Closed

Upgrade to 2.3.8 breaks subscriptions in the schema #5017

aub opened this issue Jul 15, 2024 · 3 comments · Fixed by #5019

Comments

@aub
Copy link

aub commented Jul 15, 2024

Describe the bug

I've upgraded to 2.3.8, and after doing so I started getting errors when trying to use the introspected schema for type generation in my react app. The error it's giving me is:

✖ Unable to find root schema type for operation type "subscription"!

I did some debugging to see what's being returned in the introspection query, and the things at the top of the response have changed from this:

{"__schema"=>{"queryType"=>{"name"=>"Query"}, "mutationType"=>{"name"=>"Mutation"}, "subscriptionType"=>{"name"=>"Subscription"} ....

to this

"__schema"=>{"queryType"=>{"name"=>"Query"}, "mutationType"=>{"name"=>"Mutation"}, "subscriptionType"=>nil

Note the change to "subscriptionType" => nil. I haven't changed anything in my code, only updated the version of the gem. My app does include subscriptions, with a base type like this:

module Types
  class SubscriptionType < GraphQL::Schema::Object
    field :all_articles, subscription: Subscriptions::AllArticlesSubscription, null: true
    .....
  end
end

And this is included in the schema like so:

subscription(Types::SubscriptionType)

Versions

graphql version: 2.3.8

rails (or other framework): 7.1.3.4

@rmosolgo
Copy link
Owner

Derp, so sorry! This is due to a typo here: https://github.com/rmosolgo/graphql-ruby/pull/4998/files#diff-1665674fd4d2e7c4ad535e2ed497fca9f91f41902c382a1c3c9a5a3d4ed32aafR53

Thanks so much for reporting this issue. I'll work up a patch and release soon.

@rmosolgo
Copy link
Owner

I just shipped 2.3.9 with a fix for this issue. Thanks again for reporting it and please let me know if it gives you any more trouble!

@aub
Copy link
Author

aub commented Jul 15, 2024

@rmosolgo nice, thanks for the updates and for getting it fixed!

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

Successfully merging a pull request may close this issue.

2 participants