Shopify Function How to get the saved variants ID's from DB

Shopify Function How to get the saved variants ID's from DB

devopskecg
Shopify Partner
3 0 0

Hi,
I am working on the Shopify Public app which will add the discount for each variant, But I am stuck in to fetch the saved variants from the Mysql DB. I have already created the flow to store the variant id from Shopify App Admin. Now just I need to get that stored variants under my product-discount function. 

I have already created the flow with static variant data but now I need to make it dynamic.
Please help me to fix this. 

Check the attached coded structure for batter understanding.

Below is my run.js file where I have created the static flow to add the discount for the variants.
image_2025_04_10T07_46_32_786Z.png

Below is my run.graphql file:
image_2025_04_10T07_47_05_442Z.png

Below is Mysql DB variant data:
image_2025_04_10T07_47_33_660Z.png
Please check all and help me to fix this issue. 
Thanks.

Replies 0 (0)