Fork me on GitHub
#fulcro
<
2018-10-19
>
levitanong08:10:42

does ptransact wait for a transaction’s network request to finish before going to the next, or does it wait for the transaction’s network request to simply start before going to the next?

levitanong08:10:03

ah, I just read the ptransact! source. > This function defers pessimistic writes, not reads. Is there some other thing I should use for pessimistic reads?

claudiu08:10:57

@levitanong would df/load and post-mutation not work for you're use-cases ?

levitanong07:10:52

it’s several mutations that have load-actions, so I don’t think so.

thheller11:10:07

there is nothing like https://facebook.github.io/graphql/draft/#sec-Field-Alias in the query syntax right? neither fulcro nor pathom?

claudiu11:10:03

@thheller Think there is in pathon. At the bottom there is a edn->grahpql https://wilkerlucio.github.io/pathom/DevelopersGuide.html

thheller11:10:23

no I don't mean actual graphql I mean the alias functionality

claudiu11:10:31

think the ident stuff looks similar to what you want

claudiu11:10:37

ahh. Guess if pathom can do that for edn->graphql, should be able to do it for edn->aliaseedn and back based on those conventions.

thheller11:10:30

I was thinking through a scenario where I have a parameterized attributes [(:foo/bar {:param 1}) (:foo/bar {:param 2}})]

thheller11:10:49

I guess I'll just need to run 2 separate queries which is fine I guess

tony.kay13:10:36

you cannot combine the same prop in a single query twice…the return value is a map keyed by just the prop…no dupes there @thheller

tony.kay13:10:04

in fact, Fulcro will auto-split such txes into two requests on the back-end

thheller13:10:26

@tony.kay hmm do you think it would be useful to add (:foo/bar {:param 1} :alias). taking the example from the graphql spec running two queries seems like overkill and very inefficient

wilkerlucio13:10:01

@thheller the closest we get now with pathom is to use a placeholder node, this will make a separated segment but you can just pull from it, example:

[(:foo/bar {:param 1})
 {:>/placeholder-alias [(:foo/bar {:param 2})]}]

pvillegas1213:10:34

Where do you normally create a new entity when loading a given route? Currently when there is a route mutation I’m loading a model with df/load, I could fire off the creation of the form entities there or in a componentDidMount hook. Is there some preference of one over the other?

wilkerlucio13:10:21

@pvillegas12 better do it in a :post-mutation of your load

👍 4
tony.kay13:10:49

agreed. You could use the lifecycle to pre-populate a placeholder for it (or check if it is there), but a post mutation is the proper place for loading post-processing

👍 4