Introduction
Apollo Client is much more than a simple GraphQL client. It offers a comprehensive caching API that leverages GraphQL's rich type information system (schema) to provide features like cache normalization, optimistic UI and more.
Orbit aims to bridge the gap between Apollo Client and traditional state management libraries like NGXS, NgRx or Redux.
It does so by providing the following features:
- Comprehensive state management: Orbit combines the strengths of Apollo Client and event based state management (flux architecture), providing a unified solution for managing both local and remote data.
- Decoupling: Separate state management code from component code using modular
statedefinitions andactionhandlers. - Modular: Each
statedefinition manages its own slice of the cache. - Separation of concerns (SoC): Different
stateslices can handle the sameMutationorActionindependently. - Event-driven architecture: Actions enable event-driven application design.
- Testability:
statelogic can be tested in isolation, enhancing testability.
Opt-in
Orbit state module is optional and is only included in the final bundle if you opt-in by importing @apollo-orbit/angular/state entry point.