Skip to content

Return counts within Resource object #354

@mattdy

Description

@mattdy

Currently, when fetching the list of 'Wines' (for example) at /wines, the web client makes a separate request for every single Wine on display - /tasting-note/wine/X

While these requests are very simple (and therefore inexpensive), it does add a large number of round trips to the server.

Consider baking certain counts into resource & resource list requests. For example, for a list of Wines:

[
  {
    "name": "string",
    "wineMakerId": 1,
    "regionId": null,
    "type": "red",
    "id": 1,
    "tastingNotesCount": 6
  }
]

Or for a single Vintage:

{
  "year": 1800,
  "wineId": 1,
  "drinkFrom": 1800,
  "drinkUntil": 1800,
  "id": 1,
  "bottles": { 
      "drunk": 0,
      "stored": 5,
       ...
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendApplies to the backend server applicationenhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions