Fork me on GitHub
#biff
<
2024-04-01
>
jcd20:04:12

I am playing around with biff to build a toy application, and I am struggling a bit with biff/submit-tx . I think this is clearly a case of me holding it wrong, since I worked through the tutorial pretty easily, but I can't seem to make a simple delete call work. I have something like this:

(biff/submit-tx ctx
                      [{:db/op :delete
                        :db/doc-type :game
                        :game/id guid}])
And I get a bad implementation message:
java.lang.IllegalArgumentException: No implementation of method: :submit-tx of protocol: #'xtdb.api/PXtdbSubmitClient found for class: nil

jcd20:04:27

this was... a good one.

jcd20:04:52

I miskeyed the :keys destructuring in my function signature.

jcd21:04:18

{:keys [biff/db session :as ctx]} Anyway, I sorted it out.

Jacob O'Bryant21:04:46

ha glad you got it working! but yeah, for future reference, that kind of error message usually means the wrong thing is getting passed in for ctx. I oughtta have submit-tx/other functions check for that immediately and give a better error message.

Lyn Headley18:04:09

very common error, special message would be helpful for newcomers

👍 1