Fork me on GitHub

@wilkerlucio I’m interested in integrating pathom with datascript in a manner similar to what you’ve done with pathom-datomic. Given acceptable code, would you accept a PR for that, or do you think that should exist in its own pathom-datascript repo?


@cjsauer that sounds cool! I think a separated repo is better in this case, even though they look similar, they are different things


Yeah that seems reasonable. I have a prototype working right now, but it’s a bit rough. Still testing…


So, it works, but it obviously requires that you specify everything in the schema. In datascript, it’s common to specify only :db/unique, :db.cardinality/many, and :db.type/ref attributes; everything else goes unspecified. This means that using the plugin requires “padding” the schema with the attributes you’re expecting to resolve, e.g.

(def schema {:todo/title {}})
Seems one way to automate this is to perform resolution (i.e. (ds/pull ...)) in the ::pc/compute-output handler in order to determine what exactly datascript already knows. Then “subtract” the parent query from that. This is my first look at pathom internals, but for some reason performing resolution in order to compute outputs feels…weird :thinking_face: