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)