diff --git a/controlplane/src/core/bufservices/federated-graph/updateFederatedGraph.ts b/controlplane/src/core/bufservices/federated-graph/updateFederatedGraph.ts index c1e1dcb215..5837e86571 100644 --- a/controlplane/src/core/bufservices/federated-graph/updateFederatedGraph.ts +++ b/controlplane/src/core/bufservices/federated-graph/updateFederatedGraph.ts @@ -161,25 +161,28 @@ export function updateFederatedGraph( targetNamespaceDisplayName: federatedGraph.namespace, }); - orgWebhooks.send( - { - eventName: OrganizationEventName.FEDERATED_GRAPH_SCHEMA_UPDATED, - payload: { - federated_graph: { - id: federatedGraph.id, - name: federatedGraph.name, - namespace: federatedGraph.namespace, + // Send webhook event only when we update label matchers because this causes schema update + if (req.labelMatchers.length > 0 || req.unsetLabelMatchers) { + orgWebhooks.send( + { + eventName: OrganizationEventName.FEDERATED_GRAPH_SCHEMA_UPDATED, + payload: { + federated_graph: { + id: federatedGraph.id, + name: federatedGraph.name, + namespace: federatedGraph.namespace, + }, + organization: { + id: authContext.organizationId, + slug: authContext.organizationSlug, + }, + errors: compositionErrors.length > 0 || deploymentErrors.length > 0, + actor_id: authContext.userId, }, - organization: { - id: authContext.organizationId, - slug: authContext.organizationSlug, - }, - errors: compositionErrors.length > 0 || deploymentErrors.length > 0, - actor_id: authContext.userId, }, - }, - authContext.userId, - ); + authContext.userId, + ); + } if (compositionErrors.length > 0) { return {