hygraph / gatsby-source-graphcms

The official Gatsby source plugin for GraphCMS projects

Home Page:https://graphcms.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gatsbyImageData return a wrong structs for some images

Bogdan1001 opened this issue · comments

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
    }
  }
}

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