Fork me on GitHub
Matthew Thompson16:10:32

Hi everyone! In Pathom3, is there a way to use wrap-resolver-error or similar to replace an exception thrown in a resolver with a custom error key in the returned output from the resolver? I just want to be able to log errors and put an error key of my own in the returned results.


it should be possible, yes, if not please bring a case and we can look together


another option is to use the Lenient Mode, which never throws

Matthew Thompson09:10:10

The issue I have is that with lenient mode on, instead of throwing the exception, the exception message and stacktrace gets returned in the output of the resolver. This causes issues later when attempting to marshall this output into transit. I'd just like to replace the exception in the output with a key so i know there was an exception.


I think what we would like is for something like ::pcr/wrap-resolver-error to be able to resolve the node with a custom error value, does that make sense Wilker?


you can mutate that in the stats, like the mark-node-error does (the wrap-resolver-error wraps around this function):


(or throw directly, if that's the case)


hello everybody, just a reminder, in ~ 40 min I'll be presenting at London Clojurians about Pathom 3! if you have the time I would love to see you there!

clojure-spin 7
💯 5
pathom 4

Thanks for the presentation @wilkerlucio! And for all the ongoing work in Pathom3.

🙏 1

P.S. Demo gods weren't particularly angry; I'd say all things considered - Great Success! :)


hahha, happy it worked after all, now that I'm thinking about it, the problem was that the number was bigger than the JS supports, and was probably lost precision on the wire or something

❤️ 1

while the string doesn't have this issue (and worked 🙂)

Jakub Holý (HolyJak)19:10:12

Hi! Why I query for a nested entity attribute without a join such as :family/members, I get by default all the data (i.e. the name, id, ... of each member). On the other hand, if I query for an entity by ident (such as [:person/id 1]) I do not get back all its attributes by default but only the ident itself. Why is that?


its because idents are just a single attribute provider, when you use though a link, that resolver is already providing some data (and that's what you get when you don't asked for the details of it), but the ident will just give a single attribute, and wont call any resolver


Hi @wilkerlucio - I think I found a bug on Pathom3, batch resolvers, and params. I opened an issue here, please let me know if I can help in some way to fix it: