Skip to content

Make every option a function (starting with service) #45

@fratzinger

Description

@fratzinger

My last changes with requestPerItem introduced a mechanism to populate based on conditions but there's another step to take.
Explanation: I've a service called changelogs with entries to almost every service with columns: associatedServicePath, associatedId, userId.
If I want to populate the associated Item, I need to take the associatedServicePath. The most elegant way would be to have:

associatedItem: {
    service: (item, context) => item.associatedServicePath,
    nameAs: associatedItem, // or even `nameAs: (item, context) => singularize(item.associatedServicePath)`
    asArray: false
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions