I can't find out how to update table after deleting row. Apollo-server is used in backend and relay for client. I'm trying to use NODE_DELETE but I don't know what I'm doing wrong
this is delete mutation
const mutation = graphql`
mutation DeleteAdMutation(
$id: ID!
) {
deleteEvent(
id: $id
)
{
deletedId
}
}`;
export const DeleteEvent = (input) => {
return new Promise((resolve, reject) => {
commitMutation(
environment,
{
type: 'NODE_DELETE',
deletedIDFieldName: 'deletedId',
mutation,
variables: input,
}
)
});};
deletedId returned successfully but nothing changes in table
table query:
const GetADayTours = graphql`
query GetADayToursQuery(
$type: String!,
$page: Int!,
$row: Int!,
) {
getADayTours(
type: $type,
page: $page,
row: $row,
) {
page
row
total
data{
...on aDayTour{
...Row_row
}
}
}
}`;
export default GetADayTours;
and here is row fragment:
createFragmentContainer(RowComponent
, {
row: graphql`
fragment Row_row on aDayTour {
_id
id
title
}
`,
});