I have this resolver:
(pathom-connect/defresolver session-id-resolver
[{:keys [::pathom/parent-query]} {:keys [sessions/session-id]}]
{::pathom-connect/input #{:sessions/session-id}
::pathom-connect/output [:sessions/session-id :sessions/user-id]}
{:sessions/session-id :foobar
:sessions/user-id 42})
When I make this query [{[:sessions/session-id :TODO] [:sessions/session-id :sessions/user-id]}]
I get back {[:sessions/session-id :TODO] {:sessions/session-id :TODO, :sessions/user-id 42}}
. Why do I get back :TODO
instead of :foobar
? I'm using v2.2.31. Thanks@tvaughan once you do {[:a 42] [:a :b]}
you already providing the value of :a
, so it will call the resolver just to get the value of :b
@tvaughan pathom will never override a value that is already in the entity, when you start with the ident, it set the value of that attribute, even if new resolvers get new values, the original value will be kept. if you consider that in Pathom the identity is the data itself, changing the data is like changing the identity, which leads to inconsistent data (if many resolvers use the same input property, with different values)
makes sense?
Sure, that makes sense. I'm not advocating for a different behavior. Thanks for letting me know this is expected @souenzzo and @wilkerlucio
@tvaughan see also: ::pc/mutation-join-globals
It allow you to handle tempids
For sessions, I use [{:app/current-session [:session/id :session/user-id ...]}]
I started this repo but it need some attention/commits https://github.com/souenzzo/eql-style-guide