This commit sets the document ID in Sanity for newly created documents to be the same as the ShopifyID.
The only difference between the ID's is the = from the ShopifyID is removed as this fails validation on Sanity's end.
Existing documents are not changed.
Doing this allows us to use the IDFilter when performing a ShopifyProduct query on Sanity using GraphQl with an ID returned directly from Shopify, for example when loading a users checkout.
It would make sense to handle Collection ID's in the same way. Happy to create a PR for that too.
closes #165
This commit sets the document ID in Sanity for newly created documents to be the same as the ShopifyID.
The only difference between the ID's is the
=
from the ShopifyID is removed as this fails validation on Sanity's end.Existing documents are not changed.
Doing this allows us to use the
IDFilter
when performing aShopifyProduct
query on Sanity using GraphQl with an ID returned directly from Shopify, for example when loading a users checkout.It would make sense to handle Collection ID's in the same way. Happy to create a PR for that too.