pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
2021-01-10T22:53:05.177200Z

I’m building a simple Todo app in Fulcro where I have a report that lists projects. Projects can have many Todos (via a ref attribute). My report’s source-attribute is :projects/all-projects, a global resolver that returns all :project/ids. My report columns are “:project/label” and “:todo/label” (:todo/label is a “to-many” nested connection of :project/id). When I render the report, it displays the :project/label and a vector of id’s in place of the :todo/label. What’s the proper way to have the report render the individual :todo/labels themselves instead of the “idents in a list” that it displays by default? (My apologies if this is not the right channel for this question…)

dehli 2021-01-11T14:06:56.178700Z

can you include what your current query looks like?

2021-01-11T15:35:14.179Z

Hi @dehli - the “source-attribute” is the entry point for the query in a Fulcro RAD report. My source-attribute is:

(defattr all-projects :project/all-projects :ref
  {ao/target     :project/id
   ao/pc-output  [{:project/all-projects [:project/id]}]
   ao/pc-resolve (fn [{:keys [query-params] :as env} _]
                   #?(:clj
                      {:project/all-projects (queries/get-all-projects env query-params)}))})
It returns a list of :project/ids. The other resolvers in the system can reach the report columns: :project/label and :project/project-todos. Here’s a link to the code: https://github.com/aeberts/fulcro-rad-demo/blob/f0dbc0129068db97e28a5bcd88defc3a7bdacf98/src/shared/com/example/ui/project.cljc#L32