Send Webhook to graphql

Send Webhook to graphql

webhook_flow_Ad
Shopify Partner
3 0 1

Hey,

I'm following the Shopify instructions for adding a new trigger in shopify-flow.

Webhook Endpoint: https://{SHOP}/admin/api/graphql.json

Payload: mutation {
  flowTriggerReceive(body: "{
    "trigger_title": "Review Created",
    "resources": [
        {
            "name": "",
            "url": ""
        }
    ],
    "properties": {}
}") {
    userErrors {field, message}
  }
}

I'm using Insomnia app, url:  https://example.myshopify.com/admin/api/graphql.json, Post

Payload:

mutation
{
    flowTriggerReceive(body:"{
    "trigger_title": "Review Created",
    "resources": [
        {
            "name": "John Doe",
            "url": "http://www.example.com/customers/20185"
        }
    ],
    "properties": {
        "Customer email": "[email protected]",
    }
    }") {
    userErrors {field, message}
    }
}
 

Got "200 OK", but with this error:

{
    "errors": [
        {
            "message": "Parse error on \"query\" (STRING) at [1, 2]",
            "locations": [
                {
                    "line": 1,
                    "column": 2
                }
            ]
        }
    ]
}

 

Please help?

Replies 3 (3)

aroggio_at_dbs
Visitor
1 0 0

Did you resolve this issue? I have a very similar issue trying to create a product.

frustratedswede
Visitor
3 0 0

Do you mind sharing how you implemented your custom trigger so that it grabbed in the first place? Been looking for two days and am unsure of where/how to call on the created custom trigger.

JohnAtBonify
Shopify Partner
136 7 34

@frustratedswede Just curious, what business problem are you trying to automate? I might have a substantial shortcut for you.