calling in the playground: ```subscription{ game...
# prisma-whats-new
m
calling in the playground:
Copy code
subscription{
  game{
    mutation
    node{
      id
    }
  }
}
with backend resolver implementation
Copy code
game: {
    subscribe: async (parent, args, ctx, info) => {
      return ctx.db.subscription.game({}, info)
    }
  }
gives
Copy code
Request to <https://eu1.prisma.sh/>...
query:
subscription ($_where: GameSubscriptionWhereInput) {
  game(where: $_where) {
    mutation
    node {
      id
    }
  }
}
operationName: null
variables:
{}
in the backend console. When I create a new game, nothing happens
m
Apparently, there is a bug related to handling the 'where' clause. Does it work if you remove it?
m
I'm not using the where clause, the last block of code is just the local dev server console output.
m
My bad. I just noticed that.
m
No prob, thanks for taking a look ๐Ÿ™‚
m
What if you remove the 'mutation'?
m
Same scenario...
m
Hmm... sorry, friend. Subs seem pretty messed up at the moment across the board.
n
@Moritz can you please share a repo with the non-working subscription on Github?
m
@nilan Sorry I can`t, its not open source... Do you have a working example which I could take a look at? I could recreate my situation in a seperate project if this does not help... I basically have defined the simplest possible subscription, like in the airbnb clone sample. https://github.com/graphcool/graphql-server-example/blob/master/src/resolvers/Subscription.ts Is there anything particual in the config I should be aware of? Is it normal for a subscription in the playground to only show the loading icon and no response?
n
please use this subscription client instead and let me know if it works: https://gist.github.com/marktani/5df524523693c88be425bfb623ca8b8a
you need to make a few adjustments ๐Ÿ™‚
m
@nilan Ok, I checked and the issue can be recreated using the https://github.com/graphcool/prisma/tree/master/examples/subscriptions deploying on the public cluster and using the playground for testing. (Btw, the documentation of the sample contains a series of errors in the mutations, they are more complex than the datatypes in the schema). The subscription in the playground does not fire. Ill check using the subscription client.
@nilan The subscription throws an error for me.:
Firefox canโ€™t establish a connection to the server at <wss://eu1.prisma.sh/public-scarlettaker-482/subscriptions-example/dev>.
I double checked the tokens and all. Ill create a git repo so you can reproduce...
@nilan Here you go... https://github.com/moritzmorgenroth/prisma_subscription_issue It is a simple clone of the example you referenced using a prisma deployment in the public cloud. The subscription client with the app credentials is in the root.
Thanks for you help
n
can you add a set of mutations/subscriptions that I need to run to reproduce this? I just cloned the repo.
m
I added reproduction instructions in the beginning of the readme
Let me know if it works or if you need more info. Thx!
n
I can reproduce this too, thanks for your help! I'll post an update to Github soon.
m
Thx, I would appreciate if you keep me updated on any progress!
n
Please track this issue for updates: https://github.com/graphcool/prisma/issues/1989 ๐Ÿ™‚
m
Perfect, thanks!