Skip to content

OlegLustenko/apollo-local-state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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