What is the best way to debug webhook (Serverside ...
# orm-help
c
What is the best way to debug webhook (Serverside subscription: https://www.prisma.io/docs/reference/server_side-subscriptions/overview-to1ahf0ob6)? I've configured one but nothing happens. And I don't know how to have some log/error to understand my mistake.
n
Can you share your prisma.yml? 🙂
And the mutation that is supposed to trigger the subscription
c
Sure! Give me a moment.
Copy code
endpoint: <https://eu1.prisma.sh/julien-delean/ambler-try/dev>
datamodel: datamodel.graphql

subscriptions:
  orderCreated:
    webhook:
      url: <https://xxxx-slack.now.sh>
      headers:
        Content-Type: application/json
        Authorization: fsdkljfskldjfglkjsdfeiuieurkjfkjdwkjflsdjfljkjsdf
    query: |
      subscription {
        order(where: {
          mutation_in: [CREATED]
        }) {
          node {
            id
            name
            vehicle
          },
          mutation
        }
      }
But I don't want to bother you with this. I only wanted to know how to debug this.
n
You can inspect your server logs for when the mutation is coming in
Note that the subscription triggers a POST request. Not sure if your now deployment accepts GET or POST.
c
But I'm using prisma-cloud. Can I access to server logs ?
(with demo server)
n
no, you can't
but you can run it locally in Docker
c
OK I'll try this
Thank you for your help, and your awesome product
n
Cheers! 😊 Feel free to report back with your findings!
👍 1