Skip to main content

Example: Complex Filtering

Implement multi-criteria search across entities.

Query​

Query

query GlobalSearch($searchTerm: String!, $limit: Int!) {
  accounts(
    where: {
      _or: [
        { label: { _ilike: $searchTerm } }
        { atom: { label: { _ilike: $searchTerm } } }
      ]
    }
    limit: $limit
  ) {
    id
    label
    image
  }
  atoms(
    where: { label: { _ilike: $searchTerm } }
    limit: $limit
  ) {
    term_id
    label
    image
    type
  }
  triples(
    where: {
      _or: [
        { subject: { label: { _ilike: $searchTerm } } }
        { predicate: { label: { _ilike: $searchTerm } } }
        { object: { label: { _ilike: $searchTerm } } }
      ]
    }
    limit: $limit
  ) {
    term_id
    subject { label }
    predicate { label }
    object { label }
  }
}

Variables

Click "Run Query" to execute the GraphQL query and see results