I've been implementing the server using Google Cloud Functions and couldn't get the "Roll your own" webhooks to work as it shows in the docs.
After a lot of debugging and looking at the source code I found the function that syncDocument returns needs to be passed a WebhookData object containing id and updated_at rather than simply id as a string.
I'm happy to create a pull request to update this in the docs?
I'd also be more than happy to make a pull request with a server package for Cloud Functions like there is for Lambda.
I think WebhookData should also be updated to make additional keys optional, that way we wouldn't need to cast it when the function is being called.
One last thing, I think it should explicitly state somewhere in the docs the API version to use when setting up Shopify webhooks and Storefront API to avoid potential errors in the future.
I've been implementing the server using Google Cloud Functions and couldn't get the "Roll your own" webhooks to work as it shows in the docs.
After a lot of debugging and looking at the source code I found the function that syncDocument returns needs to be passed a
WebhookData
object containingid
andupdated_at
rather than simplyid
as a string.As it stands this is the example in the docs:
whereas this is what is required to get it to work
I'm happy to create a pull request to update this in the docs?
I'd also be more than happy to make a pull request with a server package for Cloud Functions like there is for Lambda.
I think
WebhookData
should also be updated to make additional keys optional, that way we wouldn't need to cast it when the function is being called.One last thing, I think it should explicitly state somewhere in the docs the API version to use when setting up Shopify webhooks and Storefront API to avoid potential errors in the future.