Skip to content

[cache-and-network] Bug : __typename absent from stale data #1366

@strblr

Description

@strblr

When getting stale data from the graphcache, __typename is absent, but it should actually be there according to this discussion. This caused a bug in one of my apps which relied on that field to sort some data.

urql version & exchanges:

Steps to reproduce

CodeSandbox Link

  1. Wait for the list to load a first time,
  2. Click on "Unmount and Remount List",
  3. The second time the list shows up, stale data is used at first, and it doesn't have __typename.

Expected behavior

That __typename is present.

Actual behavior

It's not when getting stale data. One has to wait for the actual network response to get the __typename back, which isn't always suitable (like in my case, where I initialize states with stale data, etc.).

Thank you for your work, and for taking this issue into consideration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs more info ✋A question or report that needs more info to be addressable

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions