Fork me on GitHub
#graphql
<
2017-10-13
>
xtreak2905:10:13

@hlship Thanks. I will check out the talk. I have a question regarding how the destructuring part is done for argument and value. One of them might be nil while resolving nested relations. Eg. When I resolve an object directly I get the values from the argument parameter and when I resolve an object in a nested structure like resolving a track inside artist then it's passed as value. Currently I am using :or for destructuring as below

(defn get-tracks [context arguments value]
  (let [{:keys [artistid trackname trackid]} value
         {:keys [trackname trackid first], :or {trackname trackname trackid trackid}} arguments]
;; sql - logic))
Is there an idiomatic way to do it?

hlship16:10:46

That's bit beyond a Lacinia question, but this look quite reasonable to me ... or you could do a little bit with merge.

xtreak2907:10:21

Thanks. merge makes sense since either argument or value will be mostly empty at a given instance.

hlship17:10:42

A little disappointed that the Tiago's Conj talk didn't even mention Lacinia concurrency ... I was kind of expecting a macro or example code that leveraged concurrency (especially given that Hystrix commands execute in their own thread pool). Otherwise, quite an excellent talk! It's very gratifying for us to see Lacinia getting adopted in the wider Clojure community.