Skip to content

Enums wrongly transpiled #9

Open
@newLoki

Description

@newLoki

Describe the bug
Enums defined in the graphql schema are transpiled into typescript type definitions.
For the purpose of mapping responses from a connected shop into one of those enums the types are not feasible at all.
An example is the MeasurementUnit enum, that will get transpiled to

export type MeasurementUnit =
  | 'ACRE'
  | 'ARES'

this isn't very usable when hydrating the article.salesUnit.name field from the response of a connected shop, as this will always be a String, which isn't allowed as MeasurementUnit.

Proposal is to either find a way that enums from the graphql schema are transpiled to enums in typescript or always add the String to those enums, which makes them useless.

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