I wanted to inquire about something. I am trying to display staff images, bio, etc.
My query is like so:
const data = useStaticQuery(graphql`
query {
allContentfulStaff {
edges {
node {
staffBio {
staffBio
}
staffImages {
id
gatsbyImageData
description
}
staffOneLine
}
}
}
}
`);
My map function is like so:
return (
<>
<h1>Our Rockin' Staff</h1>
{data.allContentfulStaff.edges.map((node, index) => {
console.log(data.allContentfulStaff);
return (
<div>
<GatsbyImage
key={``}
image={node.gatsbyImageData}
alt={node.description}
/>
{node.staffOneLine}
</div>
);
})}
</>
);
I receive the data from
{node.staffOneLine }
, but nothing for the images.
When I console log {data.allContentfulStaff}
, I see an array of images that I will attach.
However, I am getting an error which I will also attach… but none of my other queries / functions where I am grabbing images in the same manner are giving me this error and they look relatively similar. I also did not need the image prop in my components as I am using
<GatsbyImage />
Curious if you have any ideas?