Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sync-utils): set document ID in Sanity to match shopifyId #166

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nrgnrg
Copy link
Contributor

@nrgnrg nrgnrg commented May 18, 2021

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 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.

@good-idea
Copy link
Owner

Thank you! This will be very helpful ~ I'm going to run a test locally to make sure there are no breaking changes to existing IDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

set document ID in Sanity to match shopifyId
2 participants