Fork me on GitHub
#graphql
<
2021-07-30
>
hlship02:07:29

Still on the whole I’m liking the move from lein to deps

Lennart Buit08:07:46

Oeh nice, the satisfies? problem I’ve stumbled over sometimes too. Clever, using early returns for values you know wont satisfy.

thumbnail10:07:50

Excited to see a perf fix for satisfies?! Our codebase chokes on the latest because (selection/field-name (executor/selection ctx)) is no longer supported:

java.lang.IllegalArgumentException: No implementation of method: :field-name of protocol: #'com.walmartlabs.lacinia.selection/FieldDef found for class: com.walmartlabs.lacinia.parser.FieldSelection
Is this no longer supported, or did we stumble on a early bug?

hlship17:08:50

I’m actually not sure why that worked before; how about (-> ctx selection/field selection/field-name) ?

thumbnail08:08:02

> No implementation of method: :field of protocol: #'com.walmartlabs.lacinia.selection/FieldSelection found for class: clojure.lang.PersistentArrayMap Although this works: (-> ctx executor/selection selection/field selection/field-name)

hlship17:08:15

Right, my answer was off the top of my head and wrong. So you get the selection from the context, and because you are in a field resolver, you know its a field selection and from there you can go to the field to extract the field name.

thumbnail17:08:16

Makes sense, I updated it, tests passed 🎉 thanks for the work and the support!

hlship13:07:05

That looks like a bug to me.

vemv14:07:47

When needing to perform some sort of query over "my_schema.edn" (Lacinia schema), would you simply slurp it, or is there a fancier way?

hlship16:07:41

(-> “foo.edn” io/resource slurp schema/compile) is my way

👌 2