Add @deleteRecord directive to campaign delete mutations
Without @deleteRecord the deleted campaign stays in the Relay store, so any other component that still holds a reference to it keeps reading stale data. Pair it with @deleteEdge on the list mutation so the connection and the record are both cleaned up. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -91,7 +91,9 @@ const deleteCampaignMutation = graphql`
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteAccessReviewCampaign(input: $input) {
|
||||
deletedAccessReviewCampaignId @deleteEdge(connections: $connections)
|
||||
deletedAccessReviewCampaignId
|
||||
@deleteEdge(connections: $connections)
|
||||
@deleteRecord
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -103,7 +103,7 @@ const deleteCampaignMutation = graphql`
|
||||
$input: DeleteAccessReviewCampaignInput!
|
||||
) {
|
||||
deleteAccessReviewCampaign(input: $input) {
|
||||
deletedAccessReviewCampaignId
|
||||
deletedAccessReviewCampaignId @deleteRecord
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user