Fork me on GitHub
#pathom
<
2021-11-29
>
Drew Verlee20:11:51

can some explain (re-explain) how the role of the "entity" or "entity tree" the 2nd optional arg passed to p.eql/process https://cljdoc.org/d/com.wsscode/pathom3/2021.08.14-alpha/api/com.wsscode.pathom3.interface.eql#process From here https://pathom3.wsscode.com/docs/environment/#entity It says it can provide data to the entity map, this would seem to be useful in testing and there is a NS for helpers on merging data in https://cljdoc.org/d/com.wsscode/pathom3/2021.07.19-alpha/api/com.wsscode.pathom3.entity-tree#create-entity But their not well documented (from my limited perspective). And i don't see any examples. I have been randomly throwing data in this entity-tree in hopes it would somehow show up in my tests. But a graph needs entity-attribute-value relationships and a "map" can't do that, which is where i assume the helpers come in?

wilkerlucio20:11:03

hello @U0DJ4T5U1, the entity is the initial data context, in the past Pathom made easy to provide a single attribute to start the processing (usually some id) via idents. the entity is the idea to extend that, and support an arbitrary bag of data to be available at hte process start, so pathom can fill the rest using this data as the bootstrap data

wilkerlucio20:11:35

another way to say it: the entity is the data you already know before you start resolving

wilkerlucio20:11:46

the one in env is the cached entity so far, that value is an atom that starts with the entity (that you provide to process), but changes as attributes get resolved

👀 1
Drew Verlee23:11:14

It does make sense, it might help to post a couple examples of working with it using the helper functions to get a sense of whats possible. As it stands, i just assoc keys and values directly into it.