I'm currently working on a project where I need to create a metafield for a Shopify product so I can access the data from my Liquid file. I'm trying to achieve this from the create action of a separate model named rs-product-video.
However, I'm encountering an error when testing my API call in the API Playground. Here’s the code I'm using: await api.shopifyProduct.update(productId, { metafields: { namespace: "custom", key: "hasVideos", value: videoCount > 0, type: "boolean" } });
And the error I receive is:
{ message: "The action update on model shopifyProduct does not have an api trigger and cannot be called from this api client. If you are the developer of this application and want api clients to call this action add an api trigger to the action. For more information see: https://docs.gadget.dev/guides/actions/triggers", stack: "Error: The action update on model shopifyProduct does not have an api trigger and cannot be called from this api client. ..." }
Could someone please guide me on how to resolve this issue? I want to ensure that the metafield can be created and accessed correctly. Thank you!