good-idea / sane-shopify

MIT License
212 stars 15 forks source link

Is there a way to create a new Document from sourceData? #125

Closed willTastyMakers closed 3 years ago

willTastyMakers commented 3 years ago

HI, Thank you for the fabulous project. While I have some experience with React and Typescript I am a Sanity noob. So perhaps my question will not make sense, but I thought I would ask?

I wanted to modify the shopifyProduct document as it appears in the studio. I wanted to arrange the order of objects and added some new objects. I reviewed how you have used the saneShopifyConfig to extend the product and collection, but I run into impasses when I try create an object that will allow me to display all the images in a product

Do you know how I might go about creating a document from the sourceData? I would like to create a new document named ProductBench based on sourceData. Is this even possible and if so could you perhaps give me a push in the right direction?

Thanks

good-idea commented 3 years ago

Hi Will,

If you'd like to display the images from Shopify, you can create a field with a custom input component that uses the images found in sourceData. I'm planning on cleaning up the UI for the documents to include these, so that's on the roadmap.

To create new documents, you'll need to roll this on your own. What are you hoping to do with your ProductBench document? Will there be one of these for each product, or is it a singleton?