datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 51 forks source link

SeoField breaks instancePrefix #172

Closed joernroeder closed 2 years ago

joernroeder commented 2 years ago

I'm going to connect multiple instances of dato and I am therefore in the process of adding the instancePrefix to an existing source. I stumbled across an error that "DatoCmsAsset" does not exists which makes sense after adding the prefix as it should have changed to DatoCmsMyPrefixAsset. After digging a bit, I found an hard coded occurrence of the type here https://github.com/datocms/gatsby-source-datocms/blob/master/src/hooks/sourceNodes/createTypes/fieldTypes/DatoCmsSeoField.js#L11 and by replacing it with context.generateType('Asset') it solves the issue.

In addition there are also hard coded ids here and here which could no longer resolve properly after fixing the error above. I've seen a itemNodeId helper here which might be the way to resolve this as well, but It need further investigation I am unable to do right now.

stefanoverna commented 2 years ago

408e9cc5581b3fd4355e648d87aca927773b790c fixes the issue! Released as v3.0.6

Thanks for the thorough report @joernroeder!

joernroeder commented 2 years ago

thank you so much @stefanoverna for the fast fix! ❤️