Is it Possible to Upload an Image and Attach it to a Document I want to Insert in One Query?

2 replies
Last updated: Oct 7, 2022
is it possible to upload an image and attach it to a document i want to insert in one query? i know i can upload, get the image id and then create but it seems wasteful. can i do something like that in a transaction?
Sep 30, 2022, 1:55 PM
You’ll need 2 transactions.
Sep 30, 2022, 1:56 PM
so 2 separate calls? or did you mean something else which is more optimized
Oct 7, 2022, 2:14 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?