Skip to content
(query <definition>): <query result>

The query macro allows direct access to the Graph from within any Reactor. The definition is identical to JSON-based graph queries, with the exception that limit and alias is not supported.

Query Result

The query result type is constructed dynamically based on the query definition, similar to how the Graph API works. This means that definitions are checked at compile time, and an invalid query will not be attempted.

When working with queries in Hantera Development Studio it’s important that your session is connected to a Hantera backend in order for the graph metadata to be available. Querying custom sets will not be allowed by the compiler unless the backend can verify the existence of said sets.

Paging

Paging is currently not supported. Queries only return the first 100 hits for any navigation.

Examples

From the Cookbook:

from {
get = (args) =>
// Query for orders ordered by latest creation timestamp
let orderQuery = query {
edge = 'orders'
orderBy = 'createdAt desc'
node = {
fields = ['orderNumber']
}
}
// Extract order number from query result
let orderNumber = orderQuery match
QueryError |> 'Error'
|>
orderQuery.nodes
select r => r.orderNumber
first // first returns first orderNumber or nothing
from return (
orderNumber match
nothing |> 'No orders'
|> orderNumber
)
}
Back to Index