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

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.

Below is my run.graphql file:

Below is Mysql DB variant data:

Please check all and help me to fix this issue.
Thanks.