List of pages linked under link to page

Hi, I’m struggling to list all the page-links under a page-link. My main place of work is the journal. Let’s say that I have a main block [[Work]] and during weeks I’m adding new pages under it like [[People]], [[Projects]], [[Stuff]] and so on. Later on I forget about the pages created under. Is there any way to list them? I can go to page Work and check all the linked references, but it gets harder with each daily journal note. I don’t use tags.

Welcome. Try placing the following query inside the page of the main block (e.g. Work):

#+BEGIN_QUERY
{
 :inputs [:current-page]
 :query [:find ?name
   :in $ ?parent-ref-name
   :where
     [?parent-ref :block/name ?parent-ref-name]
     [?parent :block/refs ?parent-ref]
     [?child :block/parent ?parent]
     [?child :block/refs ?child-ref]
     [?child-ref :block/original-name ?name]
 ]
 :result-transform (fn [result] (sort-by :name result) )
 :view (fn [result] [:div
   (for [name result]
     [:div [:a {:href (str "#/page/" name)} name] ]
   )
 ])
}
#+END_QUERY

Thats excatly what I was looking for. Much appreciated. Is there any way to exclude journal days from the list?

Managed it by myself. Filtered out comma since it is used only in journal pages. Also added alphabetical filtering. Thanks for assistance.

#+BEGIN_QUERY
{
 :title "Child Pages - Work"
 :inputs [:current-page]
 :query [:find ?name
   :in $ ?parent-ref-name
   :where
     [?parent-ref :block/name ?parent-ref-name]
     [?parent :block/refs ?parent-ref]
     [?child :block/parent ?parent]
     [?child :block/refs ?child-ref]
     [?child-ref :block/original-name ?name]
     (not [(clojure.string/includes? ?name ",")])
 ]
 :result-transform (fn [result] (sort result))
 :view (fn [result] 
   [:div 
     (for [name result] 
       [:div [:a {:href (str "#/page/" name)} name]])])
}
#+END_QUERY

You may prefer (not [?child-ref :block/journal-day])