Graphql api and rest api product_id are different

I am using shopify rest admin api to get a shop’s all product variants (SKU and product_id). I am now converting the rest call to shopify’s graphql endpoint to get the same data, however, the result is different, the graphql api returned different product_id for the same sku. For example, for sku AAAA the returnd product_id is 827xxxxxxxxxx if I use rest admin api, however the same sku, if I use graphql api it returned 4499xxxxxxxxxx as product_id

So why is that? If this is as expected, is there a way to map two product_ids?

The reason is that my system is based on rest api, later I will use product id to get product images/quantities etc, I am afraid that pass in the product_id obtained from graphql api won’t work in my existing rest api (for exampl, use rest api to update inventory, will the product_id returned by graphql api work?)

thanks