HTTP endpoint
Request
Response
Aggregations by CRDT type
Mixing CRDT types in a single query (e.g.
from: "*" without a type filter) and using a type-specific aggregation returns 400 incompatible_aggregate.
Examples
Sum all page view counters
Count how many carts contain a product
Union all carts
Latest config value across all regions
Config registers updated in the last minute
where clause
SDK — client.query()
Fluent type inference
Theaggregate field is typed as a string literal union — TypeScript will catch invalid combinations at compile time when you use the QuerySpec type directly.
React — useQuery()
useQuery re-runs the query when spec changes. Use useMemo to stabilize the spec object and avoid unnecessary requests on every render.
Key IDs convention
The query engine matches on the full CRDT ID as stored — whatever string you pass toclient.gcounter(id), client.orset(id), etc. Using a prefix convention like gc:views-homepage makes glob patterns predictable and enables type inference from the pattern.