Filter Operators
Filters are applied using thewhere argument on collection queries. Each field in your entity type supports multiple filter operators.
Equality Filters
Exact match filter. Matches entities where the field equals the specified value.
Negation filter. Matches entities where the field does not equal the specified value.
Comparison Filters
Available for numeric types (Int, Int8, BigInt, BigDecimal) and Timestamp:
Greater than. Matches entities where the field is greater than the specified value.
Greater than or equal to.
Less than.
Less than or equal to.
String Filters
String fields support various text matching operators:Case-sensitive substring match.
Case-insensitive substring match.
Does not contain substring (case-sensitive).
Does not contain substring (case-insensitive).
Starts with prefix (case-sensitive).
Starts with prefix (case-insensitive).
Does not start with prefix (case-sensitive).
Does not start with prefix (case-insensitive).
Ends with suffix (case-sensitive).
Ends with suffix (case-insensitive).
List Filters
Matches entities where the field value is in the provided list.
Matches entities where the field value is not in the provided list.
Boolean Operators
AND Operator
By default, multiple filter conditions at the same level are combined with AND:and operator:
OR Operator
Theor operator matches entities that satisfy any of the provided conditions:
Nested Entity Filters
Filter by related entity fields using nested filters:Derived Field Filters
Filter parent entities by properties of derived child entities:Sorting
Simple Sorting
Sort by any field usingorderBy and orderDirection:
Child Entity Sorting
Sort by fields of related entities using double underscore notation:Graph Node automatically appends
id to the ORDER BY clause to ensure deterministic ordering:orderBy: namebecomesORDER BY name, id- This guarantees consistent pagination even when the sort field has duplicate values
Pagination
Basic Pagination
Usefirst and skip for offset-based pagination:
Keyset Pagination
For better performance with large offsets, use keyset (cursor-based) pagination:Full-Text Search
Full-text search requires explicit declaration in the subgraph manifest:text argument:
Change Block Filter
Query entities that changed at or after a specific block:- Incremental data synchronization
- Detecting entities modified in recent blocks
- Change tracking and auditing
Complex Query Examples
Multi-Condition Filtering
Multi-Condition Filtering
Combine multiple filters with boolean logic:
Nested Filtering with Sorting
Nested Filtering with Sorting
Filter by nested entities and sort results:
Time-Range Queries
Time-Range Queries
Query entities within a specific time range:
Query Limits
Graph Node enforces configurable limits to prevent excessive resource usage:- Maximum
firstvalue: Default is 1000, configurable per instance - Maximum
skipvalue: Default is 5000, configurable per instance - Query timeout: Queries that take too long are automatically cancelled
- Query complexity: Very complex queries may be rejected
Best Practices
- Use specific filters: Narrow down results with precise filters to reduce data transferred
- Limit field selection: Only query fields you need
- Prefer keyset pagination: For large datasets, use
id_gtinstead of largeskipvalues - Sort explicitly: Always specify
orderByfor consistent pagination - Index appropriately: Graph Node automatically indexes fields, but query patterns matter
- Monitor query performance: Use query execution time to optimize data access patterns
Next Steps
- Explore aggregation queries for timeseries analytics
- Learn about time-travel queries for historical data
- Review GraphQL API overview for basic concepts

