Skip to content

Make it possible to set dataKey to a Promise #93

@devdaniero

Description

@devdaniero

I'm currently working on a project which uses TypeORM and jsonapter to retrieve and expose a product feed. The product entity is very large and therefore some relations are set to lazy. This wraps the field into a Promise.

Unfortunately when I use the lazy loaded field in a template I can't seem to get it working. The output is omitted and when I log the value it's still resolving the Promise.

Is it possible to implement Promise compatibility here? Or what workaround can I use to be able to pass resolved fields to jsonapter engine?

Template snippet where regularPrice is a lazy loaded field.
content: { ... regularPrice: { dataKey: 'regularPrice', template: priceTemplate }, ... }

The priceTemplate contains another content block with more fields.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions