This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-13
Channels
- # adventofcode (69)
- # announcements (1)
- # babashka (68)
- # beginners (37)
- # calva (3)
- # cider (4)
- # cljdoc (4)
- # cljsrn (1)
- # clojure (73)
- # clojure-europe (13)
- # clojure-nl (15)
- # clojure-switzerland (11)
- # clojure-uk (6)
- # clojurescript (14)
- # code-reviews (1)
- # conjure (1)
- # cryogen (3)
- # fulcro (32)
- # lambdaisland (8)
- # pathom (13)
- # reagent (6)
- # releases (1)
- # reveal (43)
- # shadow-cljs (9)
- # tools-deps (2)
- # vim (2)
Is there an equivalent of ::psm/error-mode-loud
for eql?
in pathom3 are params different from eql? Here I'd expect :param to be available in the resolver.
(edn-query-language.core/query->ast
['({[:thing/id #uuid "c5aa81d4-13cf-491d-ac83-3646c9e0bc0b"]
[:thing/attr]} {:param "param for thing"})])
;; => {:type :root, :children [{:type :join, :dispatch-key :thing/id, :key [:thing/id #uuid "c5aa81d4-13cf-491d-ac83-3646c9e0bc0b"], :query [:thing/attr], :children [{:type :prop, :dispatch-key :thing/attr, :key :thing/attr}], :params {:param "param for thing"}, :meta {:line 251, :column 4}}]}
(pco/defresolver resolver-using-param [env _]
{::pco/input [:thing/id]
::pco/output [:thing/attr]
::pco/params [:param]}
{:thing/attr (str "attr with " (:param (pco/params env)))})
(resolver-using-param
{}
['({[:thing/id #uuid "c5aa81d4-13cf-491d-ac83-3646c9e0bc0b"]
[:thing/attr]} {:param "param for thing"})])
the parameter seems out of place in the query
try like this:
(edn-query-language.core/query->ast
['{[:thing/id #uuid "c5aa81d4-13cf-491d-ac83-3646c9e0bc0b"]
[(:thing/attr {:param "param for thing"})]}])
Ok thanks. That is how a load with extra :params option from fulcro gave it, is it a bug there?
not a bug per-see, but an error in expectation, but its such a common one that I'm considering a way to give an easy fix, I see a lot of people doing plugins that just move the params forward everywhere, I think that's overkill, but I also think it could be something like "forward ident params", to move just params from idents to the first level of things
That might be a nice extension, but if that somehow pollutes the params idea maybe a "global params" thing in the env would be better. That's what :params
means in this case I think?
I tried updating from pathm 2.3.0 alpha 10 to 21 and I got a validation error in one of my resolver. it's responding to a union query and used to work fine so I don't understand the error. This is what it prints:
[{:follows-threshold [:notification/type :notification/timestamp :notification/text], :follow [:notification/type :notification/timestamp :user/id], :comment [:notification/type :notification/timestamp :comment/text :user/id :video/id], :comment-reply [:notification/type :notification/timestamp :comment/text :user/id :video/id], :like [:notification/type :notification/timestamp :user/id :video/id :video/deleted?], :video-uploaded [:notification/type :notification/timestamp :notification/text :video/id], :views-threshold [:notification/type :notification/timestamp :notification/text :video/id], :likes-threshold [:notification/type :notification/timestamp :notification/text :video/id]}] - failed: keyword? in: [:com.wsscode.pathom.connect/output 1] at: [:com.wsscode.pathom.connect/output :attribute-list :plain] spec: :edn-query-language.core/property
[{:follows-threshold [:notification/type :notification/timestamp :notification/text], :follow [:notification/type :notification/timestamp :user/id], :comment [:notification/type :notification/timestamp :comment/text :user/id :video/id], :comment-reply [:notification/type :notification/timestamp :comment/text :user/id :video/id], :like [:notification/type :notification/timestamp :user/id :video/id :video/deleted?], :video-uploaded [:notification/type :notification/timestamp :notification/text :video/id], :views-threshold [:notification/type :notification/timestamp :notification/text :video/id], :likes-threshold [:notification/type :notification/timestamp :notification/text :video/id]}] - failed: map? in: [:com.wsscode.pathom.connect/output 1] at: [:com.wsscode.pathom.connect/output :attribute-list :composed] spec: :com.wsscode.pathom.connect/out-attribute
[:pagination/edges [{:follows-threshold [:notification/type :notification/timestamp :notification/text], :follow [:notification/type :notification/timestamp :user/id], :comment [:notification/type :notification/timestamp :comment/text :user/id :video/id], :comment-reply [:notification/type :notification/timestamp :comment/text :user/id :video/id], :like [:notification/type :notification/timestamp :user/id :video/id :video/deleted?], :video-uploaded [:notification/type :notification/timestamp :notification/text :video/id], :views-threshold [:notification/type :notification/timestamp :notification/text :video/id], :likes-threshold [:notification/type :notification/timestamp :notification/text :video/id]}] :pagination/has-prev? :pagination/has-next? :pagination/first-cursor :pagination/last-cursor] - failed: map? in: [:com.wsscode.pathom.connect/output] at: [:com.wsscode.pathom.connect/output :union] spec: :com.wsscode.pathom.connect/output
I can't understand from this, can you send the resolver output that's failing?
::pc/output [:pagination/edges [{:follows-threshold [:notification/type
:notification/timestamp
:notification/text]
:follow [:notification/type
:notification/timestamp
:user/id]
:comment [:notification/type
:notification/timestamp
:comment/text
:user/id
:video/id]
:comment-reply [:notification/type
:notification/timestamp
:comment/text
:user/id
:video/id]
:like [:notification/type
:notification/timestamp
:user/id
:video/id
:video/deleted?]
:video-uploaded [:notification/type
:notification/timestamp
:notification/text
:video/id]
:views-threshold [:notification/type
:notification/timestamp
:notification/text
:video/id]
:likes-threshold [:notification/type
:notification/timestamp
:notification/text
:video/id]}]
:pagination/has-prev?
:pagination/has-next?
:pagination/first-cursor
:pagination/last-cursor]
@U0DB715GU this union is malformed, for unions you should put the {}
right after the join, without the []
, as:
::pc/output [:pagination/edges {:follows-threshold [:notification/type
:notification/timestamp
:notification/text]
:follow [:notification/type
:notification/timestamp
:user/id]
:comment [:notification/type
:notification/timestamp
:comment/text
:user/id
:video/id]
:comment-reply [:notification/type
:notification/timestamp
:comment/text
:user/id
:video/id]
:like [:notification/type
:notification/timestamp
:user/id
:video/id
:video/deleted?]
:video-uploaded [:notification/type
:notification/timestamp
:notification/text
:video/id]
:views-threshold [:notification/type
:notification/timestamp
:notification/text
:video/id]
:likes-threshold [:notification/type
:notification/timestamp
:notification/text
:video/id]}
:pagination/has-prev?
:pagination/has-next?
:pagination/first-cursor
:pagination/last-cursor]