A simple demo using fulcro, pathom and crux
Install npm
deps
$ npm install
Start a REPL with dev
profile
$ clj -A:dev
Call (user/-main)
function. Wait the shadow-cljs
build
Connect at localhost:8080
Install npm
deps
$ npm install
Start shadow-cljs via npm
$ npm start
Connect at localhost:8080
Install npm deps
$ npm install
Generate uberjar
$ lein uberjar
And run
java -jar target/graph-demo.jar
Connect at localhost:8080
After get the web up'n'running, start the metro server
npm run rn-server
Then launch the app on emulator/app.
npm run rn-android
src/
├── 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.