:result-transform by :block/priority, then :block/journal-day

@Siferiax and others have shared fantastic work related to queries for task management in Queries for task management. Consider looking through that discussion for many outstanding examples.

To combine sort-by you can use juxt. Look also into map.

A variation of the following might do what you need:

:result-transform (fn [result] (sort-by 
  (juxt 
    (fn [h] (get h :block/priority))
    (fn [r] (get-in r [:block/page :block/journal-day])) 
  )
))

EDIT: for anyone looking at this in the future, note the correction by @Siferiax below. It should be:

:result-transform (fn [result] (sort-by 
  (juxt 
    (fn [h] (get h :block/priority))
    (fn [r] (get-in r [:block/page :block/journal-day])) 
  )
result
))