good-idea / sane-shopify

MIT License
212 stars 15 forks source link

Allow users to customize document preparation via the API #127

Open mxmzb opened 3 years ago

mxmzb commented 3 years ago

I am looking at https://www.sanity.io/docs/localization and thinking, that it would be nice to restructure the shopifyProduct schema (e.g. instead of transferring the shopify title into shopifyProduct.title transfer it into shopifyProduct.title.en), or rename it (e.g. instead of transferring the shopify title into shopifyProduct.title transfer it into shopifyProduct.shopifyTitle) so you can have a clean localized title attribute.

PS.: Thanks for building this toolset!

good-idea commented 3 years ago

Hiya, thanks for taking a look and for opening the issue!

This is a good idea -- I've renamed the issue. I'll add something like a transformDocument option to the API that allows users to customize how the document is prepared before being patched. This probably won't make it into 1.0, though.

So for now, an alternative option would be: