(parser env [(op {:arg 1}) (op {:arg 2})])
is a antipattern?
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 {}}
no anti pattern, this is a supported feature on EQL :)
#fulcro do not like multiple ops in transactions
not sure what you mean, fulcro is totally ok with multiple ops in transactions
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
I think he's referring to if the operation is the same symbol
you get back a map so you their responses are "merged"
[(op {:a 1}) (op {:a 2})] => {op {:answer 1}}
for example - what if one of the calls fails, but one of them succeeds?
I'm using pathom-as
so no problem
do you have a link for that? I haven't heard of that
you can do [(op {:pathom/as :a}) (op {:pathom/as :b})] ;;=> {:a ... :b ...}
@danvingo
oh interesting! thanks
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
nvm, found the answer in the docs