Skip to content

Conversation

@humphreyja
Copy link

@humphreyja humphreyja commented Dec 20, 2025

Addresses #5488

The change is simple, if the payload type allows to be null then the initial subscription response returns nil instead of "nothing". This also changes the docs to have users use the type declaration instead of the payload_type to be more in alignment with mutations and resolvers. Backward compatibility can be achieved by adding the null false attribute back into their subscription base class and continuing to use the payload_type. Though I would think it would be smart to make that explicit in your codebase and have your declarations be the same as your mutations and resolvers.

Backward compatibility

class BaseSubscription < GraphQL::Schema::Subscription
  null false # add this to use the same null default as before
end

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 this pull request may close these issues.

1 participant