"Troubleshooting adding Sanity to a Gatsby project and resolving deployment and configuration issues."
Last updated: Jul 19, 2021
Trying to add Sanity to a Gatsby project. I'm getting an error that says "GraphQL API not deployed." However, I have deployed it. The repo is here: https://github.com/ChrisWillburn/chris-willburn1 . Anyone know how I can get Sanity working on this project? It's been really frustrating to try and install Sanity, and it seems like it's taken way too long. It looks good and I want to use it, but so far...not so good.
Jul 19, 2021, 7:33 PM
Hey Kevin! Can you double check that your GraphQL API deployed properly by running
Ok, looking at the endpoint url then comparing it to your
config , it looks like the project ids do not match. What happens if you change the config to reflect the endpoint’s id of
Jul 19, 2021, 8:45 PM
That did it! Thank you! Couple more questions: a) I'm not sure what the admin link is to log in to Sanity, and b) will the blog show up at /blog?
Jul 19, 2021, 8:56 PM
Totally forgot to update the ID in gatsby-config.js! Great catch.
Jul 19, 2021, 9:01 PM
Nice! For your first question, I’m not 100% certain what you mean by admin link, but you can log into a project through manage.sanity.io , as well as find the url for the deployed studio. If you’re invited as an admin on the project, you’ll show up as an admin in the studio. Let me know if I’m misunderstanding your question, though!As for the blog, did you use a starter to create this or did you build it from scratch? If you used a starter, it should be configured to fetch all of your blog posts out of the box. If not, you would have to query your Sanity content in order to get the data into your FE.
Jul 19, 2021, 9:04 PM
By admin link, I mean where do I go to login and create content, i.e. yoursite.com/admin . I didn't use a starter, so I'll need to query it.
Jul 19, 2021, 9:07 PM
Got it. So, in order to create content (outside of running the studio on localhost using
), you would need to run
in the root of your studio folder. You’ll then be able to choose your
url. If the studio has already been deployed, you’ll find that url under the project’s name at manage.sanity.io .
Jul 19, 2021, 9:14 PM
Thanks so much for all your help, Racheal! I should be able to finish this up now. I really appreciate it.