My public Shopify app does two jobs:
1. Sync all products on my server using Shopify APIs once while my app is installed.
2. Register product webhooks to keep the product catalog updated at my server
For both above, I am unable to find effective way to keep the collection values to which product belongs.
Kindly suggest if how can I get collection value.
In GQL world, a product has a Collection connection, which by definition reads as: A list of the collections that include the product.
So you can use this connection.
You can learn a lot from right here: https://shopify.dev/api/admin-graphql#top