gatsby-source-strapi icon indicating copy to clipboard operation
gatsby-source-strapi copied to clipboard

singleType fetch error doesn't panic

Open laurenskling opened this issue 2 years ago • 1 comments

I was wondering so hard why I didn't see my content in Gatsby. Turned out, the endpoint was giving an error 500 but that isn't handled by the source plugin. I guess here: https://github.com/strapi/gatsby-source-strapi/blob/c72d6c75edc6ab2a9857185946b4c979550b7a37/src/fetch.js#L92 no idea why this would be commented. It feels risky to not panic on fetch errors, right? But mostly this was some terrible DX. I just uncommented this code locally and I get a perfect error message in my build. Failed to fetch data from Strapi /api/company/usps with {"method":"GET","url":"/api/company/usps","params":{"populate":"*"}} Request failed with status code 500

laurenskling avatar Jul 09 '22 18:07 laurenskling

Okay now I understand why it's commented. GET /api/company/usps?populate=%2A&filters[updatedAt][$gt]=1657447748348 (39 ms) 404 when updating the data, it askes for only updated content. singleTypes will return a 404...

laurenskling avatar Jul 10 '22 10:07 laurenskling