This is kind of a poor workaround, but might something like this work…?
If you are specifically worried about the query response size in this instance, would it be possible to remodel lineup
as a model instead of a block?
Then, you can make the lineup
field inside pageFestivalLineups
a multiple links field.
Then in the GraphQL query, you could fetch just the lineup
IDs inside pageFestivalLineup
and then separately fetch the lineup
model data with filtering, and recombine them clientside by their IDs. Like this:
query MyQuery {
allLineupModels(filter: {headliner: {eq: "true"}}) {
id
headliner
performers {
name
}
}
allPageFestivalLineups(filter: {lineup: {}}) {
id
title
lineup {
id
}
}
}
Which would return:
{
"data": {
"allLineupModels": [
{
"id": "lpMbI7iSQEGIaahXpOEe1w",
"headliner": true,
"performers": [
{
"name": "famous person 1"
},
{
"name": "famous person 2"
}
]
}
],
"allPageFestivalLineups": [
{
"id": "fJJNPoivQVKA8AK1JFWdeg",
"title": "lineup1",
"lineup": [
{
"id": "AMPXlSF6QGKyz1NHxsCokA"
},
{
"id": "lpMbI7iSQEGIaahXpOEe1w"
}
]
}
]
}
}
In this case, it is filtering out lineups where headliner=false
, like this one:
{
"id": "AMPXlSF6QGKyz1NHxsCokA",
"headliner": false,
"performers": [
{
"name": "not very famous person"
}
]
},
In your frontend, you’d then only show the lineup
s whose id
is also present in allLineUpModels
.
Could something like that work? If not, this may have to be a feature request instead, sorry about that!