react-apollo icon indicating copy to clipboard operation
react-apollo copied to clipboard

Hooks v3.1.5 breaks refetch functionality

Open pitops opened this issue 5 years ago • 1 comments

Intended outcome:

Refetch query and update state

Actual outcome:

Network request completes but the hook does not initiate a re-render. Only with a hard reload i could see the new state.

How to reproduce the issue:

const [signout] = useMutation(SIGN_OUT_MUTATION)

await signout({
  refetchQueries: [
  {
    query: CURRENT_CUSTOMER_QUERY
   }
  ],
  awaitRefetchQueries: true
})

Its simple the above doesn't update the state. Reverted to v3.1.4 and it works. Version

System:
    OS: macOS 10.15.4
  Binaries:
    Node: 12.13.1 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
  Browsers:
    Chrome: 83.0.4103.61
    Firefox: 70.0.1
    Safari: 13.1
  npmPackages:
    @apollo/react-hooks: 3.1.4 => 3.1.4 

pitops avatar May 26 '20 12:05 pitops

Same issue here. I just had to revert back as well.

arcadiansc avatar Jun 19 '20 02:06 arcadiansc