Query all Tasks with Inherited Priority

I have Tasks where i need to Set Same Priority to Sub Blocks by Tagging Parent Block.
[#C] Theme 1

  • TODO Task 1
  • TODO Task 2
  • TODO Task 3

Tried Two Queries

### {{query (and (task TODO) [[Test]] (priority A B C))}}
{:title "All Tasks TODO/LATER of Project  with Priority A/B"
 :query [:find (pull ?b [*])        
         [?b :block/marker ?marker]
         [(contains? #{"TODO" "LATER"} ?marker)]         
         [?b :block/path-refs ?r]
         [?r :page/name ?page]
         [(contains? #{"a" "b" "c"} ?page)]
         [?b :block/path-refs ?r1]
         [?r1 :page/name "test"]

The First Query doesn’t give results of Inherited ones. Only Direct Matched Tasks.

Second Query is giving few spurious Results which have No Priority Tagging direct or on Parent.

Any suggestion on this ?

Reference to query that using parent recursion:

If ?b is the block with the priority it is actually

[?b :block/priority ?prio]
[(contains? #{"A" "B" "C"} ?prio)]

Assuming priority exists without tasks.
But I would think so. Not tested.

If you need the tasks, then you need to use :block/parent