To apply your solution, I created the following GraphQL mutation, but it seems the filter parameter is mandatory:
mutation addSegmentJoinedWebhook {
webhookSubscriptionCreate(
topic: CUSTOMER_JOINED_SEGMENT
webhookSubscription: {
callbackUrl: "<MY_URL>"
format: JSON
}
) {
webhookSubscription {
id
}
userErrors {
message
field
}
}
}
Result:
{
"data": {
"webhookSubscriptionCreate": {
"webhookSubscription": null,
"userErrors": [
{
"message": "The specified filter is invalid, please ensure you specify the field(s) you wish to filter on.",
"field": [
"webhookSubscription"
]
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 10,
"throttleStatus": {
"maximumAvailable": 2000,
"currentlyAvailable": 1990,
"restoreRate": 100
}
}
}
}
Could you guide me on which fields I need to include for the filter parameter? Also tried to add by remix app like this but same error occurred.
...
webhooks: {
CUSTOMER_JOINED_SEGMENT: {
deliveryMethod: DeliveryMethod.Http,
callbackUrl:
"<MY_URL>",
},
},
hooks: {
afterAuth: async ({ admin, session }) => {
shopify.registerWebhooks({ session });
})
},
...
[shopify-app/ERROR] Failed to register webhook | {topic: CUSTOMER_JOINED_SEGMENT, shop:
a2-han-test.myshopify.com, result: {"data":{"webhookSubscriptionCreate":{"userErrors":[{"field":["webhookSubscription"],"message":"The
specified filter is invalid, please ensure you specify the field(s) you wish to filter
...
Additionally, where can I find the document referenced in your screenshot? The documentation I referred to was this one, but it does not mention any restrictions. It seems the documentation requires an update.