I'm using apollo server.
While mutating data I need to update 2 tables: location and address.
End of resolver function:
const locationUpdated = await db.location.updateLocation(user.id, location);
const addressUpdated = await db.address.updateAddress(user.id, location.address);
return { error: null, location: { ...locationUpdated, address: addressUpdated } };
Using GraphQL Playground:
mutation {
updateLocation(
location: {
id: 1
label: "label12"
address: {
city: "city12"
}
}
) {
error
location {
label
address {
city
}
}
}
}
As a result I have new location.label but old location.address.city:
{
"data": {
"updateLocation": {
"error": null,
"location": {
"label": "label12",
"address": {
"city": "city11",
}
}
}
}
}
Database is updated correctly. Looks like server uses cache?