You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when a subscription is resolved, we have no way of ignoring events for individual subscriptions.
This would be useful to avoid notifying clients when:
they don't care about the event (e.g. because they chose not to receive them)
the event doesn't concern them (e.g.because they don't have sufficient permission).
For example, consider this subscription:
field:foo,:stringdoarg(:key,non_null(:string))config(fn%{key: key},_->{:ok,[topic: key]}end)resolve(fnpayload,_,%{context: %{user_id: user_id}}->ifshould_user_receive_event?(user_id,payload)do{:ok,payload}else# Here it would be nice to be able to "cancel" the event push for this particular user.# Maybe using a specific return value like :ignore or something.{:ok,nil}endend)end
I'm writing here because of your comment on my PR #1309. I must have missed the error in the playground because I didn't have it in the graphql document, so it looked like it was only sending the null without information about the error.
You also wrote that you had a plan for this in mind using a special return value, I would be happy to take a stab at implementing that if you could give me a couple pointers on what your where thinking.
Hello there!
Currently when a subscription is resolved, we have no way of ignoring events for individual subscriptions.
This would be useful to avoid notifying clients when:
For example, consider this subscription:
Related request: #365 (comment)
The text was updated successfully, but these errors were encountered: