morphism icon indicating copy to clipboard operation
morphism copied to clipboard

Mapping with runtime arguments?

Open aahventures opened this issue 4 years ago • 0 comments

More of a question than a feature request, but I thought it was more appropriate than creating a bug.

Is your feature request related to a problem? Please describe. I have a different look up table for different tenants, and would like to drop it in at runtime.

Describe the solution you'd like Something like https://automapperts.netlify.app/docs/mapping-configuration/map-with-arguments

Describe alternatives you've considered Considering https://github.com/nartc/mapper or writing wrapper code, something like

createSchemaWithContext(lookup: Lookup) {
  return createSchema<Destination, Source>({
    countryCode: s => lookup.country(s.countryId).code;
  });
}

I'm not sure what the best approach is. Any advice is appreciated.

aahventures avatar Mar 31 '21 06:03 aahventures