Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GraphQL and state management

GraphQL and state management

Shruti Kapoor

February 23, 2019
Tweet

More Decks by Shruti Kapoor

Other Decks in Programming

Transcript

  1. A query language for your API GraphQL is a query

    language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
  2. A query language for your API GraphQL is a query

    language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
  3. A request to receive or modify information from the server

    Query, Mutations Schema GraphQL features https://www.apollographql.com/docs/
  4. Query, Mutations Schema A function that returns value for a

    field Resolvers GraphQL features https://www.apollographql.com/docs/
  5. Query, Mutations Schema A function that returns value for a

    field Resolvers GraphQL features https://www.apollographql.com/docs/
  6. • Component State • ContextAPI • Redux • Mobx •

    mobx-state-tree • Cerebral • freactal • unistore • Vuex Different ways of managing state
  7. • setState • ContextAPI •Redux • Mobx • mobx-state-tree •

    Cerebral • freactal • unistore • Vuex Different ways of managing state
  8. Objects that send data from application to store Actions An

    object that stores state tree of application Store Functions that define how state changes in response to action Reducers Redux features https://redux.js.org/basics/
  9. Store How Redux works State updated = UI re-rendered XYZ

    store.dispatch(“DONE FETCHING”)
  10. • When using GraphQL, you may not need a state

    management library. • Usually react state or context is enough for passing data. • Apollo-link-state can be used for state management. Lessons Learnt