-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING
data.model
is synced with Apollo cache #9844
`NaturalAbstractModelService.resolve()` now resolves in two steps. First it asks Apollo to fetch the object from network to force refresh Apollo cache. Then only, the resolving is considered finished, and we emit an observable that watches Apollo cache for the model. So the component can receive the observable from the route, subscribe to it and immediately receive an up-to-date model. And all subsequent updates to the model will be emitted from Apollo cache too. But the real breaking part is that previously the route resolved data shape: ```ts { permission: myPermissions, action: { model: myAction, statuses: myStatuses, priorities: myPriorities, } } ``` Now, because `NaturalAbstractModelService.resolve()` only resolve the model, it becomes the simpler: ```ts { permission: myPermissions, model: myActionObservable, statuses: myStatuses, priorities: myPriorities, } ``` So all overrides of `resolve()` must be migrate outside the model service. Typically, something like: ```ts export const actionResolvers: ResolveData = { action: resolveAction, statuses: () => inject(NaturalEnumService).get('ActionStatus'), priorities: () => inject(NaturalEnumService).get('Priority'), } ```
- Loading branch information
Showing
9 changed files
with
61 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.