Skip to content
This repository was archived by the owner on Jan 1, 2025. It is now read-only.
This repository was archived by the owner on Jan 1, 2025. It is now read-only.

[Bug]recoil-relay cannot refresh data #2127

@kgtkr

Description

@kgtkr

recoil-relay cannot refetch using useRecoilRefresher or atom({ key: "fetchKey", ... }) pattern. (Even if the data is invalidated in the relay store.)
As far as the implementation and behavior are concerned, it seems that fetchQuery calls are unconditionally skipped unless the variables passed to the query change.
It seems that the only way to avoid this is to ignore the type in variables and add fetchKey, but this is a hack

variables:
    ({ get }) => {
      const fetchKey = get(fetchKeyState);
      const variables = {
        ...
      };

      return {
        ...variables,
        fetchKey,
      } as any;

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