Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1.51 KB

README.md

File metadata and controls

34 lines (24 loc) · 1.51 KB

deployed version: https://codesandbox.io/s/github/OlegLustenko/apollo-local-state

Motivation

The questions was can we migrate redux-like/useReducer code-base to apollo-local-state and figure out the first steps of migration

Possible deprecations in "store-land" by react-team : Deprecation warning

Links

Apollo-local state limitations

  • virtual fields in schemas can't work in reactive manner

  • workaround around virtual fields degrade performance, moving ViewModel/selectors layer to graphql fields are limited by perf issues

  • Local Resolvers and Mutations has identical signature but limitations are different

    signature:

    fieldName: (obj, args, context, info) => result;

    We can't use context.client.readQuery inside of Resolvers but we can do so at Mutations. The only way to write shared code there it's context.client.query

Pros

  • All pros of graphql + apollo
  • There a clear way to migrate redux-like code-base and it's scalable solution