Go Behind the Experience to see how Tecovas brings the West to life with Sanity 🤠 July 18th

Filename and File Structure for Importing data from External Source

1 replies
Last updated: Oct 2, 2020
Hello, I'm following the guide for importing data from an external source (https://www.sanity.io/guides/guide-importing-data-from-external-sources ) but I'm a little confused about where that actual file should be saved in the project structure. I've just put a file called 'dataCall.js' in the schema's folder and made an import call for this within the schema.js file. For the moment, I'm getting an API call to work fine and I'm creating the document but nothing is happening in the studio - there are no documents created (visually at least). On the query side, the data is there, it's just not creating the documents. Perhaps I'm missing a step here? How does Sanity create a component from this procedure? Thanks for any tips and help.
Oct 2, 2020, 6:38 AM
OK, I've worked it out. I hadn't realised that you have to define the content model first. Makes sense now.
Oct 2, 2020, 3:10 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?