Closed joernroeder closed 1 year ago
v5.0.3 should fix this issue, thanks @joernroeder!
@stefanoverna thanks for looking into this and yes, on my test instance it fixes the issue! In the graphql explorer I still see one model without prefix which is datoCmsTextNode
.
To achieve clear separation between multiple connected instances (and being able to query them separately via graphql) in a gatsby project we'd love to prefix all our connected datoCMS instances with
instancePrefix
but this breaks during sourcing. The reason for that that some models lack thegenerateType
wrapper for their naming.Clear separation is for us more important as we're looking into other tooling like https://www.gatsbyjs.com/products/valhalla-content-hub/ where we only expose certain instance assets for example but not others.
Some occurrences are:
https://github.com/datocms/gatsby-source-datocms/blob/master/src/hooks/sourceNodes/createTypes/site/DatoCmsSite.js#L55
https://github.com/datocms/gatsby-source-datocms/blob/master/src/hooks/sourceNodes/createTypes/site/DatoCmsSite.js#L79
https://github.com/datocms/gatsby-source-datocms/blob/master/src/hooks/sourceNodes/createTypes/fieldTypes/DatoCmsVideoField.js#L4
just to highlight a view, but there are more.
In addition, the gatsby cloud preview instance breaks with multiple connected dato instances here in the switch https://github.com/datocms/gatsby-source-datocms/blob/master/src/hooks/sourceNodes/index.js#L101
Given the case that instance B is sending an update, instance A receives the update, won't find the item and panic breaks the build with a 404.
my solution is to patch this with a try catch surrounding the switch.
Breaking the preview builds with 404s is particular frustrating for editors because they sometimes won't be able to see a preview at all and it seems to force gatsby cloud to do colder builds next time which take much longer.