untangled 2017-06-06

how do i do get a df/load-data post-mutation to do a follow-on read?

my post-mutation touches a bunch of stuff in the app-state that i'd like to trigger re-renders for, but since the :post-mutation parameter just takes a mutation symbol instead of a query expression i'm not sure how to tell the reconciler what keywords i'm dirtying

so, i notice that the solutions in the "putting it together" portion of the dev-guide actually behave the same way - on page refresh, they don't show the data loaded from the server until you trigger a render through the text field's :onChange - i guess this is why df/load is the preferred method?

@claudiu It should be a no-op on the server-side.

@adamvh So, load-data allows for a general query, but once I identified the real needs it was less useful (see the white-board YouTube video): https://youtu.be/mT4jJHf929Q?list=PLVi9lDx-4C_T_gsmBQ_2gztvk6h_Usw6R

load has a :refresh option that can be given the additional keywords to re-render,

but if i use load i basically have to send the server my root component's (or some component's) entire query, righty?

you should always be using defui to write your queries, or you don’t get normalization…even with load-data

even if the defui doesn’t have a render

watch the video…it will clear a lot up

it’s too easy to get lost in the weeds of syntax until you understand how to think about the database and loading

ah, this is not the whiteboard video i have seen before - ok, i'll have a gander

as it stands what i'm having trouble getting past is a perceived super-tight coupling between what my ui data looks like and what i'm sending to the server

short answer: (load :questions Question) means “load something using the made-up root keyword :questions that are of type Question.

but i won't bug you anymore until i watch the video

but those questions then get linked into the UI by post mutations etc

yeah, the video will help

That coupling has to be solved (or you have a nightmare of chasing irrelevant threads of UI tree)…Untangled solves it, but you have to think about it from the ident/normalization standpoint. The video should clear it up.

You also want to use InitialAppState to ensure you don’t have to hand-construct (and correct when you refactor) the UI-only tree at app startup.