Fork me on GitHub
#pathom
<
2021-12-18
>
lgessler20:12:12

hey #xtdb users: any thoughts on how to make xtdb's history features and pathom resolvers play nice? coming up with a few ideas... I think the most promising one goes like this: • add ring middleware to look for a query param like ?xtdb-validtime=... (or a cookie? not sure what the best http option here might be) • have the middleware extend the request (and therefore the pathom environment, in most pathom+ring setups) with a {:historical-db (xt/db node xtdb-validtime)} • modify resolvers to prefer :historical-db to :node when it is set would appreciate any thoughts on this approach

lilactown22:12:18

I haven't used xtdb, but I imagine if it's similar to datomic having an :as-of parameter at the root of a query might be a neat way to handle that

lilactown22:12:48

ostensibly all nodes in a query should use the same db-time, right?

lgessler22:12:39

right, all entities for the query would be using the same db-time. that's an interesting idea too!