1. Syntactic sugars

Composite key for :idents, :extra-conditions, :joins and :cardinality.

If two or more dispatch key share the same configuration, it's handy to have them in the same entry. For example:

instead of:

;; floor-plan
{:idents {:people/all "person"
          :my-friends "person"}}

this is shorter:

;; floor-plan
{:idents {[:people/all :my-friends]
          "person"}}

This also applies to keys under :extra-conditions, :joins and :cardinality.

2. Functions in :extra-conditions

Instead of specifying a fixed filters set for an ident or a join, you can use a function that returns such filters set. The function accepts env as its argument.

Please see dev.clj for examples.

3 :required-columns

You need to understand Pathom plugins to make use of this.

Automatically fetch some columns of the same level whenever a namespace keyword is asked for. This is useful when you want to derive a property from some SQL columns using Clojure code (to be specific, as Pathom plugins)

Please see example.clj for examples. Things to look at:

  • derive-attributes which calculates :pet/age and :person/age from :pet/yob and :person/yob respectively.
  • required inputs for :pet/age and :person/age in :required-columns:
;; floor-plan
{:required-columns {:pet/age    #{:pet/yob}
                    :person/age #{:person/yob}}}

results matching ""

    No results matching ""