go-graphql-subscription-example icon indicating copy to clipboard operation
go-graphql-subscription-example copied to clipboard

[object Object] when more than one operation in graphiql

Open kivutar opened this issue 7 years ago • 4 comments

How to reproduce:

dep ensure
go build && ./go-graphql-subscription-example

Navigate to localhost:8080

Execute:

subscription onHelloSaid {
  helloSaid {
    id
    msg
  }
}

Result:

screen shot 2018-08-11 at 12 28 56 pm

kivutar avatar Aug 11 '18 05:08 kivutar

More info: to reproduce, you need to add more than one operation in graphiql:

subscription onHelloSaid {
  helloSaid {
    id
    msg
  }
}

mutation SayHello {
  sayHello(msg: "Ola") {
    id
    msg
  }
}

Your code works well with a single operation.

kivutar avatar Aug 11 '18 05:08 kivutar

Hi @kivutar, thanks for bringing this up. I believe this is an issue with the version of apollographql/subscriptions-transport-ws, which is the client this example uses to enable graphiql to work with subscriptions.

Thoughts?

p.s. Sorry for the slow reply, I went on a long break but I'm now back :)

matiasanaya avatar Sep 20 '18 08:09 matiasanaya

Was any solution found for this issue?

I will be glad to get feedback.

Thanks

smithaitufe avatar Mar 30 '19 21:03 smithaitufe

Hi @smithaitufe, this issue was reported in the corresponding library here and I added a pull-request to fix it, but it hasn't been merged.

In the mean time you can avoid sending both subscription and mutations / queries in the same document and the example should work just fine. Alternatively you can use a different client that might not have this issue.

Hope this helps :)

matiasanaya avatar Mar 31 '19 21:03 matiasanaya