Skip to content

Edge case with multiple subscriptions to same query #45

@darrenclark

Description

@darrenclark

I noticed subscribing to the same GraphQL query twice causes some interesting behaviour. Specifically this happens:

  1. client subscribes twice to the exact same query, gets back two responses with same subscriptionId, i.e. "subscriptionId":"__absinthe__:doc:116039402"
  2. client receives two subscription:data events (as I'd expect) when changes are published
  3. unsubscribing once causes no more subscription:data events for that query, even though I have one "active" subscription

I was wondering what the expected behaviour is? I can try to take a stab at fixing it

Personally, I think it would make sense to require unsubscribing twice (i.e. each doc event for a single query should be paired up with a unsubscribe event)

Thoughts?

banners_and_alerts_and_dark_websocket_terminal

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions