daniele
11/13/2017, 11:09 AMreturn this.apollo.mutate({
mutation: gql`
mutation($id:ID!, $name: String!, $color: String!) {
updateAirline(id: $id, name: $name, color: $color){
id,
name,
color
}
}
`,
variables: {
id: airline.id,
name: airline.name,
color: airline.color
},
update: (proxy, { data: { updateAirline } }) => {
// Read the data from our cache for this query.
const data: IAirlines = proxy.readQuery({query: this.getAirlines});
// Write our data back to the cache.
proxy.writeQuery({ query: this.getAirlines, data });
}
});