Gatsby Template Preview

Hey, @sankar.sundaresan thanks for sending over all the details of your project.
I noticed a couple of things in your setup that need to be updated.

  1. Since you are using a manual setup to declare the schemas, you need to make sure you add all the Custom Types of your repository even if they aren't in use; otherwise, the project might break. In this case, I can see you're missing to add the homepage type
  2. In gatsby.node.js you can use the url field to create the paths. The URLs of the site are automatically created using the Link Resolver that you defined in the plugin config.

Aside from that is important to note that when you're running your project in dev mode, Gatsby's default 404 page will pop up when you're trying to preview an unpublished document. This should not be the case for the version in production.

We've had a similar discussion about this a few days ago in this other thread.