Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve prefix mapping mechanism #461

Closed
milessabin opened this issue Aug 29, 2023 · 1 comment
Closed

Improve prefix mapping mechanism #461

milessabin opened this issue Aug 29, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@milessabin
Copy link
Member

The current PrefixMapping can only specialise mappings based on a path prefix. Whilst this is fully general, it can be extremely verbose to specify mappings using only this mechanism.

There are at least two scenarios which are not currently handled well,

  1. the mapping should be determined by a path from an ancestor type. If this type appears in multiple locations in the schema, then the current model requires multiple prefix mappings to encode it.
  2. the mapping resolves a whole subtree in the result, eg. by fetching data as Json from a web service via a nested EffectField. If descendent types below the top level of that subtree have mappings elsewhere (eg. SQL mappings for a different path from the root) then these other mappings will supercede the effect mapping for those descendents. This can be worked around by the use of additional prefix mappings, but again that can be extremely cumbersome if the descendent types are used in many other parts of the schema.

We need a more sophisticated mapping mechanism which can handle these scenarios smoothly.

@milessabin
Copy link
Member Author

Fixed in #608.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant