Search code examples
sanity

Webhook configuration for production dataset changes to staging in Gatsby project with Sanity


Currently, I am encountering an issue with my Gatsby project that is connected to Sanity. The problem arises when I make edits or updates to the data in the production dataset. The build webhook associated with that dataset fails to trigger because the dataset linked to its webhook has unexpectedly changed from production to staging. I am unsure of the reason behind this change. Initially, I had a staging dataset, but due to this error, I ended up deleting it. Now the configuration for my webhook looks like this enter image description here

After facing this error i have deleted the staging dataset from sanity and its configuration from my project but still facing the same error. The webhook configuration should be look like thisenter image description here but dataset gets changed from production to staging after editing it. although it does not exit.


Solution

  • Open Gatsby Cloud and navigate to the 'Site Map' tab, then proceed to the 'Content Hub' tab. You will find a 'Data Sources' section there. The data source I connected with Gatsby is Sanity, and what I was missing was the 'Edit' button on the right side of the selected data source. After clicking on that button, I had the option to choose any database from my data source. Once I selected the 'Production' database, my error was resolved.