Skip to content
Snippets Groups Projects
Commit 38783d40 authored by Daniel Bimschas's avatar Daniel Bimschas
Browse files

HOLI-9835: redesign API to fix client-side caching issue

On client side, Apollo client normalizes caches. Because an entity returned by this API can be
contained in multiple query results (`engagementById`, `engagementRecommendations`, ...) the entity
contained therein must always be of the same shape. Otherwise, this can lead to client-side cache
updates resulting in unexpected UI updates.

This commit introduces the type `EngagementReco` as an envelope around the actual
`Engagement` entity. `EngagementReco` additionally contains the query-specific fields
`matchedTopics`, `matchedSkills` and `matchedGeoLocationDistanceInMeters`.

To be backwards-compatible

* the current `engagementRecommendations` query continues to
  return the current shape of data
* the newly introduced `engagementRecos` returns items of the new
  `EngagementReco` with the aforementioned match fields "removed" from the `Engagement` entity (undefined)

Clients must upgrade to `engagementRecos`. Thereafter, `engagementRecommendations` can
be removed and the `matched*` fields within the `Engagement` type as well.
parent 4a481932
Branches
Tags
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment