malli

https://github.com/metosin/malli :malli:
Leonid Korogodski 2021-04-17T02:23:48.451600Z

(defn restart []
  (mount.core/stop)
  (mount.core/start))

ikitommi 2021-04-17T12:14:12.452500Z

@lkorogodski in your example, there are both clojure specs (`:authorization)` and malli schemas (`:query)`. You should pick either one via :coercion option in the route data and use it in all the places. The error comes from spec-tools, so I believe you have coercion set to clojure.spec.

✅ 1
ikitommi 2021-04-17T12:14:51.452600Z

there are malli examples under examples . Hope this helps you to the right direction

ikitommi 2021-04-17T12:17:49.452800Z

@schmee sure, nothing built-in I guess, but you can add a custom decoder into the :map schema, reduce over the all map entries and remove nils.

ikitommi 2021-04-17T12:18:58.453Z

there are similar imps in malli.transform for stripping out extra keys and transforming keys.

👍 1
Leonid Korogodski 2021-04-17T12:51:46.453200Z

Thanks!

ikitommi 2021-04-17T13:12:21.453300Z

looking at GraphQL fragments, would be relatively easy to support those in malli. But not sure if that would be a good idea. Maybe not.

ikitommi 2021-04-17T13:13:03.453400Z

writing GraphQL<->Malli would be easier with that for sure.

eskos 2021-04-17T19:04:43.453600Z

IIRC they're very close to Turing complete, so maybe not 🙂

eskos 2021-04-17T19:06:20.453800Z

There's https://github.com/Vincit/venia which is data based so maybe have venia/Malli thingy instead? Would save you from implementing your own GraphQL parsing stuff as well.