This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-25
Channels
- # announcements (1)
- # beginners (338)
- # calva (41)
- # cider (19)
- # cljdoc (10)
- # cljsrn (6)
- # clojure (116)
- # clojure-europe (15)
- # clojure-italy (25)
- # clojure-nl (5)
- # clojure-spec (19)
- # clojure-uk (52)
- # clojurescript (99)
- # clojurex (14)
- # cursive (47)
- # data-science (1)
- # datomic (5)
- # duct (1)
- # figwheel (13)
- # fulcro (58)
- # graalvm (93)
- # jobs (3)
- # joker (9)
- # luminus (4)
- # nrepl (21)
- # off-topic (41)
- # pathom (25)
- # re-frame (7)
- # reitit (8)
- # ring-swagger (13)
- # tools-deps (13)
@codonnell hello, no worries, about 1, I guess that would be ok, but doesn't munging only goes on keys?
2. I don't remember why is that, maybe just missed, can't think of a case to need to keep as uuids
Perhaps I miscommunicated 1. The reason I'd like to see tempid?
passed through there in addition to demung
is so tempid?
isn't defaulted to (constantly false)
when connect builds graphql queries. I couldn't find a way to pass that predicate in, but that could be my unfamiliarity. Wasn't sure what that had to do munging only going on keys, so trying to clarify.
oh, I see, I think its makes sense to forward it down
otherwise, as you found, you can't set it
@codonnell if you wanna send those changes I would be glad to merge it in
Will do, thanks for your time.
@souenzzo thats for interface/api compatibility, but if you want that pathom has some helpers for you 🙂 you can use the ::pc/transform
in combination with pc/transform-batch-resolver
to receive consistent input, example:
(pc/defresolver batch-sample [env input]
{::pc/input #{:some/id}
::pc/output [:some/output]
::pc/transform pc/transform-batch-resolver}
; input will always be a sequence now, also note ::pc/batch? true will be automatically
; add by the pc/transform-batch-resolver helper
...)
is metadata on data from a resolver preserved as a parse result is built up? running into this weird case using the parallel parser where some data returned from a root resolver has metadata attached to it. when I actually pull the parse result off the chan returned by the parse call, it doesn’t contain that metadata. kind of at a loss here, and maybe I’m missing something about how core.async preserves/doesn’t preserve metadata under the hood
@mss, currently there is no assumption on the preservation of the data, there are multiple layers of caching and merging happens in multiple times (specially in the parallel parser), so there is a good chance some meta data is been lost in the process, can you tell me more about what is the use case you have for the metadata? maybe we can find a way around it
I’m using ring cookie middleware and depending on the mutation/resolver want to drop a cookie by including a :cookie
key in a resolver/mutation result. pathom doesn’t preserve that out of band data if I just include it afaict
So similar to fulcro’s impmementation, I was attempting to add metadata with a response transformation fn onto the result with the data to add to the ring response, parse that result later and feed the raw ring response into the transformation fn
If you have a better idea for how to accomplish including out of band data with a parse result from inside of a resolver I’m all ears
Here’s the fulcro implementation as a reference FWIW. What I’m doing looks pretty similar
My inclination is to just put an atom in the env and swap in data in my resolvers that needs to be merged into the response. Deref it post parse and build the complete response
@wilkerlucio PR with uuid and tempid changes at https://github.com/wilkerlucio/pathom/pull/96. (Is pinging you here about PRs actually helpful or just extra noise?)
@mss doing the atom approach is totally fine, I do that for a lot of things, including the built-in error system 🙂
you can use the fn
env version to always inject a new one, or write a plugin
Appreciate the feedback. Really a lovely library to use, thanks for all the work you put in
thinking a bit about it, in your case, the caller to the parser can send the atom as part of the env, so you have external control over it