repository
Query:repository
Fetch the details of one of your repositories.
Arguments
Field Type Description name String !The name of the repository to lookup. login String !The login or username of the account under which the repository exists. vcsProvider VCSProvider !VCS Provider of the account.
Sample Request
query {
repository (
name : "demo-go" ,
login : "cyberdyne" ,
vcsProvider : GITHUB
) {
name
defaultBranch
dsn
isPrivate
analysisRuns {
edges {
node {
runUid
}
}
}
}
}
Sample Response
{
"data" : {
"repository" : {
"name" : "demo-go" ,
"defaultBranch" : "master" ,
"dsn" : "https://e8d31028303641b7b756ca624df14ac7@deepsource.io" ,
"isPrivate" : true ,
"analysisRuns" : {
"edges" : [
{
"node" : {
"runUid" : "5d821174-04vf-4214-b56d-ced0a7ca209e"
}
} ,
{
"node" : {
"runUid" : "6ff1cdb8-9abe-4307-a177-4b9f8d3ba639"
}
} ,
]
}
}
}
}
regenerateRepositoryDSN
Mutation:regenerateRepositoryDSN
Regenerate a repository’s DSN.
Arguments
Sample Request
mutation ( $input : RegenerateRepositoryDSNInput ! ) {
regenerateRepositoryDSN ( input : $input ) {
dsn
}
}
variables = {
"input" : {
"repositoryId" : "VHJhbnNmb3JtZXI6bGp6a3d6"
}
}
Sample Response
{
"regenerateRepositoryDSN" : {
"dsn" : "https://e8d31028303641b7b756ca624df14ac7@deepsource.io"
}
}
updateRepositoryDefaultBranch
Mutation:updateRepositoryDefaultBranch
Update a repository’s default branch for baseline. If the repository is activated, this action will trigger a new analysis. Only available to users with WRITE
permission on the repository.
Arguments
Sample Request
mutation ( $input : UpdateRepositoryDefaultBranchInput ! ) {
updateRepositoryDefaultBranch ( input : $input ) {
ok
repository {
defaultBranchName
}
}
}
variables = {
"input" : {
"id" : "VHJhbnNmb3JtZXI6bGp6a3d6" ,
"defaultBranchName" : "add-awesomeness"
}
}
Sample Response
{
"updateRepositoryDefaultBranch" : {
"ok" : true ,
"repository" : { "defaultBranchName" : "add-awesomeness" }
}
}
updateRepositoryIssueCategorySetting
Mutation:updateRepositoryIssueCategorySetting
Update a repository’s issue configuration (also known as quality gates). Only users with WRITE
permission on the repository can trigger this mutation.
Arguments
Sample Request
mutation ( $input : UpdateRepositoryIssueCategorySettingInput ! ) {
updateRepositoryIssueCategorySetting ( input : $input ) {
ok
}
}
{
"input" : {
"repositoryId" : "Umwm3NpdG9yeTprZ3dyb222" ,
"issueCategory" : "ANTI_PATTERN" ,
"isReported" : true ,
"canFailCheck" : false
}
}
Sample Response
{
"data" : {
"updateRepositoryIssueCategorySetting" : {
"ok" : true
}
}
}
updateRepositoryIssuePrioritySetting
Mutation:updateRepositoryIssuePrioritySetting
Update a repository’s issue priority configuration (also known as quality gates). Only users with WRITE
permission on the repository can trigger this mutation.
Arguments
Sample Request
mutation updateRepositoryIssuePrioritySetting ( $input : UpdateRepositoryIssuePrioritySettingInput ! ) {
updateRepositoryIssuePrioritySetting ( input : $input ) {
ok
}
}
{
"input" : {
"repositoryId" : "Umvwb2NpdG9yeTphanZqcGx=" ,
"issuePriorityType" : "LOW" ,
"isReported" : true ,
"canFailCheck" : false
}
}
Sample Response
{
"data" : {
"updateRepositoryIssuePrioritySetting" : {
"ok" : true
}
}
}
updateRepositoryMetricSetting
Mutation:updateRepositoryMetricSetting
Update a repository’s metric quality gates configuration. Only users with WRITE
permission on the repository can trigger this mutation.
Arguments
Sample Request
mutation UpdateRepositoryMetricSetting ( $input : UpdateRepositoryMetricSettingInput ! ) {
updateRepositoryMetricSetting ( input : $input ) {
ok
}
}
{
"input" : {
"repositoryId" : "Umvwb2NpdG9yeTphanZqcGx=" ,
"metricShortcode" : "LCV" ,
"isReported" : true ,
"isThresholdEnforced" : true
}
}
Sample Response
{
"data" : {
"updateRepositoryMetricSetting" : {
"ok" : true
}
}
}
activateRepository
Mutation:activateRepository
Activate analysis on a repository. Only users with WRITE
permission on the repository can trigger this mutation.
Arguments
Sample Request
mutation ( $input : ActivateRepositoryInput ! ) {
activateRepository ( input : $input ) {
ok
}
}
{
"input" : {
"repositoryId" : "Umwm3NpdG9yeTprZ3dyb222"
}
}
Sample Response
{
"data" : {
"activateRepository" : {
"ok" : true
}
}
}
deactivateRepository
Mutation:deactivateRepository
Deactivate analysis on a repository. Only users with WRITE
permission on the repository can trigger this mutation.
Arguments
Sample Request
mutation ( $input : DeactivateRepositoryInput ! ) {
deactivateRepository ( input : $input ) {
ok
}
}
{
"input" : {
"repositoryId" : "Umwm3NpdG9yeTprZ3dyb222"
}
}
Sample Response
{
"data" : {
"deactivateRepository" : {
"ok" : true
}
}
}
Objects
Repository
Field Type Description id ID !The ID of the object. name String !The name of this repository. vcsProvider VCSProvider !VCS Provider of the repository. vcsUrl String !URL of the repository on the VCS. latestCommitOid String Object ID of the latest commit on the default branch. isPrivate Boolean !Repository visibility on the VCS provider. isActivated Boolean !Repository activation status. configJson JSON The `.deepsource.toml` config of the repository represented as a JSON object. defaultBranch String The default base branch of the repository on DeepSource. dsn String The DSN value for this repository. account Account !The account under which this repository exists. analysisRuns AnalysisRunConnection Past analysis runs for the repository offset Int before String after String first Int last Int enabledAnalyzers AnalyzerConnection The analyzers enabled in this repository. offset Int before String after String first Int last Int issues RepositoryIssueConnection Get all issues raised in the default branch of this repository. Specifying a path would only return those issues whose occurrences are present in the file at path. path String Show issues for this path only. offset Int before String after String first Int last Int ignoreRules IgnoreRuleConnection List of `IgnoreRule`s that exist for the repository. issueShortcode String Filter by an `Issue` shortcode. filePath String Filter by a specific file’s path. offset Int before String after String first Int last Int report Report !A report associated with this repository. key ReportKey !The key of the report to fetch. metrics [RepositoryMetric !]! List of all DeepSource metrics. shortcodeIn [MetricShortcode ] List of metric shortcodes to filter on. issueCategorySettings [IssueCategorySetting !]! Issue categories quality gates configuration for the repository. issuePrioritySettings [IssuePrioritySetting !]! Issue priority quality gates configuration for the repository. metricSettings [MetricSetting !]! Metric quality gates configuration for the repository.
RepositoryIssue
Field Type Description id ID !The ID of the object. issue Issue !Definition of the issue that has been raised. occurrences OccurrenceConnection All occurrences of this issue in the default branch. offset Int before String after String first Int last Int repository Repository !The repository for which this issue has been raised.
RepositoryIssueConnection
RepositoryIssueEdge
A Relay edge containing a RepositoryIssue
and its cursor.
Field Type Description node RepositoryIssue The item at the end of the edge. cursor String !A cursor for use in pagination.
RepositoryConnection
Field Type Description pageInfo PageInfo !Pagination data for this connection. edges [RepositoryEdge ]! Contains the nodes in this connection. totalCount Int
RepositoryEdge
A Relay edge containing a Repository
and its cursor.
Field Type Description node Repository The item at the end of the edge. cursor String !A cursor for use in pagination.
Input for the regenerateRepositoryDSN
mutation.
Field Type Description repositoryId ID !GraphQL node ID of the repository.
RegenerateRepositoryDSNPayload
Payload for the regenerateRepositoryDSN
mutation.
Field Type Description dsn String !The new DSN for the repository.
Input for the updateRepositoryDefaultBranch
mutation.
Field Type Description id ID! GraphQL node ID of the repository. defaultBranchName String! Default branch for analysis on the repository.
UpdateRepositoryDefaultBranchPayload
Payload for the updateRepositoryDefaultBranch
mutation.
Field Type Description ok Boolean! Whether the operation was successful. repository Repository! Repository
type.
Input for the updateRepositoryIssueCategorySetting
mutation.
Field Type Description repositoryId ID !The repository’s ID. issueCategory IssueCategory !The issue category you want to update. isReported Boolean !Whether issues of a given category are enabled for reporting in the repository. canFailCheck Boolean !Whether to fail checks when occurrence(s) of issues of a given category is found in the repository, an issue category can only be marked to fail a check if it is enabled for reporting.
UpdateRepositoryIssueCategorySettingPayload
Paylod for the updateRepositoryIssueCategorySetting
mutation.
Field Type Description ok Boolean !Whether the operation was successful.
Input for the updateRepositoryIssuePrioritySetting
mutation.
Field Type Description repositoryId ID !The repository’s ID. issuePriorityType IssuePriorityType !The issue priority you want to update. isReported Boolean !Whether issues of a given category are enabled for reporting in the repository. canFailCheck Boolean !Whether to fail checks when occurrence(s) of issues of a given category is found in the repository, an issue category can only be marked to fail a check if it is enabled for reporting.
UpdateRepositoryIssuePrioritySettingPayload
Payload for the updateRepositoryIssuePrioritySetting
mutation.
Field Type Description ok Boolean !Whether the operation was successful.
Input for the updateRepositoryMetricSetting
mutation.
Field Type Description repositoryId ID !The repository’s ID. metricShortcode MetricShortcode !The shortcode of the metric you want to update. isReported Boolean !Whether the metric is enabled for reporting in the repository. isThresholdEnforced Boolean !Whether to fail checks when the metric does not meet the threshold.
UpdateRepositoryMetricSettingPayload
Payload for the updateRepositoryMetricSetting
mutation.
Field Type Description ok Boolean !Whether the operation was successful.
Input for the activateRepository
mutation.
Field Type Description repositoryId ID! GraphQL node ID of the repository.
ActivateRepositoryPayload
Payload for the activateRepository
mutation.
Field Type Description ok Boolean! Whether the operation was successful.
Input for the deactivateRepository
mutation.
Field Type Description repositoryId ID! GraphQL node ID of the repository.
DeactivateRepositoryPayload
Payload for the deactivateRepository
mutation.
Field Type Description ok Boolean! Whether the operation was successful.