-
-
Save garethpbk/f4a0fd5949880b727659a6ef77a56539 to your computer and use it in GitHub Desktop.
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
<Mutation | |
mutation={CREATE_USER_MUTATION} | |
update={(cache, { data: { createUser } }) => { | |
const { users } = cache.readQuery({ query: GET_ALL_USERS_QUERY }); | |
cache.writeQuery({ query: GET_ALL_USERS_QUERY, data: { users: users.concat([createUser]) } }); | |
}} | |
> | |
{createUser => ( | |
<CreateUser | |
createUser={createUser} | |
createNewUser={this.createNewUser} | |
state={this.state} | |
handleChange={this.handleChange} | |
/> | |
)} | |
</Mutation> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment