parseShopifyWebhook

tagtree · /shopify·function

Translates a Shopify webhook event into the set of tagtree cache tags that must be invalidated.

Signature

@nordcom/commerce-tagtree
function parseShopifyWebhook(input: ShopifyParseInput<NS, T, Q, E>): string[];

Parameters

NameTypeDescription
inputShopifyParseInput<NS, T, Q, E>

Returns

Array of cache tag strings to invalidate; empty when the topic is not mapped or the entity is absent from the schema.

Example

const tags = parseShopifyWebhook({
    schema,
    tenant: shop.domain,
    topic: 'products/update',
    body: JSON.parse(rawBody) as Record<string, unknown>,
});
for (const tag of tags) revalidateTag(tag);

ShopifyParseInput verifyShopifyHmac

Sourceparser.ts:61Edit the JSDoc directly

On this page