hygraph / gatsby-source-graphcms

The official Gatsby source plugin for GraphCMS projects
https://graphcms.com
MIT License
145 stars 41 forks source link

gatsbyImageData return a wrong structs for some images #227

Closed Bogdan1001 closed 2 years ago

Bogdan1001 commented 2 years ago

Hello,

We've a problem with some images that were loaded from gatsbyImageData.

Getting the next error at console: [gatsby-plugin-image] Missing image prop

looks like the images which are not loaded don't contains fallback: field:

Screen Shot 2022-01-28 at 9 50 30 AM

above you can see the first struct have fallback and successfully fetched via getImage and latter pasted to GatsbyImage and appeared on front. But the second struct is invalid and return gatsby-plugin-image] Missing image prop

here are two images to reproduce

should succeed ninja

should fail img-1

And by this query I fetch the images.

query MyQuery {
  allGraphCmsAsset {
    nodes {
      gatsbyImageData
    }
  }
}
Bogdan1001 commented 2 years ago

ok can close the issue, it was fixed after I used the image directly without getImage(gatsbyImageData);