Hi everyone,
I'm pleased to announce the release of lacinia-gen 0.1.0
<https://github.com/oliyh/lacinia-gen>. lacinia-gen lets you generate
GraphQL responses using your lacinia schema and GraphQL queries, allowing
you to make your tests more rigorous in both Clojure and Clojurescript.
Here's an example:
(require '[lacinia-gen.query :as query])
(def schema '{:enums {:position {:values [:goalkeeper :defence :attack]}}
:objects {:team {:fields {:wins {:type Int}
:losses {:type Int}
:players {:type (list :player)}}}
:player {:fields {:name {:type String}
:age {:type Int}
:position {:type :position}}}}
:queries {:teams {:type (list :team)
:resolve :resolve-teams}}})
(let [f (query/generate-fn schema {})]
(f "query { teams { wins players { name } } }" {}))
;; => {:data
{:teams
({:wins 0, :players ()}
{:wins 0, :players ({:name ""})}
{:wins 1, :players ()}
{:wins 0, :players ({:name "÷ "} {:name "�¢�"})}
{:wins 1, :players ()})}}
It's available now on Clojars.
Thanks and enjoy,
Oliy
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.