Thanks, though I think I should have been clearer about what’s currently missing in the webhook system.
Right now, as a third-party app, we don’t receive any webhook update for publications when publishing changes are made to the online store. According to the webhook docs this is intended behavior, but since our customers need that functionality, we’re stuck building cumbersome workarounds.
If this could be included in the event system so that we’d receive these events, it would make a real difference for us. Hope I’m not coming across as pushy with all these requests, we’re just excited about what the new event system could bring and how much friction it could remove from our current integration.
Given Events is a net new system, I wouldn’t compare Webhooks to Events 1:1 (outside of parity / topic coverage) - though I totally hear you out on the issue and I’ve marked it for when we come around to doing Publication topic(s)
I hope this opens up a new path for other webhooks, such as inventory_levels, which have been ignored even though the data model has evolved a lot. I’d love to see new fields like incoming, committed, on_hand, etc. via Events.
While I can’t confirm on Harshdeeps/Shopify’s behalf, but now that Events allow you to specify a query, I imagine you will be able to retrieve those inventory level fields, see the example in the original post:
query = """
query priceSync($productId: ID!, $variantsId: ID!) {
productVariant(id: $variantsId) {
id
price
compareAtPrice
sku
}
product(id: $productId) {
id
title
status
}
}
@Luke is correct - when we come around to doing Inventory series of topics, you will be able to trigger on fields and craft your query to include incoming / committed / on_hand / etc fields in Event payloads.
The query you write in Event subscriptions is a regular Admin API GraphQL query and run by the same engine, so the behavior is consistent across the board^
I tested this on 29 July to receive an event on variant price change and it worked fine but today it isn’t sending any Product event anymore (confirmed in Partner dev dashboard). Something significantly changed?
[events]
api_version = "unstable"
[[events.subscription]]
handle = "myapp_variant_price_image1"
topic = "Product"
actions = ["update"]
triggers = ["product.variants.price", "product.variants.media"]
uri = "https://example.ngrok-free.app/api/v1/webhooks/nextgen-events"
query = """
query myapp_nge($productId: ID!, $variantsId: ID!) {
product(id: $productId) {
id
title
status
tags
productType
options { name position }
}
productVariant(id: $variantsId) {
id
title
sku
price
selectedOptions { name value }
media(first: 1) { nodes { id } }
resourcePublicationsV2(first: 50) { nodes { publication { id } isPublished } }
}
shop {
metafield(namespace: "myapp", key: "myapp") { value }
}
}
"""
I tried updating the handle → Nothing happened
I tried deleting the subscription block → restart dev server → add the subscription back → restart the server → It worked again.
but will there be added new triggers/fields changed to the current ones
Good question! Our current focus is expanding topic coverage with trigger lists that cover the cases we expect most developers to need most of the time, to ensure Events can be on a stable API version as soon as possible.
Once we have stronger coverage across topics, we’ll keep revisiting the trigger lists and expanding them based on developer feedback, real usage patterns, and how the GraphQL schema evolves
Is there any information regarding timings on when event payloads will be delivered? whilst testing there seems there can be several minutes from a change and when the payload is delivered and it seems to occur in batches, can you share more information regarding how this is expected to work?
Also, for the new metafield triggers, it would be good if we can set a trigger on any metafields change, or just on a namespace etc rather than listing every single metafield, we allow merchants to use keys of their own choice (under a specific namespace) but would like to keep this in sync still.
Further, it would be really good if we can create event listeners via graphql rather than using CLI as we don’t want to sync everything for all merchants, so we can listen for changes for specific merchants only who are on specific plans, this will also allow us to address the dynamic metafield key issue above as we can update this as merchants make changes in the app.
Is there any information regarding timings on when event payloads will be delivered? whilst testing there seems there can be several minutes from a change and when the payload is delivered and it seems to occur in batches, can you share more information regarding how this is expected to work?
Can you share some more information on what your subscription looks like? I’ll also drop in a DM so you can share some identifiers like your App ID and .myshopify.com URL and we can investigate this.
Also, for the new metafield triggers, it would be good if we can set a trigger on any metafields change, or just on a namespace etc rather than listing every single metafield, we allow merchants to use keys of their own choice (under a specific namespace) but would like to keep this in sync still.
We’re still in unstable and rolling out features as we go, I’ll take this feedback for the team^
Further, it would be really good if we can create event listeners via graphql rather than using CLI as we don’t want to sync everything for all merchants, so we can listen for changes for specific merchants only who are on specific plans, this will also allow us to address the dynamic metafield key issue above as we can update this as merchants make changes in the app.
This is already on our roadmap - we know being able to subscribe to Events via GraphQL mutations is an absolute must and are working on it
@Harshdeep-Shopify thank you - so no hope that derived fields will ever trigger an event? It’s a problem today, as I mentioned above it’s updated after the webhooks fire, still being on dev preview I was hoping that there is a chance that the new event system would take it into account.