Deleting Data

Deleting a specific record or groups of records

You can delete data in the Faros graph by using GraphQL mutations. The Faros mutations allow you to selectively delete data based on specific criteria. For instance, if you want to delete a particular team in the graph, your mutation would look like this:

mutation {
  delete_org_Team(where:{uid:{_eq: "my_team"}}) {
    returning {
      id
    }
  }
}

When you delete an object be aware that you may leave behind various dangling records that might have been pointing to it, such asorg_TeamMembership objects. So it would be best to clean them up beforehand. E.g:

mutation {
  delete_org_TeamMembership(where:{team:{uid:{_eq:"my_team"}}}) {
    returning {
      id
    }
  }
}

If you would like to delete all the data that was written out by a particular data source, it would be best to delete by origin.

Deleting by Origin

All objects in the Faros graph have an origin field that is typically the name of the data source that wrote them to the graph in the first place. If you want to delete all the data written out by the data source, simply use this origin field in the where clause of your mutations above, and iterate over all the objects that the source would have written.

For example, use the following delete query to delete any possible object that could have originated from the my_origin source:

mutation {
  delete_ams_Activity(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ams_Project(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ams_User(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ams_UserIdentity(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cal_Calendar(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cal_Event(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cal_EventGuestAssociation(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cal_User(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_Agent(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_AgentTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_Artifact(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_ArtifactCommitAssociation(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_ArtifactDeployment(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_Build(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_BuildCommitAssociation(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_BuildStep(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_BuildStepTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_BuildTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_Deployment(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_DeploymentChangeset(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_DeploymentTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_EnvBranchAssociation(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_Organization(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_Pipeline(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_Release(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_ReleaseTagAssociation(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cicd_Repository(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_compute_Application(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_compute_ApplicationDependency(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_compute_ApplicationMetric(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_compute_ApplicationPath(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_compute_ApplicationSource(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_compute_ApplicationTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_compute_Instance(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_compute_Volume(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cost_Definition(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cost_DefinitionEffortMapping(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cost_DefinitionEpic(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cost_DefinitionInitiative(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_cost_EffortMapping(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_CicdPipelineOptions(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_ComputeApplicationOptions(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_DashboardUrlTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_DataQualityIssue(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_DataQualitySummary(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_MetricDefinition(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_MetricDefinitionTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_MetricThreshold(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_MetricThresholdGroup(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_MetricThresholdGroupTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_MetricValue(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_MetricValueTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_Path(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_Scorecard(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_ScorecardMetric(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_Tag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_TmsTaskBoardOptions(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_faros_VcsRepositoryOptions(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_geo_Address(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_geo_Coordinates(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_geo_Location(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_identity_Identity(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ims_ApplicationUptime(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ims_Incident(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ims_IncidentApplicationImpact(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ims_IncidentAssignment(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ims_IncidentEvent(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ims_IncidentTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ims_IncidentTasks(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ims_Label(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ims_Team(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ims_TeamIncidentAssociation(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_ims_TeamMembership(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_org_ApplicationOwnership(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_org_BoardOwnership(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_org_Department(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_org_Employee(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_org_EmployeeTool(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_org_PipelineOwnership(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_org_ProjectOwnership(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_org_RepositoryOwnership(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_org_Team(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_org_TeamMembership(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_org_TeamMetric(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_org_TeamTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_qa_CodeQuality(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_qa_TestCase(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_qa_TestCaseResult(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_qa_TestCaseStep(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_qa_TestCaseStepResult(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_qa_TestExecution(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_qa_TestExecutionCommitAssociation(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_qa_TestExecutionTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_qa_TestSuite(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_qa_TestSuiteTestCaseAssociation(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_survey_OrgTeam(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_survey_Question(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_survey_QuestionResponse(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_survey_QuestionTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_survey_Survey(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_survey_SurveyQuestionAssociation(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_survey_SurveyTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_survey_Team(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_survey_TeamMembership(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_survey_User(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_survey_UserIdentity(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_Epic(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_Label(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_Project(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_ProjectPath(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_ProjectReleaseRelationship(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_ProjectTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_Release(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_Sprint(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_SprintHistory(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_Task(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TaskAssignment(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TaskBoard(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TaskBoardPath(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TaskBoardProjectRelationship(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TaskBoardRelationship(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TaskBoardTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TaskDependency(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TaskProjectRelationship(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TaskPullRequestAssociation(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TaskReleaseRelationship(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TaskTag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TaskTestCaseResultAssociation(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_Team(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_TeamMembership(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_User(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_tms_UserIdentity(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_Branch(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_BranchCommitAssociation(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_Commit(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_File(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_Label(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_Membership(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_Organization(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_OrganizationTool(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_PullRequest(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_PullRequestComment(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_PullRequestCommit(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_PullRequestFile(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_PullRequestLabel(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_PullRequestReview(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_PullRequestReviewRequest(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_Repository(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_RepositoryContribution(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_Tag(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_Team(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_TeamMembership(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_User(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_UserIdentity(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_UserTool(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
  delete_vcs_UserToolUsage(where: {origin: {_eq: "my_origin"}}) {
      returning {
        id
      }
    }
}

Note: You can use the following query to fetch a list of all types of objects in the Faros graph:

query IntrospectionQuery {
  __schema {
    queryType {
      fields {
        name
        description
      }
    }
  }
}