Skip to content

Instantly share code, notes, and snippets.

@peterpme
Created December 30, 2017 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterpme/f2be3660508e131dddb4a48a5e490d99 to your computer and use it in GitHub Desktop.
Save peterpme/f2be3660508e131dddb4a48a5e490d99 to your computer and use it in GitHub Desktop.
React Apollo updateResponse Question
updateUser: (variables) => {
return mutate({
variables,
// when using optimisticResponse and I don't include the values, I get a warning.
optimisticResponse: {
updateUser: {
__typename: 'User',
id: 'xyz',
setting: undefined,
setting2: true
}
},
update: (store, { data: { updateUser } }) => {
}
})
})
// ANY one of these can be optional
{
setting,
setting2,
setting3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment