Skip to content

Allow specifying type-safe meta values #3997

@matthewjamesadam

Description

@matthewjamesadam

Description

The @hey-api/sdk plugin generates a meta field on Options hardcoded to
Record<string, unknown>, which can be used as a side-channel for data to
interceptors/middleware. However this value is in effect untyped which can lead to
bugs:

await getFoo({ meta: { retryy: false } }); // typo'd key — compiles
await getFoo({ meta: { timeout: '30s' } }); // wrong type — compiles

This issue has been previously reported here: #2425 (comment)

I have a PR with a proposed solution here: #3996

Metadata

Metadata

Assignees

No one assigned

    Labels

    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