Replies: 2 comments
-
You should not push the updated company to the Maybe you can format your code to help others read it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you very much for your reply. I just delete the part about the cache and it's ok now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Could you help me for this problem with the update query (view-apollo / viewjs):
Here is my update method:
updateCompany (id, name) {
this.$apollo.mutate({
mutation: UPDATE_COMPANY,
variables: {
username,
firstname
}
update: (cache, {data: {updateCompany}}) => {
const companies = cache.readQuery ({query: GET_COMPANIES})
companies.companies.push (updateCompany)
cache.writeQuery ({
query: GET_COMPANIES,
data: companies
})
}
})
.catch (error => {
console.error (error)
})
}
Via my UI, I can modify the data, but I get this error:
The data is edited, but the user interface displays the line twice with the same data, then I reload (manually) the page and the previously edited data is updated.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions