What's your method for updating the cart transform admin api call?

Hey everyone,

I’m quite new to Shopify functions, I started with the Cart and Validation Checkout and used to use both validationCreate and validationUpdate graphql admin api call.

so the validationCreate helped create the validation and pass the metafield to the function on the extension side, and the validationUpdate helped update the metafield so that it can be reflected when the function is run.

What I noticed on the cart Transform function API side is that there is only a cartTransformCreate API call and nothing more. so in case I would need to update the metafield I can’t run any admin api call.

Is there a solution to this? I was thinking about in case of an update, running the cartTransformDelete and then running again cartTransformCreate. So I would love to know what you guys use in this case when you want to update the metafield for the cartTransform function.

Thanks

Hi @bontalexel31

If you update the metafield (using the standard metafield update mutations),and run the function - are you seeing the correct metafield? You shouldn’t need to delete and recreate the function just to update the metafield.

Hey @Liam-Shopify ,

Thank you for replying, yes this is an angle that I didn’t think of. So, I was able to update the metafield using “MetafieldSets” and using the id of the function as the ownerId inside the variables of the graphql api call. just leaving this is it can helps someone.

Thanks!