DEV Community

Cover image for Making New Projects with Gatsby & Sanity

Making New Projects with Gatsby & Sanity

Ryan Doyle on October 20, 2019

Why Gatsby & Sanity? As I've spent more time developing, one thing I have been doing more often is building personal sites for other...
Collapse
 
wispyco profile image
Wispy • Edited

Thanks needed a reminder on what I did to get this setup with Gatsby before. One thing to note in your instructions sanity graphQL deploy needs to be lowercase sanity graphql deploy. And finally your importing import sp from './sponsor'; but your referencing it is sponsor lower down so it should be import sponsor from './sponsor'; Also I think you should be running gatsby develop not build, that's generally left for when your hosting your site, or if you need to check specific build things like lighthouse tests.

Collapse
 
doylecodes profile image
Ryan Doyle

Yes thanks! I made these changes

Collapse
 
guthries profile image
Guthrie • Edited

If anyone is getting issues on step 9 when running "gatsby develop" (such as Gatsby, React, or Sanity Types not found or missing) this is related to step 5 when the gatsby-source-sanity is installed. Some users have been having issues with NPM, but running the same via yarn seems to resolve and produce working builds for now.

More info here: github.com/gatsbyjs/gatsby/issues/...

Collapse
 
stu profile image
Stu Finn

This is exactly what I needed. Thanks!

Collapse
 
peterwitham profile image
Peter Witham

Thanks for this, I was looking for a simple explanation of how to mess with Sanity and you checked all the right boxes!

Collapse
 
abetoots profile image
abe caymo

The time it took me to read this and get it set up and running vs. the days I spent configuring WordPress to be a headless CMS. I'm kinda pissed.

Collapse
 
kmelve profile image
Knut Melvær

Thanks for this excellent guide Ryan!

Collapse
 
doylecodes profile image
Ryan Doyle

Of course! Love Sanity. Hope others can benefit.

Collapse
 
saiafonua profile image
Saia Fonua

Thanks Ryan! I appreciate the article!

Collapse
 
bayuangora profile image
Bayu Angora

What about Gatsby build time benchmark compared to Hugo?