real-enums
    Preparing search index...

    Function enumField

    • A field policy for an enum-valued field, scalar or list: typePolicies: { Order: { fields: { state: enumField(OrderState) } } }.

      Reads return instances; writes store the raw value, so the normalized cache (and anything that persists it) stays plain JSON.

      Type Parameters

      • T extends Enum

      Parameters

      • cls: EnumClass<T>

      Returns FieldPolicy<Raw | Raw[], Raw | Raw[], T | (T | null)[] | null | undefined>