Fork me on GitHub
#graphql
<
2017-12-09
>
admay00:12:24

@hlship Any support for working with qualified keywords in Lacinia? I have a map coming in that has all ns qualified keywords in order to work with spec but I’m not sure how to go about making it work with Lacinia.

souenzzo13:12:18

I'm using a cool solution. At home I will post a gist.

souenzzo18:12:21

(-> {:objects {:user {:fields {:name {:type    'String
                                      :resolve :user/name}}}}}
    (lacinia.util/attach-resolvers (into {}
                                         (for [ident (d/q '[:find [?ident ...]
                                                            :where
                                                            [?e :db/ident ?ident]] db)]
                                           [ident #(get %3 ident)]))))

oliy05:12:48

@souenzzo this is the sort of usecase I am writing locksmith for https://github.com/oliyh/locksmith

hlship00:12:08

Comments most welcome.