Skip to content

[3.13.1] Refetch handler stop being executed on refresh #12440

Open
@jrg091

Description

@jrg091

Issue Description

In our component we have the following mutation with a refetch option set for a previously executed query.

const [result, { loading: loadingResult }] =
  useSyncDataMutation({
    awaitRefetchQueries: true,
    onError: (error: ApolloError) => {
      // Log and show messages
    },
    onCompleted: (data) => {
      // Show some messages   
    },
    refetchQueries: [CHANGELIST_QUERY],
  });

const { data, loading, error } = useQueryJustChangelistQuery({
  fetchPolicy: "cache-and-network",
  variables: {
    id: changelistId,
  },
  onCompleted: (data) => {
    console.log("WORKING");
  },
});

The useSyncDataMutation is executed in a button handler and in 3.13.0 and previous versions, the onCompleted from useQueryJustChangelistQuery was executed with the new data. Starting from 3.13.1 I see the request to the server being made but the handler is not being executed.

Note: I'll try to create a codesandbox and I'll update this description

Link to Reproduction

WIP

Reproduction Steps

No response

@apollo/client version

3.13.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions