java – Can we write GraphQL query for getting data based on predicate(condition)

This is possible. I once wrote a query like this. I needed to search the database using some search terms.

query ($title: String!, $company: String!, $city: String!, $investor: String!) {
    jobs(
      where: {
        and: [
          { title: { ilike: $title } },
          { company: { name: { ilike: $company } } },
          { city: { ilike: $city } },
          {company: {company_investors:{investor:{name: {ilike: $investor}}}}}
          
        ]
      }
    ) {
      id
      title
      city
      company {
        name
        id
        company_investors {
          investor {
            name
            id
          }
        }
      }
    }
  }

Read more here: Source link