I am trying to fix the TOO COMPLEX QUERY ERROR on my sectionsCollection
but idk why its isn’t working like adding the limitations to each collections
. also it is mandatory to have sections atleast 20 right. howerver here is the query that i am trying to make it work.
query leadGenTemplatesEntryQuery {
leadGenTemplates(id: "ID") {
sys {
id
}
sectionsCollection(limit: 20) {
items {
... on AccordionSection {
__typename
title
... on AccordionSection {
accordionsCollection(limit: 20) {
items {
... on SimpleAccordion {
__typename
...simpleAccordion
}
... on DoubleFoldAccordion {
__typename
...dobleFoldAccordion
}
}
}
}
}
... on DoubleMediaSection {
__typename
name
media: mediaCollection(limit: 2) {
items {
url
}
}
header
title
description
cta {
...Links
}
}
... on QuotesComponent {
__typename
quotesCollection(limit: 20) {
items {
quote {
json
}
author
}
}
}
... on ResourcesComponent {
__typename
title
slider: resources
}
... on ColorText {
__typename
text {
json
}
}
... on TwoColumnComponent {
__typename
...twoColumn
}
... on VideoSection {
__typename
asset {
... on Video {
loop
autoplay
video {
url
title
}
}
... on Link {
url
}
}
}
... on IframeComponent {
__typename
iframeUrl
backgroundImage {
url
}
overlayText
overlayCtaText
}
... on ArticleTypeContent {
__typename
...articleTypeContent
}
... on RelatedContent {
__typename
relatedContentTitle
relatedContentCollection(limit: 20) {
__typename
items {
...leadGenPage
...articleContent
# ...videoLandingTemplates
}
}
}
}
}
}
}
fragment Links on Link {
text
url
icon {
url
}
}
fragment twoColumn on TwoColumnComponent {
media {
url
}
header
title
description
cta {
...Links
}
}
fragment leadGenPage on LeadGenTemplates {
__typename
heroFirstStepTitle
slug
image {
url
}
}
fragment articleTypeContent on ArticleTypeContent {
content {
json
links {
entries {
block {
sys {
id
}
... on BlockVideo {
name
videoUrl
}
}
}
assets {
block {
sys {
id
}
url
title
width
height
description
contentType
}
}
}
}
}
fragment articleContent on ArticlePage {
title
slug
heroImage {
url
}
}
fragment dobleFoldAccordion on DoubleFoldAccordion {
title
firstFoldText
secondFoldLeftText
secondFoldRightText
imagesCollection(limit: 4) {
items {
url
}
}
linksCollection(limit: 3) {
items {
text
url
}
}
}
fragment simpleAccordion on SimpleAccordion {
title
description
image {
url
}
linksCollection(limit: 3) {
items {
text
url
}
}
}
However it works if set the value of limit parameter from 20
to 10
like there are almost 14 sections. idk what this complex query is all about this is my first experience with contentful. Please give other ways to make it work as i am just stressed out trying to fix this complex query error for that i would like to have a call and solve in call as i am already raised a white flag