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]}]}]
this doesn't work and picks the username of user/id in both placeholders
I have an alias for mentioned-id (pc/alias-resolver2 :user/id :comment/mentioned-id))
@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
nice thanks