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

set document ID in Sanity to match shopifyId #165

Open
nrgnrg opened this issue May 17, 2021 · 0 comments · May be fixed by #166
Open

set document ID in Sanity to match shopifyId #165

nrgnrg opened this issue May 17, 2021 · 0 comments · May be fixed by #166

Comments

@nrgnrg
Copy link
Contributor

nrgnrg commented May 17, 2021

Is your feature request related to a problem? Please describe.

This is probably only useful in a handful of edge cases but I'm using a normalised cache on the Sanity GraphQL API and when I get a users checkout from Shopify I only have the Shopify ID's. This makes it very difficult to query my cache which although I have keyed using Shopify ID's, can't translate an allShopifyProducts query into a key for an item in the cache.

Describe the solution you'd like

If the document ID in Sanity matched the Shopify ID we would be able to perform GraphQl ShopifyProduct queries with ID's returned from Shopify API's. This would be able to translate directly into a key for the cache.

I don't think there are any downsides to using the Shopify ID in place of an auto generated Sanity ID and it would be a very simple change to make since Sanity allows setting custom ID's using client.create.

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

Successfully merging a pull request may close this issue.

1 participant