I am pretty new to using Contentful and their Reference (many) field type. I have one reference type that pulls in many product names. in GraphQL I can see all my product name displaying, but when I try and render it on Gatsby I am not seeing anything display (productName:array). Here is my GraphQL
{
allContentfulAppetizerMenuSection {
nodes {
menuItemReferences {
productName
}
}
}
}
and here is my code...
import React from 'react';
import { graphql, StaticQuery } from 'gatsby';
const Products = () => (
<StaticQuery
query={graphql`
query MyQuery {
allContentfulAppetizerMenuSection {
nodes {
menuItemReferences {
productName
}
}
}
}
`}
render={data => (
<div>
{data.allContentfulAppetizerMenuSection.nodes.map(({ menuItemReferences }, i) => (
<div key={i}>
{menuItemReferences.productName}
</div>
))}
</div>
)}
/>
)
export default Products;
Any help will be much appreciated.