~/talk

Let’s manage our local state with GraphQL

Talkat React Conf Armenia 2019 · on Saturday, 2019-05-25· [react, graphql]
links:none on file
slides:none on file

Argues that GraphQL/Apollo can replace Redux for local UI state when an app already uses GraphQL, showing code that uses react-apollo-hooks, useQuery/useMutation and useApolloClient with Apollo Boost to call client.writeData or small resolvers instead of dispatching actions. Demonstrates a working modal: defaults set visible=false, mutation or direct cache write toggles visible and the modal opens/closes. Warns this simplifies code but cautions against using it in non-GraphQL projects or for overly complex cache writes.

AI-written summary · about

  1. 0:00Introduction
  2. 4:03GraphQL for local state
  3. 7:12Apollo Client setup
  4. 9:20Defaults and resolvers in Apollo
  5. 12:31GraphQL queries and mutations
  6. 14:16Apollo hooks for state
  7. 16:47Custom components for hooks
  8. 18:36Direct cache access with useApolloClient
  9. 21:06Combining queries and mutations
  10. 23:13Live demo: modal state
  11. 25:01When to use GraphQL locally
  12. 25:43Resources and closing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.