My requirement is to fetch data for particular ids only. Graphql query is following
query pageQuery {
contentfulFeaturedContent(contentful_id:{in:["4IcVFLJ1EkCUAgQosWCmma", "2eUt6Ht7LOKsmigqC8qAYM"]}){
heading
}
}
Issue is, it is returning only 1 data, the one which is added last in contentful. Please help
contentfulFeaturedContent will return always just 1 result - you'll want to use connection here:
allContentfulFeaturedContent(filter: { contentful_id:{in:["4IcVFLJ1EkCUAgQosWCmma", "2eUt6Ht7LOKsmigqC8qAYM"]}}) {
edges {
node {
heading
}
}
}
This solved my issues. Thanks!!
Most helpful comment
contentfulFeaturedContentwill return always just 1 result - you'll want to use connection here: