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:
Bryan Frimin
2026-05-07 11:04:01 +02:00
parent fd514d480b
commit f26bd8b0bf
2 changed files with 4 additions and 2 deletions

View File

@@ -91,7 +91,9 @@ const deleteCampaignMutation = graphql`
$connections: [ID!]!
) {
deleteAccessReviewCampaign(input: $input) {
deletedAccessReviewCampaignId @deleteEdge(connections: $connections)
deletedAccessReviewCampaignId
@deleteEdge(connections: $connections)
@deleteRecord
}
}
`;

View File

@@ -103,7 +103,7 @@ const deleteCampaignMutation = graphql`
$input: DeleteAccessReviewCampaignInput!
) {
deleteAccessReviewCampaign(input: $input) {
deletedAccessReviewCampaignId
deletedAccessReviewCampaignId @deleteRecord
}
}
`;