Fork me on GitHub

I just started to finally take a deeper dive into crux and it's been great so far. I'm coming from datahike + fulcro/pathom, and the eql/project that crux now offers makes it so I don't even need to write (much) pathom resolver code, great. But one thing that is a little annoying is that the eql/project returns an empty map when an attribute is not found, that makes it so pathom thinks that it's found and the follow on reads won't happen. Is there a flag I could set to have that not happen? I realize this is an alpha feature, and I can walk the crux query result to remove empty attributes as a workaround.

👍 6

Hi - thanks for the feedback! It's always great to know whether people are finding the various features useful, but a suggestion for improvement is even better 🙏 We have some in-flight work happening on eql/project at the moment: that list is the ability to set a :default value, which is somewhat similar but I guess you want something that can be configured once for the entire query. I'll add your suggestion to the card and we'll have a think about how best to address the issue. In the meantime though I'm afraid you're stuck with the workaround (sorry 🙂)


Awesome! Thanks a lot. Subscribing to the issue, although the work-around is not a problem for me :)

👌 3

Hey @U09MR0T5Y just to confirm - you would prefer the attribute to not appear at all? And not simply have a value of nil?


Hmm, nil is also okay

👍 3

Cool, thanks for the fast response 🙂


Sure! Thanks for looking in to it.

🙏 3

Although I guess it comes down to the whole billion dollar mistake issue, where datomic chooses to not let you insert a nil at all. But I'm sure you as database developers have a stronger opinion on the issue than I do.


@lgessler you might also want to take a look at the eql/project query stuff. I saw your template has a file called project in the crux directory so I thought you already did, but looks like that's a model file 🙂

👍 3

the code in the template predates eql/project's implementation, really excited to see it around. Probably worth rewriting my resolvers with it