deployed version: https://codesandbox.io/s/github/OlegLustenko/apollo-local-state
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 :
-
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'scontext.client.query
- All pros of graphql + apollo
- There a clear way to migrate redux-like code-base and it's scalable solution