Is there a way to filter a nested value in GraphQL with a higher up value?

Is there a way to filter a nested value in GraphQL with a higher up value?


0

I’m wondering if there’s a way to filter a nested section with a higher up value – see below:

query readSeasons($seasonID: ID) {
  readSeasons(filter: { id: { eq: $seasonID } }) {
    nodes {
      id
      minimumGamesToRank <----- THIS
      playerSeasons(
        filter: { matchesPlayed: { gte: minimumGamesToRank } }, <----- THIS
        sort: { currentPosition: ASC }
      ) {
        nodes {
          id
          matchesPlayed
          wins
        }
      }
    }
  }
}

I am trying to filter playerSeasons based on the minimumGamesToRank value above.

I tried to use the higher up value to filter the playerSeasons but it was just erroring. I’m wondering if there’s a specific way to define this?

Any ideas on this would be amazing!

Thanks in advance 🙂

Share
Improve this question

New contributor

Jack Kemmish is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


Load 3 more related questions


Show fewer related questions

0

Reset to default



Leave a Reply

Your email address will not be published. Required fields are marked *