Skip to main content

Choose Appropriate Operators

Use the right comparison operator for better performance.

Anti-Pattern​

# BAD: Using _ilike for exact matches
query GetAccount($address: String!) {
accounts(where: { id: { _ilike: $address } }) {
id
label
}
}

Best Practice​

# GOOD: Use _eq or primary key lookup
query GetAccount($address: String!) {
account(id: $address) {
id
label
}
}

Operator Guidelines​

  • _eq: Exact matches (fastest)
  • _ilike: Case-insensitive pattern matching (slower)
  • _in: Multiple values
  • _gt/_lt: Comparisons
  • Primary key lookup: Most efficient (when possible)