A simple demo using fulcro, pathom and crux
Install npm deps
$ npm installStart a REPL with dev profile
$ clj -A:devCall (user/-main) function. Wait the shadow-cljs build
Connect at localhost:8080
Install npm deps
$ npm installStart shadow-cljs via npm
$ npm startConnect at localhost:8080
Install npm deps
$ npm installGenerate uberjar
$ lein uberjarAnd run
java -jar target/graph-demo.jarConnect at localhost:8080
After get the web up'n'running, start the metro server
npm run rn-serverThen launch the app on emulator/app.
npm run rn-androidsrc/
├── dev
│ └── user.clj ## dev helper
└── main
└── souenzzo
└── graph_demo
├── client.cljs ## fulcro sutff
└── core.clj ## http, pathom and crux stuff
deps.edn ## clj deps
package.json ## js deps
Fulcro components generate a query like this
[{[:user/id "foo"] [:user/id
:user/color
{:user/friends [:user/id
:user/color
{:user/friends [:user/id]}]}]}] Patohom resolver souenzzo.graph-demo.core/friends (bad name)
will get "foo", turn into :user.id/foo, get the entity from crux, usually something like
{:crux.db/id "foo" :user/friends [:user.id/var]} and return {:user/friends [{:user/id "bar"}]}
Pathom will flow the query recursively.