Created
December 30, 2017 21:29
-
-
Save peterpme/f2be3660508e131dddb4a48a5e490d99 to your computer and use it in GitHub Desktop.
React Apollo updateResponse Question
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } }) => { | |
} | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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