Title
m

Max N.

10/14/2017, 10:30 PM
a question about websocket subscriptions - thank you so much for all your previous help so far BTW! Why does this work?
{
  query: "subscription watchPosts{Post(filter: {mutation_in: [CREATED, UPDATED, DELETED]}){updatedFields node{title}}}"
}
but this does not:
{
  "variables": {
    "filter": {
      "mutation_in": [
        "CREATED",
        "UPDATED",
        "DELETED"
      ]
    }
  },
  "query": "subscription watchPosts($filter: PostSubscriptionFilter!){Post(filter: $filter){updatedFields node{title}}}"
}
Both return with an OK response but only the first one gets notified on changes.
assume this is the
payload
content on a websocket body and that
id
is set correctly
a

agartha

10/14/2017, 11:14 PM
I have done some variations on this, but I can't get a single subscription with variables working...
m

Max N.

10/14/2017, 11:25 PM
interesting … I have also have a scaphold API so I might check if it is specific to graph cool, thank you for testing it though, @agartha
👍🏻 1
@agartha yea so on scaphold it works, they still use the old
graphql-subscriptions
protocol vs.
graphql-ws
. I am wondering if this is just with graph.cool. I will take a look at another server
a

agartha

10/15/2017, 12:49 AM
String to enum coercion is specific to the server-side implementation. Also, it works for queries and mutations. So I'm almost 100% sure it's something they need to do server-side to make this work.
n

nilan

10/15/2017, 8:43 AM
@Max N. @agartha could you please share a reproducible example of a subscription not working here: https://github.com/graphcool/graphcool/? 🙂