Skip to content

Passing false to serialize gives typescript error #465

Open
@MasterOdin

Description

Looking at the Additional Options doc, it gives:

  // Whether to serialize to JSON before/after persisting. Defaults to true.
  serialize?: boolean,

but on trying to pass false, I get the tsc error:

(property) ApolloPersistOptions<NormalizedCacheObject, true>.serialize?: true | undefined
Type 'false' is not assignable to type 'true'.ts(2322)
index.d.ts(20, 5): The expected type comes from property 'serialize' which is declared here on type 'ApolloPersistOptions<NormalizedCacheObject, true>'

To get by this, I'm ignoring the error via a tsc annotation, but that definitely feels hacky and there didn't seem an obvious way to let tsc accept false.

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