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

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.