go-graphql-subscription-example
                                
                                 go-graphql-subscription-example copied to clipboard
                                
                                    go-graphql-subscription-example copied to clipboard
                            
                            
                            
                        [object Object] when more than one operation in graphiql
How to reproduce:
dep ensure
go build && ./go-graphql-subscription-example
Navigate to localhost:8080
Execute:
subscription onHelloSaid {
  helloSaid {
    id
    msg
  }
}
Result:
 
                                    
                                    
                                    
                                
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.
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 :)
Was any solution found for this issue?
I will be glad to get feedback.
Thanks
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 :)