Is there a way to filter on entryCollection or a Fragment/linkedFrom?

I have this graphql query - I had to reverse it as I had to match/filter on a linkedForm:

query LocalState3 {
  localStatePageCollection(where: { seoName: "ca"}, limit:1) {
    items {
      name
      seoName
      url
      cities: linkedFrom {
        entryCollection{
          items {
            ... on LocalCity {
              seoName
              name
            }
          }
        }
      }
    }
  }
}

I will get a bunch of “cities” here - BUT I want to get a specific city UNDER the “ca” state. I know I can filter on the front end, BUT I’d rather do this in graphql if possible?

I thought this might work, but didn’t

 entryCollection(where: { seoName: "culver-city"}, limit: 1)
 entryCollection(filter: { seoName: { eq:"culver-city"}}, limit:1)

Basically I am in need of querying either by city with a “matching state” OR by state with a “matching city”… The “state” is a linked item IN my city content_type, so I figure to reverse the query (see above), but I am sorta stuck again…

any way to filter on items or entryCollection or ?

1 Like