You can never say never, but this one you cannot avoid

HunkyBill
Shopify Expert
4359 36 462

There will never be a time when the legacy resource ID is not the same as the one embedded in the GraphQL format.

If a product has the ID 2486162456634 and that is how RestAPI deals with it, we know the GraphQL gid will always be dealing with the same number too. So we can make a mapping function that converts between them.

So Shopify has their legacy resource ID and admin_graphql_api_id but all those are just cruft.

If they were to dare try and monkey with the ID all Apps would essentially break, and there can be no future without the past. So I am now totally comfortable just hawking these back and forth with helpers.

Whoever wrote that line "don't trust this ID being the same in GraphQL" was high as a kite and clearly writing that for giggles.

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes