Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Shopify Functions Input Variables

Shopify Functions Input Variables

sbdev
Shopify Partner
49 0 10

Hello I'm developing the cart and checkout Shopify function and using the variables in input queries
I'm not finding proper documentation, Currently I'm following this documentation https://shopify.dev/docs/apps/functions/input-output/variables-queries
I want the same functionality as in the documentation. Which owner id I should have to pass here?

sbdev_0-1716284925214.png
I have followed these steps as per documentation:
1.

sbdev_1-1716284941877.png

2.

sbdev_2-1716284952744.png

3.

sbdev_3-1716284960543.png

sbdev_4-1716284984442.png

The product is in the collection but I'm not getting true in the response of inAnyCollection
also I have get the metafields in the response you can see the collection values of the metafields

I want to set metafields of collection list for the cart and checkout function in the background, in the app and want to check that metafields in my cart checkout function as a variable
I have followed the documentation proper but not getting correct response
Please suggest me if my doing wrong, and which type of owner id should pass in the metafieldsSet mutation

Reply 1 (1)

Nick_Wesselman
Shopify Staff
171 43 73

Hi @sbdev --

As this appears to be a validation function, the owner would be the validation object.

https://shopify.dev/docs/api/admin-graphql/2024-04/queries/validation
https://shopify.dev/docs/api/admin-graphql/2024-04/mutations/validationCreate

https://shopify.dev/docs/api/admin-graphql/2024-04/mutations/validationUpdate

 

If you create a UI extension for your validation, you can add the metafield within that as well.

 

-Nick

Nick Wesselman | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog