Skip to content

Feature: Add support for multiple batch keys #75

@muesugi

Description

@muesugi

This feature request is to support endpoints with multiple batch ids.

Example use case

The endpoint that would benefit from this would be an endpoint that takes multiple batch ids and returns a nested object, such as an endpoint with the following definition:

Endpoint request
business_ids: str[]
features: str[]

Endpoint response

{
  "businessId1": {
    "feature1": "yes",
    "feature2": "no"
  },
  "businessId2": {
    "feature1": "yes"
  }
}

With the current dataloaders functionality, we would be able to set:

batchKey: business_ids
newKey: business_id

which would group multiple requests for that single feature for different businesses, but not multiple requests for different features on the same business. Where there is a large number of features, this could get expensive pretty quickly.

Proposed New Functionality

The ability to set multiple (or at least a secondary level of) batch keys, and then where right now we get back response[business_id] from the dataloader, we would get back something like response[business_id][feature] as the value at that feature for that business.

batchKey: business_ids
newKey: business_id
secondaryBatchKey: features
secondaryNewKey: feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions