Fork me on GitHub
#untangled
<
2017-06-10
>
tony.kay06:06:28

It occurred to me that it would be relatively easy to make some query/mutation helpers for the server-side so you could reduce the amount of parser logic there. I’ve added untangled-parser to the untangled.server namespace in the new combo lib https://github.com/awkay/untangled (develop branch), along with three macros for adding handlers for queries and mutations. I have not had time to play with them yet, but you might find the extensions interesting. See defquery-entity, defquery-root, and defmutation (for the server). It is also on clojars

tony.kay06:06:16

basically, you use (untangled-parser) to make a pre-written Om parser, and use that on the incoming EDN expressions.

tony.kay06:06:18

(untangled.easy-server/make-untangled-server :parser (untangled.server/untangled-parser))

tony.kay06:06:37

then all of your mutations and queries can be defined with the above-mentioned macros.

tony.kay06:06:29

Recursive parsing is also possible, since you have the env (which in turn has the parser)