Jochen Bedersdorfer
Software Engineer
WORK IN PROGRESS
Query result is a nested map of attributes. To specify which attributes to include, use a vector
EQL
Result
[:account/id :account/name]
{:account/id "0000"
:account/name "Raygen"
}
How to go deeper?
Replace attribute with a map with a single entry:
attr -> sub-query
EQL
Result
[:account/id :account/name
{:account/owner [:user/name :user/email]}]
{:account/id "0000"
:account/name "Raygen"
:account/owner {:user/name "Han Solo"
:user/email "han@solo.net"}
}
But which account am I querying?
Use an ident to identify a starting point:
[attr some-data]
EQL
Result
[[:account/id "0000"]]
{[:account/id "0000"] #:account{:id "0000"}}
Combine with sub-query syntax
EQL
Result
[{[:account/id "0000"] [:account/name]}]
{[:account/id "0000"] #:account{:name "Raygen Key"}}
What about conditions, paging, searching?
Add parameters to any attributes with (attr param)
Up to resolvers what is available
EQL
Result
[{(:account/all
{:search-term "Raygen"
:sort-key [:account/address :address/street1]
:limit 5
:offset 5}) [:account/name]}]
#:account{:all [#:account{:name "Raygen Key"}
#:account{:name "Raygen Level Key"}
#:account{:name "Raygen Level"}
#:account{:name "Raygen Steiner"}
#:account{:name "Raygen Home"}]}
By Jochen Bedersdorfer