Repository

Lookup a repository and associated information.

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://[email protected]",
      "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

FieldTypeDescription
inputRegenerateRepositoryDSNInput!Input for RegenerateRepositoryDSN mutation.

Sample Request

mutation ($input: RegenerateRepositoryDSNInput!) {
  regenerateRepositoryDSN(input: $input) {
    dsn
  }
}
variables = {
  "input": {
    "repositoryId": "VHJhbnNmb3JtZXI6bGp6a3d6"
  }
}

Sample Response

{
  "regenerateRepositoryDSN": {
    "dsn": "https://[email protected]"
  }
}

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

FieldTypeDescription
inputUpdateRepositoryDefaultBranchInput!Input for UpdateRepositoryDefaultBranch mutation

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

FieldTypeDescription
inputUpdateRepositoryIssueCategorySettingInput!Input for UpdateRepositoryIssueCategorySetting mutation.

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
    }
  }
}

Objects

Repository

FieldTypeDescription
idID!The ID of the object.
nameString!The name of this repository.
vcsProviderVCSProvider!VCS Provider of the repository.
vcsUrlString!URL of the repository on the VCS.
latestCommitOidStringObject ID of the latest commit on the default branch.
isPrivateBoolean!Repository visibility on the VCS provider.
isActivatedBoolean!Repository activation status.
configJsonJSONThe `.deepsource.toml` config of the repository represented as a JSON object.
defaultBranchStringThe default base branch of the repository on DeepSource.
dsnStringThe DSN value for this repository.
accountAccount!The account under which this repository exists.
analysisRunsAnalysisRunConnectionPast analysis runs for the repository
offsetInt
beforeString
afterString
firstInt
lastInt
enabledAnalyzersAnalyzerConnectionThe analyzers enabled in this repository.
offsetInt
beforeString
afterString
firstInt
lastInt
issuesRepositoryIssueConnectionGet 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.
pathStringShow issues for this path only.
offsetInt
beforeString
afterString
firstInt
lastInt
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
reportReport!A report associated with this repository.
keyReportKey!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 configuration for the repository.

RepositoryIssue

FieldTypeDescription
idID!The ID of the object.
issueIssue!Definition of the issue that has been raised.
occurrencesOccurrenceConnectionAll occurrences of this issue in the default branch.
offsetInt
beforeString
afterString
firstInt
lastInt
repositoryRepository!The repository for which this issue has been raised.

RepositoryIssueConnection

FieldTypeDescription
pageInfoPageInfo!Pagination data for this connection.
edgesRepositoryIssueEdge!Contains the nodes in this connection.
totalCountInt

RepositoryIssueEdge

A Relay edge containing a RepositoryIssue and its cursor.

FieldTypeDescription
nodeRepositoryIssueThe item at the end of the edge.
cursorString!A cursor for use in pagination.

RepositoryConnection

FieldTypeDescription
pageInfoPageInfo!Pagination data for this connection.
edges[RepositoryEdge]!Contains the nodes in this connection.
totalCountInt

RepositoryEdge

A Relay edge containing a Repository and its cursor.

FieldTypeDescription
nodeRepositoryThe item at the end of the edge.
cursorString!A cursor for use in pagination.

RegenerateRepositoryDSNInput

Input for the regenerateRepositoryDSN mutation.

FieldTypeDescription
repositoryIdID!GraphQL node ID of the repository.

RegenerateRepositoryDSNPayload

Payload for the regenerateRepositoryDSN mutation.

FieldTypeDescription
dsnString!The new DSN for the repository.

UpdateRepositoryDefaultBranchInput

Input for the updateRepositoryDefaultBranch mutation.

FieldTypeDescription
idID!GraphQL node ID of the repository.
defaultBranchNameString!Default branch for analysis on the repository.

UpdateRepositoryDefaultBranchPayload

Payload for the updateRepositoryDefaultBranch mutation.

FieldTypeDescription
okBoolean!Whether the operation was successful.
repositoryRepository!Repository type.

UpdateRepositoryIssueCategorySettingInput

Input for the updateRepositoryIssueCategorySetting mutation.

FieldTypeDescription
repositoryIdID!The repository's ID.
issueCategoryIssueCategory!The issue category you want to update.
isReportedBoolean!Whether issues of a given category are enabled for reporting in the repository.
canFailCheckBoolean!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.

FieldTypeDescription
okBoolean!Whether the operation was successful.