This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-22
Channels
- # babashka (2)
- # beginners (81)
- # calva (5)
- # chlorine-clover (3)
- # cider (1)
- # cljsjs (1)
- # cljsrn (24)
- # clojure (67)
- # clojure-europe (3)
- # clojurescript (37)
- # code-reviews (2)
- # conjure (12)
- # core-async (4)
- # datalog (1)
- # datomic (6)
- # emacs (2)
- # figwheel-main (1)
- # graalvm (12)
- # java (4)
- # kaocha (9)
- # meander (3)
- # other-lisps (1)
- # pathom (14)
- # re-frame (2)
- # sci (32)
- # shadow-cljs (77)
- # sql (88)
- # xtdb (54)
is such query invalid?
[{[:video/id "faf7789f-d3e2-11ea-9add-02a4a06c46e9"]
[:video/placeholder-url]}
{[:video/id "faf7789f-d3e2-11ea-9add-02a4a06c46e9"] [:creator/id]}]
shouldn't the parser merge the outputs instead of overwriting them (which I assume it does since it responds with one or the other)?
@yenda it's not a invalid query But both results end up in the same ident. It will not merge
[{([:video/id "faf7789f-d3e2-11ea-9add-02a4a06c46e9"] {:pathom/as :a})
[:video/placeholder-url]}
{([:video/id "faf7789f-d3e2-11ea-9add-02a4a06c46e9"] {:pathom/as :b})
[:creator/id]}]
Or using placeholders
[{:>/a [{[:video/id "faf7789f-d3e2-11ea-9add-02a4a06c46e9"]
[:video/placeholder-url]}]}
{:>/b [{[:video/id "faf7789f-d3e2-11ea-9add-02a4a06c46e9"]
[:creator/id]}]}]
I have the following attributes:
[:comment/created-on
:video/id
:user/id
:comment/id
:comment/text
:comment/deleted?
:comment/mentioned-id]
both user/id and comment/mentioned-id are user-ids but I don't see how I can get more info about the mentioned-id with one query
[{[:comment/id "b214304f"]
[{:>/mentioned-user [:comment/mentioned-id :user/username]} :comment/created-on
{:>/user [:user/id :user/username]}]}]
@yenda that's a modeling issue, because you have multiple paths with different input values, so which path it chooses is unpredictable (not a problem when paths are consistent, but its not this case), a way out is to instead of making those alias, make that a relationship, in this way:
(pc/defresolver comment-mentioned [_ {:keys [comment/mentioned-id]}]
{::pc/input #{:comment/mentioned-id}
::pc/output [{:comment/mentioned [:user/id]}]}
{:comment/mentioned {:user/id mentioned-id}})
then, you can query:
[{[:comment/id "b214304f"]
[{:comment/mentioned [:user/username]}
:comment/created-on
{:>/user [:user/id :user/username]}]}]
the idea is created a separated context for the specific (mentioned) entry, this way it doesn't conflict with the user in the parent