Fork me on GitHub
#datomic
<
2024-05-06
>
favila13:05:59

👏 5
🆒 3
1
👍 4
jasonjckn02:05:42

thanks for sharing this! is it possible to execute a pull pattern on an eem for its derived attributes?

jasonjckn03:05:52

:xform is a bit restrictive in the kind of transformations it can do

jasonjckn03:05:08

are you gonna use it in prod? curious if there’s any back story

favila03:05:15

It was designed for the problems I was seeing in particular when using entity maps with Lacinia. (That’s also why metadata support: for tagging!) I no longer control whether it actually gets used though!

😮 1
favila03:05:17

If you are in a position to have and use pull expressions, I really recommend just using Pathom instead of this—it is designed to give a pull interface over anything

jasonjckn03:05:30

that makes a lot of sense now

jasonjckn03:05:04

i’ll check out pathom. it’s not possible otherwise? d/pull doesn’t operate on entity maps ?

favila03:05:38

But that said, it shouldn’t be too hard to write something that takes a pull expr and touches a map in the same way

👍 1
favila03:05:22

Sorry missed your comment. No, pull produces a map from an id, it doesn’t touch an entity map

👍 1
favila03:05:14

It’s really an alternate (eager) interface to map-projection, vs entity-map’s lazy interface

favila03:05:52

But the laziness means “special magic object with invisible IO”

jasonjckn03:05:27

nods , got it

jasonjckn03:05:04

i made need to use Lacinia over pathom due to work constraints so i’ll have this in my toolkit now

jasonjckn03:05:22

so far just on REST but it’s showing its age

jasonjckn03:05:31

too many APis

favila03:05:31

Pathom also provides a lazy version. It’s called “smart-maps” over there. Lacinia +pathom would be a good match if you can line up fully-qualified graphql fields to pathom-provided fields. If you convert the gql query to an eql query, you could even use pathom’s execution engine instead

jasonjckn03:05:05

oh interesting

favila03:05:08

Ie just run the query and return an entire nested result for Lacinia to pull keys out of

jasonjckn03:05:18

i have to write the schema twice then?

favila03:05:44

Pathom is schemaless

👍 1
jasonjckn03:05:05

interesting i need to check it out and read up

favila03:05:23

You need to give it key dependencies , but it doesn’t need to know anything about their values

👍 1
jasonjckn03:05:51

gql typically has better data and schema exploration tooling , so your customers can figure it out in their own , so sounds like a lethal combo

jasonjckn07:05:17

pathom is 🔥 thanks for the recommendation, i actually used fulcro a long time ago before pathom existed, I believe it was extracted out of there or inspired by its backend, so can't believe it took me this long.

jasonjckn07:05:02

this might be a good time for us to move to https://www.juxt.pro/blog/atomic-architecture/ too, and use mutations for domain ops.

jasonjckn07:05:07

I also started out as a monolith codebase, then moved to polylith, but took our existing monolith and just dumped it in bases/megacorp, and haven't had a ton of time to disentangle the monolith into polylith, so i feel like everythings aligning for a major refactoring.

jasonjckn07:05:21

maybe one qq for you, when writing the EQL Resolvers -> Datomic, what's your suggestion on the building block to implement those? d/entity, eem, d/pull or d/q?

jasonjckn06:05:23

how is EEM equality defined given no associations, is it just :db/id equals?

favila12:05:21

@U0J3J79FE it is same as datomic’s entity maps, which is the database’s unique name plus entity db id

👍 1
jasonjckn06:05:12

I'm now using your lib at work, merged in a CL a couple days ago, mainly for the eem/prefer-aevt so far, and I also merged 'on-retract' stuff couple months ago, per your blog post.