graphql(forget, { props: ({ mutate }) => ({ forget: (email) => mutate({ variables: { email }, update: (proxy, { data }) => { // Read the data from our cache for this query. let cached = proxy.readQuery({ query: userProfile }) // Errors cached.errors = data.errors // User cached.user = cached.user || { _id: null, name: null, status: null, __typename: 'User' } cached.user.status = data.forget.status // Write our data back to the cache. proxy.writeQuery({ query: userProfile, data: cached }) } }) }) })(Forget)