pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
souenzzo 2020-06-30T20:26:45.260700Z

(parser env [(op {:arg 1}) (op {:arg 2})]) is a antipattern?

2020-07-01T11:55:56.263500Z

ahh, yea I'm trying it out and it looks like you're right, it is happening at the pathom level:

(parser {} '[(test-mutations/test-mutation {:param 1}) (test-mutations/test-mutation {:param 2})])
=> #:test-mutations{test-mutation {}}
where the mutation just returns {} and with a different name:
(parser
    {}
    '[(test-mutations/test-mutation {:param 1})
     (test-mutations/test-mutation2 {:param 2})])

=> #:test-mutations{test-mutation {}, test-mutation2 {}} 

wilkerlucio 2020-07-01T14:14:28.263700Z

no anti pattern, this is a supported feature on EQL :)

👍 1
souenzzo 2020-06-30T20:27:30.261100Z

#fulcro do not like multiple ops in transactions

wilkerlucio 2020-07-01T14:14:46.263900Z

not sure what you mean, fulcro is totally ok with multiple ops in transactions

wilkerlucio 2020-07-01T14:15:13.264100Z

what happens is that you can't have transaction guarantees between the ops, but if they are separated operations its a fine to call as many as you want

2020-07-01T17:18:41.264900Z

I think he's referring to if the operation is the same symbol

2020-07-01T17:19:00.265100Z

you get back a map so you their responses are "merged"

2020-07-01T17:19:47.265300Z

[(op {:a 1}) (op {:a 2})] => {op {:answer 1}}

2020-07-01T17:20:08.265500Z

for example - what if one of the calls fails, but one of them succeeds?

souenzzo 2020-07-01T17:48:25.265700Z

I'm using pathom-as so no problem

2020-07-01T17:51:23.265900Z

do you have a link for that? I haven't heard of that

souenzzo 2020-07-01T17:55:25.266100Z

you can do [(op {:pathom/as :a}) (op {:pathom/as :b})] ;;=> {:a ... :b ...} @danvingo

2020-07-01T17:56:23.266400Z

oh interesting! thanks

lgessler 2020-06-30T23:22:39.262800Z

hi, is there a way to put state into the environment on a per-query basis? i want to create a database session per query, but the body of a defresolver isn't the right place to do it because any other resolvers that are involved won't have access to it

lgessler 2020-06-30T23:43:05.263Z

nvm, found the answer in the docs

🆒 1