Sourcegraph API
Queries
areExecutorsConfigured
Description
Returns true if executors have been configured on the Sourcegraph instance. This is based on heuristics and doesn't necessarily mean that they would be working.
Response
Returns a Boolean!
Example
Query
query areExecutorsConfigured {
areExecutorsConfigured
}
Response
{"data": {"areExecutorsConfigured": false}}
autocompleteMembersSearch
Description
Search for users that opt-in to search autocomplete.
Response
Returns [AutocompleteMemberSearchItem!]!
Example
Query
query autocompleteMembersSearch(
$organization: ID!,
$query: String!
) {
autocompleteMembersSearch(
organization: $organization,
query: $query
) {
id
username
displayName
avatarURL
inOrg
}
}
Variables
{"organization": 4, "query": "abc123"}
Response
{
"data": {
"autocompleteMembersSearch": [
{
"id": "4",
"username": "abc123",
"displayName": "xyz789",
"avatarURL": "xyz789",
"inOrg": false
}
]
}
}
backgroundJobs
Description
Get a list of background jobs that are currently known in the system.
Response
Returns a BackgroundJobConnection!
Example
Query
query backgroundJobs(
$first: Int,
$after: String,
$recentRunCount: Int
) {
backgroundJobs(
first: $first,
after: $after,
recentRunCount: $recentRunCount
) {
nodes {
...BackgroundJobFragment
}
totalCount
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"first": 987,
"after": "abc123",
"recentRunCount": 123
}
Response
{
"data": {
"backgroundJobs": {
"nodes": [BackgroundJob],
"totalCount": 123,
"pageInfo": PageInfo
}
}
}
clientConfiguration
Description
The configuration for clients.
Response
Returns a ClientConfigurationDetails!
Example
Query
query clientConfiguration {
clientConfiguration {
contentScriptUrls
parentSourcegraph {
...ParentSourcegraphDetailsFragment
}
}
}
Response
{
"data": {
"clientConfiguration": {
"contentScriptUrls": ["xyz789"],
"parentSourcegraph": ParentSourcegraphDetails
}
}
}
codeHostSyncDue
Description
Returns true if any of the code hosts supplied are syncing now or within "seconds" from now.
currentUser
Description
The current user.
Response
Returns a User
Example
Query
query currentUser {
currentUser {
executorSecrets {
...ExecutorSecretConnectionFragment
}
id
username
email
displayName
avatarURL
url
settingsURL
createdAt
updatedAt
siteAdmin
builtinAuth
latestSettings {
...SettingsFragment
}
settingsCascade {
...SettingsCascadeFragment
}
configurationCascade {
...ConfigurationCascadeFragment
}
organizations {
...OrgConnectionFragment
}
organizationMemberships {
...OrganizationMembershipConnectionFragment
}
tags
tosAccepted
searchable
usageStatistics {
...UserUsageStatisticsFragment
}
eventLogs {
...EventLogsConnectionFragment
}
emails {
...UserEmailFragment
}
accessTokens {
...AccessTokenConnectionFragment
}
externalAccounts {
...ExternalAccountConnectionFragment
}
session {
...SessionFragment
}
viewerCanAdminister
viewerCanChangeUsername
surveyResponses {
...SurveyResponseFragment
}
databaseID
namespaceName
invitableCollaborators {
...PersonFragment
}
teams {
...TeamConnectionFragment
}
}
}
Response
{
"data": {
"currentUser": {
"executorSecrets": ExecutorSecretConnection,
"id": "4",
"username": "xyz789",
"email": "xyz789",
"displayName": "xyz789",
"avatarURL": "xyz789",
"url": "xyz789",
"settingsURL": "xyz789",
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z",
"siteAdmin": false,
"builtinAuth": false,
"latestSettings": Settings,
"settingsCascade": SettingsCascade,
"configurationCascade": ConfigurationCascade,
"organizations": OrgConnection,
"organizationMemberships": OrganizationMembershipConnection,
"tags": ["abc123"],
"tosAccepted": true,
"searchable": false,
"usageStatistics": UserUsageStatistics,
"eventLogs": EventLogsConnection,
"emails": [UserEmail],
"accessTokens": AccessTokenConnection,
"externalAccounts": ExternalAccountConnection,
"session": Session,
"viewerCanAdminister": false,
"viewerCanChangeUsername": true,
"surveyResponses": [SurveyResponse],
"databaseID": 987,
"namespaceName": "abc123",
"invitableCollaborators": [Person],
"teams": TeamConnection
}
}
}
evaluateFeatureFlag
Description
Evaluates a feature flag for the current user Returns null if feature flag does not exist
evaluatedFeatureFlags
Description
Retrieve all evaluated feature flags for the current user
Response
Returns [EvaluatedFeatureFlag!]!
Example
Query
query evaluatedFeatureFlags {
evaluatedFeatureFlags {
name
value
}
}
Response
{
"data": {
"evaluatedFeatureFlags": [
{"name": "xyz789", "value": true}
]
}
}
executorSecrets
Description
The list of all globally available executor secrets.
Response
Returns an ExecutorSecretConnection!
Arguments
Name | Description |
---|---|
scope - ExecutorSecretScope! | The scope for which secrets shall be returned. |
first - Int | Only return N records. Default = 50 |
after - String | Opaque cursor for pagination. |
Example
Query
query executorSecrets(
$scope: ExecutorSecretScope!,
$first: Int,
$after: String
) {
executorSecrets(
scope: $scope,
first: $first,
after: $after
) {
nodes {
...ExecutorSecretFragment
}
totalCount
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"scope": "BATCHES",
"first": 50,
"after": "xyz789"
}
Response
{
"data": {
"executorSecrets": {
"nodes": [ExecutorSecret],
"totalCount": 987,
"pageInfo": PageInfo
}
}
}
executors
Description
Retrieve active executor compute instances.
Response
Returns an ExecutorConnection!
Arguments
Name | Description |
---|---|
query - String | An (optional) search query that searches over the hostname, queue name, os, architecture, and version properties. |
active - Boolean | Whether to show only executors that have sent a heartbeat in the last fifteen minutes. |
first - Int | Returns the first n executors. Default = 50 |
after - String | Opaque pagination cursor. |
Example
Query
query executors(
$query: String,
$active: Boolean,
$first: Int,
$after: String
) {
executors(
query: $query,
active: $active,
first: $first,
after: $after
) {
nodes {
...ExecutorFragment
}
totalCount
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"query": "xyz789",
"active": false,
"first": 50,
"after": "xyz789"
}
Response
{
"data": {
"executors": {
"nodes": [Executor],
"totalCount": 987,
"pageInfo": PageInfo
}
}
}
extensionRegistry
Description
The extension registry.
Response
Returns an ExtensionRegistry!
Example
Query
query extensionRegistry {
extensionRegistry {
extensions {
...RegistryExtensionConnectionFragment
}
}
}
Response
{
"data": {
"extensionRegistry": {
"extensions": RegistryExtensionConnection
}
}
}
externalServiceNamespaces
Description
Lists all namespaces for a given external service connection. A namespace is an entity on the code host that repositories are assignable to.
Response
Returns an ExternalServiceNamespaceConnection!
Arguments
Name | Description |
---|---|
kind - ExternalServiceKind! | The kind of the external service. |
token - String! | The secret token value that is used to authenticate. |
url - String! | The url of the external service. |
Example
Query
query externalServiceNamespaces(
$kind: ExternalServiceKind!,
$token: String!,
$url: String!
) {
externalServiceNamespaces(
kind: $kind,
token: $token,
url: $url
) {
nodes {
...ExternalServiceNamespaceFragment
}
totalCount
}
}
Variables
{
"kind": "AWSCODECOMMIT",
"token": "abc123",
"url": "abc123"
}
Response
{
"data": {
"externalServiceNamespaces": {
"nodes": [ExternalServiceNamespace],
"totalCount": 987
}
}
}
externalServices
Description
Lists external services under given namespace. If no namespace is given, it returns all external services.
Response
Returns an ExternalServiceConnection!
Example
Query
query externalServices(
$first: Int,
$after: String
) {
externalServices(
first: $first,
after: $after
) {
nodes {
...ExternalServiceFragment
}
totalCount
pageInfo {
...PageInfoFragment
}
}
}
Variables
{"first": 123, "after": "abc123"}
Response
{
"data": {
"externalServices": {
"nodes": [ExternalService],
"totalCount": 123,
"pageInfo": PageInfo
}
}
}
featureFlag
Description
Retrieve a feature flag
Response
Returns a FeatureFlag!
Arguments
Name | Description |
---|---|
name - String! |
Example
Query
query featureFlag($name: String!) {
featureFlag(name: $name) {
... on FeatureFlagBoolean {
...FeatureFlagBooleanFragment
}
... on FeatureFlagRollout {
...FeatureFlagRolloutFragment
}
}
}
Variables
{"name": "abc123"}
Response
{"data": {"featureFlag": FeatureFlagBoolean}}
featureFlags
Description
Retrieve the list of defined feature flags
Response
Returns [FeatureFlag!]!
Example
Query
query featureFlags {
featureFlags {
... on FeatureFlagBoolean {
...FeatureFlagBooleanFragment
}
... on FeatureFlagRollout {
...FeatureFlagRolloutFragment
}
}
}
Response
{"data": {"featureFlags": [FeatureFlagBoolean]}}
highlightCode
Description
EXPERIMENTAL: Syntax highlights a code string.
Response
Returns a String!
Example
Query
query highlightCode(
$code: String!,
$fuzzyLanguage: String!,
$disableTimeout: Boolean!
) {
highlightCode(
code: $code,
fuzzyLanguage: $fuzzyLanguage,
disableTimeout: $disableTimeout
)
}
Variables
{
"code": "xyz789",
"fuzzyLanguage": "xyz789",
"disableTimeout": true
}
Response
{"data": {"highlightCode": "xyz789"}}
invitationByToken
Description
(experimental) Get invitation based on the JWT in the invitation URL
Response
Returns an OrganizationInvitation!
Arguments
Name | Description |
---|---|
token - String! | The token that uniquely identifies the invitation |
Example
Query
query invitationByToken($token: String!) {
invitationByToken(token: $token) {
id
organization {
...OrgFragment
}
sender {
...UserFragment
}
recipient {
...UserFragment
}
recipientEmail
createdAt
notifiedAt
respondedAt
responseType
respondURL
revokedAt
expiresAt
isVerifiedEmail
}
}
Variables
{"token": "xyz789"}
Response
{
"data": {
"invitationByToken": {
"id": "4",
"organization": Org,
"sender": User,
"recipient": User,
"recipientEmail": "xyz789",
"createdAt": "2007-12-03T10:15:30Z",
"notifiedAt": "2007-12-03T10:15:30Z",
"respondedAt": "2007-12-03T10:15:30Z",
"responseType": "ACCEPT",
"respondURL": "xyz789",
"revokedAt": "2007-12-03T10:15:30Z",
"expiresAt": "2007-12-03T10:15:30Z",
"isVerifiedEmail": false
}
}
}
namespace
Description
Look up a namespace by ID.
namespaceByName
Description
Look up a namespace by name, which is a username or organization name.
Example
Query
query namespaceByName($name: String!) {
namespaceByName(name: $name) {
id
namespaceName
url
}
}
Variables
{"name": "abc123"}
Response
{
"data": {
"namespaceByName": {
"id": 4,
"namespaceName": "abc123",
"url": "xyz789"
}
}
}
node
Description
Looks up a node by ID.
orgMembersSummary
Description
Get started organization summary
Response
Returns an OrgMembersSummary!
Arguments
Name | Description |
---|---|
organization - ID! | The organization ID |
Example
Query
query orgMembersSummary($organization: ID!) {
orgMembersSummary(organization: $organization) {
id
membersCount
invitesCount
}
}
Variables
{"organization": "4"}
Response
{
"data": {
"orgMembersSummary": {
"id": "4",
"membersCount": 123,
"invitesCount": 987
}
}
}
organization
Description
Looks up an organization by name.
Example
Query
query organization($name: String!) {
organization(name: $name) {
executorSecrets {
...ExecutorSecretConnectionFragment
}
id
name
displayName
createdAt
members {
...NewUsersConnectionFragment
}
latestSettings {
...SettingsFragment
}
settingsCascade {
...SettingsCascadeFragment
}
configurationCascade {
...ConfigurationCascadeFragment
}
viewerPendingInvitation {
...OrganizationInvitationFragment
}
viewerCanAdminister
viewerIsMember
url
settingsURL
namespaceName
}
}
Variables
{"name": "abc123"}
Response
{
"data": {
"organization": {
"executorSecrets": ExecutorSecretConnection,
"id": 4,
"name": "xyz789",
"displayName": "abc123",
"createdAt": "2007-12-03T10:15:30Z",
"members": NewUsersConnection,
"latestSettings": Settings,
"settingsCascade": SettingsCascade,
"configurationCascade": ConfigurationCascade,
"viewerPendingInvitation": OrganizationInvitation,
"viewerCanAdminister": false,
"viewerIsMember": true,
"url": "abc123",
"settingsURL": "xyz789",
"namespaceName": "xyz789"
}
}
}
organizationFeatureFlagOverrides
Description
Retrieve all organization feature flag overrides for the current user
Response
Returns [FeatureFlagOverride!]!
Example
Query
query organizationFeatureFlagOverrides {
organizationFeatureFlagOverrides {
id
namespace {
...NamespaceFragment
}
targetFlag {
... on FeatureFlagBoolean {
...FeatureFlagBooleanFragment
}
... on FeatureFlagRollout {
...FeatureFlagRolloutFragment
}
}
value
}
}
Response
{
"data": {
"organizationFeatureFlagOverrides": [
{
"id": "4",
"namespace": Namespace,
"targetFlag": FeatureFlagBoolean,
"value": true
}
]
}
}
organizationFeatureFlagValue
Description
Retrieve the value of a feature flag for the organization
Example
Query
query organizationFeatureFlagValue(
$orgID: ID!,
$flagName: String!
) {
organizationFeatureFlagValue(
orgID: $orgID,
flagName: $flagName
)
}
Variables
{
"orgID": "4",
"flagName": "xyz789"
}
Response
{"data": {"organizationFeatureFlagValue": true}}
organizations
Description
List all organizations.
Response
Returns an OrgConnection!
Example
Query
query organizations(
$first: Int,
$query: String
) {
organizations(
first: $first,
query: $query
) {
nodes {
...OrgFragment
}
totalCount
}
}
Variables
{"first": 123, "query": "xyz789"}
Response
{
"data": {
"organizations": {"nodes": [Org], "totalCount": 123}
}
}
outOfBandMigrations
Description
Retrieve all registered out-of-band migrations.
Response
Returns [OutOfBandMigration!]!
Example
Query
query outOfBandMigrations {
outOfBandMigrations {
id
team
component
description
introduced
deprecated
progress
created
lastUpdated
nonDestructive
applyReverse
errors {
...OutOfBandMigrationErrorFragment
}
}
}
Response
{
"data": {
"outOfBandMigrations": [
{
"id": 4,
"team": "xyz789",
"component": "abc123",
"description": "xyz789",
"introduced": "abc123",
"deprecated": "abc123",
"progress": 123.45,
"created": "2007-12-03T10:15:30Z",
"lastUpdated": "2007-12-03T10:15:30Z",
"nonDestructive": false,
"applyReverse": true,
"errors": [OutOfBandMigrationError]
}
]
}
}
outboundRequests
Description
Get a log of the latest outbound external requests. Only available to site admins.
Response
Returns an OutboundRequestConnection!
Example
Query
query outboundRequests(
$first: Int,
$after: String
) {
outboundRequests(
first: $first,
after: $after
) {
nodes {
...OutboundRequestFragment
}
totalCount
pageInfo {
...PageInfoFragment
}
}
}
Variables
{"first": 123, "after": "abc123"}
Response
{
"data": {
"outboundRequests": {
"nodes": [OutboundRequest],
"totalCount": 987,
"pageInfo": PageInfo
}
}
}
packageRepoReferences
Description
Query package repo references.
Response
Returns a PackageRepoReferenceConnection!
Arguments
Name | Description |
---|---|
scheme - PackageRepoReferenceKind | The exact scheme value to filter by. |
name - String | If supplied, only package repo references that match the given terms by their name will be returned. TODO: fuzzy vs exact? |
first - Int | Returns the first n external services from the list. |
after - String | Opaque pagination cursor. |
Example
Query
query packageRepoReferences(
$scheme: PackageRepoReferenceKind,
$name: String,
$first: Int,
$after: String
) {
packageRepoReferences(
scheme: $scheme,
name: $name,
first: $first,
after: $after
) {
nodes {
...PackageRepoReferenceFragment
}
totalCount
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"scheme": "GOMODULES",
"name": "abc123",
"first": 123,
"after": "abc123"
}
Response
{
"data": {
"packageRepoReferences": {
"nodes": [PackageRepoReference],
"totalCount": 123,
"pageInfo": PageInfo
}
}
}
parseSearchQuery
Description
(experimental) Return the parse tree of a search query.
Response
Returns a String!
Arguments
Name | Description |
---|---|
query - String | The search query (such as "repo:myrepo foo"). Default = "" |
patternType - SearchPatternType | The parser to use for this query. Default = standard |
outputPhase - SearchQueryOutputPhase | The output corresponding to a phase in the parser pipeline. Default = PARSE_TREE |
outputFormat - SearchQueryOutputFormat | The parser output format. Default = JSON |
outputVerbosity - SearchQueryOutputVerbosity | The level of output format verbosity. Default = BASIC |
Example
Query
query parseSearchQuery(
$query: String,
$patternType: SearchPatternType,
$outputPhase: SearchQueryOutputPhase,
$outputFormat: SearchQueryOutputFormat,
$outputVerbosity: SearchQueryOutputVerbosity
) {
parseSearchQuery(
query: $query,
patternType: $patternType,
outputPhase: $outputPhase,
outputFormat: $outputFormat,
outputVerbosity: $outputVerbosity
)
}
Variables
{
"query": "",
"patternType": "standard",
"outputPhase": "PARSE_TREE",
"outputFormat": "JSON",
"outputVerbosity": "BASIC"
}
Response
{"data": {"parseSearchQuery": "abc123"}}
pendingInvitations
Description
Get pending invitations for the specific organization
Response
Returns [OrganizationInvitation!]!
Arguments
Name | Description |
---|---|
organization - ID! | The organization ID |
Example
Query
query pendingInvitations($organization: ID!) {
pendingInvitations(organization: $organization) {
id
organization {
...OrgFragment
}
sender {
...UserFragment
}
recipient {
...UserFragment
}
recipientEmail
createdAt
notifiedAt
respondedAt
responseType
respondURL
revokedAt
expiresAt
isVerifiedEmail
}
}
Variables
{"organization": "4"}
Response
{
"data": {
"pendingInvitations": [
{
"id": "4",
"organization": Org,
"sender": User,
"recipient": User,
"recipientEmail": "xyz789",
"createdAt": "2007-12-03T10:15:30Z",
"notifiedAt": "2007-12-03T10:15:30Z",
"respondedAt": "2007-12-03T10:15:30Z",
"responseType": "ACCEPT",
"respondURL": "abc123",
"revokedAt": "2007-12-03T10:15:30Z",
"expiresAt": "2007-12-03T10:15:30Z",
"isVerifiedEmail": false
}
]
}
}
phabricatorRepo
Description
Looks up a Phabricator repository by name.
Response
Returns a PhabricatorRepo
Example
Query
query phabricatorRepo(
$name: String,
$uri: String
) {
phabricatorRepo(
name: $name,
uri: $uri
) {
name
uri
callsign
url
}
}
Variables
{
"name": "abc123",
"uri": "abc123"
}
Response
{
"data": {
"phabricatorRepo": {
"name": "xyz789",
"uri": "abc123",
"callsign": "abc123",
"url": "xyz789"
}
}
}
renderMarkdown
Description
Renders Markdown to HTML. The returned HTML is already sanitized and escaped and thus is always safe to render.
Response
Returns a String!
Arguments
Name | Description |
---|---|
markdown - String! | |
options - MarkdownOptions |
Example
Query
query renderMarkdown(
$markdown: String!,
$options: MarkdownOptions
) {
renderMarkdown(
markdown: $markdown,
options: $options
)
}
Variables
{
"markdown": "xyz789",
"options": MarkdownOptions
}
Response
{"data": {"renderMarkdown": "abc123"}}
repositories
Description
List all repositories.
Response
Returns a NewRepositoryConnection!
Arguments
Name | Description |
---|---|
first - Int | Returns the first n repositories from the list. |
last - Int | Returns the last n repositories from the list. |
query - String | Return repositories whose names match the query. |
after - String | An opaque cursor that is used for pagination. |
before - String | An opaque cursor that is used for pagination. |
names - [String!] | Return repositories whose names are in the list. |
cloned - Boolean | Include cloned repositories. Default = true |
cloneStatus - CloneStatus | Include only repositories of the given clone status. |
notCloned - Boolean | Include repositories that are not yet cloned and for which cloning is not in progress. Default = true |
indexed - Boolean | Include repositories that have a text search index. Default = true |
notIndexed - Boolean | Include repositories that do not have a text search index. Default = true |
failedFetch - Boolean | Include only repositories that have encountered errors when cloning or fetching. Default = false |
corrupted - Boolean | Include repositories that are corrupt. Default = false |
externalService - ID | Return repositories that are associated with the given external service. |
orderBy - RepositoryOrderBy | Sort field. Default = REPOSITORY_NAME |
descending - Boolean | Sort direction. Default = false |
Example
Query
query repositories(
$first: Int,
$last: Int,
$query: String,
$after: String,
$before: String,
$names: [String!],
$cloned: Boolean,
$cloneStatus: CloneStatus,
$notCloned: Boolean,
$indexed: Boolean,
$notIndexed: Boolean,
$failedFetch: Boolean,
$corrupted: Boolean,
$externalService: ID,
$orderBy: RepositoryOrderBy,
$descending: Boolean
) {
repositories(
first: $first,
last: $last,
query: $query,
after: $after,
before: $before,
names: $names,
cloned: $cloned,
cloneStatus: $cloneStatus,
notCloned: $notCloned,
indexed: $indexed,
notIndexed: $notIndexed,
failedFetch: $failedFetch,
corrupted: $corrupted,
externalService: $externalService,
orderBy: $orderBy,
descending: $descending
) {
nodes {
...RepositoryFragment
}
totalCount
pageInfo {
...ConnectionPageInfoFragment
}
}
}
Variables
{
"first": 987,
"last": 987,
"query": "xyz789",
"after": "xyz789",
"before": "xyz789",
"names": ["abc123"],
"cloned": true,
"cloneStatus": "NOT_CLONED",
"notCloned": true,
"indexed": true,
"notIndexed": true,
"failedFetch": false,
"corrupted": false,
"externalService": 4,
"orderBy": "REPOSITORY_NAME",
"descending": false
}
Response
{
"data": {
"repositories": {
"nodes": [Repository],
"totalCount": 123,
"pageInfo": ConnectionPageInfo
}
}
}
repository
Description
Looks up a repository by either name or cloneURL.
Response
Returns a Repository
Arguments
Name | Description |
---|---|
name - String | Query the repository by name, for example "github.com/gorilla/mux". |
cloneURL - String | Query the repository by a Git clone URL (format documented here: https://git-scm.com/docs/git-clone_git_urls_a_id_urls_a) by checking for a code host configuration that matches the clone URL. Will not actually check the code host to see if the repository actually exists. |
uri - String | An alias for name. DEPRECATED: use name instead. |
Example
Query
query repository(
$name: String,
$cloneURL: String,
$uri: String
) {
repository(
name: $name,
cloneURL: $cloneURL,
uri: $uri
) {
id
name
uri
description
language
createdAt
updatedAt
commit {
...GitCommitFragment
}
firstEverCommit {
...GitCommitFragment
}
mirrorInfo {
...MirrorRepositoryInfoFragment
}
externalRepository {
...ExternalRepositoryFragment
}
isFork
isArchived
isPrivate
externalServices {
...ExternalServiceConnectionFragment
}
cloneInProgress
textSearchIndex {
...RepositoryTextSearchIndexFragment
}
url
externalURLs {
...ExternalLinkFragment
}
defaultBranch {
...GitRefFragment
}
gitRefs {
...GitRefConnectionFragment
}
branches {
...GitRefConnectionFragment
}
tags {
...GitRefConnectionFragment
}
comparison {
...RepositoryComparisonFragment
}
contributors {
...RepositoryContributorConnectionFragment
}
viewerCanAdminister
label {
...MarkdownFragment
}
detail {
...MarkdownFragment
}
matches {
...SearchResultMatchFragment
}
codeIntelligenceCommitGraph {
...CodeIntelligenceCommitGraphFragment
}
stars
keyValuePairs {
...KeyValuePairFragment
}
diskSizeBytes
}
}
Variables
{
"name": "abc123",
"cloneURL": "abc123",
"uri": "abc123"
}
Response
{
"data": {
"repository": {
"id": "4",
"name": "xyz789",
"uri": "abc123",
"description": "abc123",
"language": "abc123",
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z",
"commit": GitCommit,
"firstEverCommit": GitCommit,
"mirrorInfo": MirrorRepositoryInfo,
"externalRepository": ExternalRepository,
"isFork": true,
"isArchived": true,
"isPrivate": true,
"externalServices": ExternalServiceConnection,
"cloneInProgress": true,
"textSearchIndex": RepositoryTextSearchIndex,
"url": "abc123",
"externalURLs": [ExternalLink],
"defaultBranch": GitRef,
"gitRefs": GitRefConnection,
"branches": GitRefConnection,
"tags": GitRefConnection,
"comparison": RepositoryComparison,
"contributors": RepositoryContributorConnection,
"viewerCanAdminister": true,
"label": Markdown,
"detail": Markdown,
"matches": [SearchResultMatch],
"codeIntelligenceCommitGraph": CodeIntelligenceCommitGraph,
"stars": 987,
"keyValuePairs": [KeyValuePair],
"diskSizeBytes": {}
}
}
}
repositoryRedirect
Description
Looks up a repository by either name or cloneURL or hashedName. When the repository does not exist on the server and "disablePublicRepoRedirects" is "false" in the site configuration, it returns a Redirect to an external Sourcegraph URL that may have this repository instead. Otherwise, this query returns null.
Response
Returns a RepositoryRedirect
Arguments
Name | Description |
---|---|
name - String | Query the repository by name, for example "github.com/gorilla/mux". |
cloneURL - String | Query the repository by a Git clone URL (format documented here: https://git-scm.com/docs/git-clone_git_urls_a_id_urls_a) by checking for a code host configuration that matches the clone URL. Will not actually check the code host to see if the repository actually exists. |
hashedName - String | Query the repository by hashed name. Hashed name is a SHA256 checksum of the absolute repo name in lower case, for example "github.com/sourcegraph/sourcegraph" -> "a6c905ceb7dec9a565945ceded8c7fa4154250df8b928fb40673b535d9a24c2f" |
Example
Query
query repositoryRedirect(
$name: String,
$cloneURL: String,
$hashedName: String
) {
repositoryRedirect(
name: $name,
cloneURL: $cloneURL,
hashedName: $hashedName
) {
... on Repository {
...RepositoryFragment
}
... on Redirect {
...RedirectFragment
}
}
}
Variables
{
"name": "abc123",
"cloneURL": "abc123",
"hashedName": "abc123"
}
Response
{"data": {"repositoryRedirect": Repository}}
repositoryStats
Description
FOR INTERNAL USE ONLY: Query repository statistics for the site.
Response
Returns a RepositoryStats!
Example
Query
query repositoryStats {
repositoryStats {
gitDirBytes
indexedLinesCount
total
cloned
cloning
notCloned
failedFetch
indexed
corrupted
}
}
Response
{
"data": {
"repositoryStats": {
"gitDirBytes": {},
"indexedLinesCount": {},
"total": 987,
"cloned": 987,
"cloning": 987,
"notCloned": 987,
"failedFetch": 123,
"indexed": 987,
"corrupted": 123
}
}
}
root
Description
The root of the query.
Response
Returns a Query!
Example
Query
query root {
root {
root {
...QueryFragment
}
node {
...NodeFragment
}
repository {
...RepositoryFragment
}
repositoryRedirect {
... on Repository {
...RepositoryFragment
}
... on Redirect {
...RedirectFragment
}
}
externalServices {
...ExternalServiceConnectionFragment
}
externalServiceNamespaces {
...ExternalServiceNamespaceConnectionFragment
}
repositories {
...NewRepositoryConnectionFragment
}
packageRepoReferences {
...PackageRepoReferenceConnectionFragment
}
phabricatorRepo {
...PhabricatorRepoFragment
}
currentUser {
...UserFragment
}
user {
...UserFragment
}
users {
...UserConnectionFragment
}
organization {
...OrgFragment
}
organizations {
...OrgConnectionFragment
}
renderMarkdown
highlightCode
settingsSubject {
...SettingsSubjectFragment
}
viewerSettings {
...SettingsCascadeFragment
}
viewerConfiguration {
...ConfigurationCascadeFragment
}
clientConfiguration {
...ClientConfigurationDetailsFragment
}
search {
...SearchFragment
}
savedSearches {
...SavedSearchesConnectionFragment
}
parseSearchQuery
site {
...SiteFragment
}
surveyResponses {
...SurveyResponseConnectionFragment
}
extensionRegistry {
...ExtensionRegistryFragment
}
statusMessages {
... on GitUpdatesDisabled {
...GitUpdatesDisabledFragment
}
... on CloningProgress {
...CloningProgressFragment
}
... on ExternalServiceSyncError {
...ExternalServiceSyncErrorFragment
}
... on SyncError {
...SyncErrorFragment
}
... on IndexingProgress {
...IndexingProgressFragment
}
}
repositoryStats {
...RepositoryStatsFragment
}
namespace {
...NamespaceFragment
}
namespaceByName {
...NamespaceFragment
}
codeHostSyncDue
outOfBandMigrations {
...OutOfBandMigrationFragment
}
featureFlags {
... on FeatureFlagBoolean {
...FeatureFlagBooleanFragment
}
... on FeatureFlagRollout {
...FeatureFlagRolloutFragment
}
}
featureFlag {
... on FeatureFlagBoolean {
...FeatureFlagBooleanFragment
}
... on FeatureFlagRollout {
...FeatureFlagRolloutFragment
}
}
evaluateFeatureFlag
evaluatedFeatureFlags {
...EvaluatedFeatureFlagFragment
}
organizationFeatureFlagValue
organizationFeatureFlagOverrides {
...FeatureFlagOverrideFragment
}
temporarySettings {
...TemporarySettingsFragment
}
webhookLogs {
...WebhookLogConnectionFragment
}
outboundRequests {
...OutboundRequestConnectionFragment
}
backgroundJobs {
...BackgroundJobConnectionFragment
}
invitationByToken {
...OrganizationInvitationFragment
}
pendingInvitations {
...OrganizationInvitationFragment
}
autocompleteMembersSearch {
...AutocompleteMemberSearchItemFragment
}
orgMembersSummary {
...OrgMembersSummaryFragment
}
webhooks {
...WebhookConnectionFragment
}
slowRequests {
...SlowRequestConnectionFragment
}
executorSecrets {
...ExecutorSecretConnectionFragment
}
executors {
...ExecutorConnectionFragment
}
areExecutorsConfigured
team {
...TeamFragment
}
teams {
...TeamConnectionFragment
}
}
}
Response
{
"data": {
"root": {
"root": Query,
"node": Node,
"repository": Repository,
"repositoryRedirect": Repository,
"externalServices": ExternalServiceConnection,
"externalServiceNamespaces": ExternalServiceNamespaceConnection,
"repositories": NewRepositoryConnection,
"packageRepoReferences": PackageRepoReferenceConnection,
"phabricatorRepo": PhabricatorRepo,
"currentUser": User,
"user": User,
"users": UserConnection,
"organization": Org,
"organizations": OrgConnection,
"renderMarkdown": "xyz789",
"highlightCode": "xyz789",
"settingsSubject": SettingsSubject,
"viewerSettings": SettingsCascade,
"viewerConfiguration": ConfigurationCascade,
"clientConfiguration": ClientConfigurationDetails,
"search": Search,
"savedSearches": SavedSearchesConnection,
"parseSearchQuery": "xyz789",
"site": Site,
"surveyResponses": SurveyResponseConnection,
"extensionRegistry": ExtensionRegistry,
"statusMessages": [GitUpdatesDisabled],
"repositoryStats": RepositoryStats,
"namespace": Namespace,
"namespaceByName": Namespace,
"codeHostSyncDue": true,
"outOfBandMigrations": [OutOfBandMigration],
"featureFlags": [FeatureFlagBoolean],
"featureFlag": FeatureFlagBoolean,
"evaluateFeatureFlag": true,
"evaluatedFeatureFlags": [EvaluatedFeatureFlag],
"organizationFeatureFlagValue": true,
"organizationFeatureFlagOverrides": [
FeatureFlagOverride
],
"temporarySettings": TemporarySettings,
"webhookLogs": WebhookLogConnection,
"outboundRequests": OutboundRequestConnection,
"backgroundJobs": BackgroundJobConnection,
"invitationByToken": OrganizationInvitation,
"pendingInvitations": [OrganizationInvitation],
"autocompleteMembersSearch": [
AutocompleteMemberSearchItem
],
"orgMembersSummary": OrgMembersSummary,
"webhooks": WebhookConnection,
"slowRequests": SlowRequestConnection,
"executorSecrets": ExecutorSecretConnection,
"executors": ExecutorConnection,
"areExecutorsConfigured": false,
"team": Team,
"teams": TeamConnection
}
}
}
savedSearches
Description
List of saved searches based on namespace
Response
Returns a SavedSearchesConnection!
Arguments
Name | Description |
---|---|
namespace - ID! | The namespace to list the saved searches for. |
first - Int | The limit argument for forward pagination. |
last - Int | The limit argument for backward pagination. |
after - String | The cursor argument for forward pagination. |
before - String | The cursor argument for backward pagination. |
Example
Query
query savedSearches(
$namespace: ID!,
$first: Int,
$last: Int,
$after: String,
$before: String
) {
savedSearches(
namespace: $namespace,
first: $first,
last: $last,
after: $after,
before: $before
) {
nodes {
...SavedSearchFragment
}
totalCount
pageInfo {
...ConnectionPageInfoFragment
}
}
}
Variables
{
"namespace": 4,
"first": 123,
"last": 123,
"after": "abc123",
"before": "xyz789"
}
Response
{
"data": {
"savedSearches": {
"nodes": [SavedSearch],
"totalCount": 987,
"pageInfo": ConnectionPageInfo
}
}
}
search
Description
Runs a search.
Response
Returns a Search
Arguments
Name | Description |
---|---|
version - SearchVersion | The version of the search syntax being used. All new clients should use the latest version. Default = V1 |
patternType - SearchPatternType | PatternType controls the search pattern type, if and only if it is not specified in the query string using the patternType: field. |
query - String | The search query (such as "foo" or "repo:myrepo foo"). Default = "" |
Example
Query
query search(
$version: SearchVersion,
$patternType: SearchPatternType,
$query: String
) {
search(
version: $version,
patternType: $patternType,
query: $query
) {
results {
...SearchResultsFragment
}
stats {
...SearchResultsStatsFragment
}
}
}
Variables
{"version": "V1", "patternType": "standard", "query": ""}
Response
{
"data": {
"search": {
"results": SearchResults,
"stats": SearchResultsStats
}
}
}
settingsSubject
Description
Looks up an instance of a type that implements SettingsSubject (i.e., something that has settings). This can be a site (which has global settings), an organization, or a user.
Response
Returns a SettingsSubject
Arguments
Name | Description |
---|---|
id - ID! |
Example
Query
query settingsSubject($id: ID!) {
settingsSubject(id: $id) {
id
latestSettings {
...SettingsFragment
}
settingsURL
viewerCanAdminister
settingsCascade {
...SettingsCascadeFragment
}
configurationCascade {
...ConfigurationCascadeFragment
}
}
}
Variables
{"id": "4"}
Response
{
"data": {
"settingsSubject": {
"id": 4,
"latestSettings": Settings,
"settingsURL": "abc123",
"viewerCanAdminister": false,
"settingsCascade": SettingsCascade,
"configurationCascade": ConfigurationCascade
}
}
}
site
Description
The current site.
Response
Returns a Site!
Example
Query
query site {
site {
id
siteID
configuration {
...SiteConfigurationFragment
}
latestSettings {
...SettingsFragment
}
settingsCascade {
...SettingsCascadeFragment
}
configurationCascade {
...ConfigurationCascadeFragment
}
settingsURL
canReloadSite
viewerCanAdminister
accessTokens {
...AccessTokenConnectionFragment
}
authProviders {
...AuthProviderConnectionFragment
}
externalAccounts {
...ExternalAccountConnectionFragment
}
buildVersion
productVersion
updateCheck {
...UpdateCheckFragment
}
needsRepositoryConfiguration
externalServicesFromFile
allowEditExternalServicesWithFile
freeUsersExceeded
alerts {
...AlertFragment
}
hasCodeIntelligence
sendsEmailVerificationEmails
productSubscription {
...ProductSubscriptionStatusFragment
}
usageStatistics {
...SiteUsageStatisticsFragment
}
analytics {
...AnalyticsFragment
}
users {
...SiteUsersFragment
}
monitoringStatistics {
...MonitoringStatisticsFragment
}
allowSiteSettingsEdits
enableLegacyExtensions
upgradeReadiness {
...UpgradeReadinessFragment
}
}
}
Response
{
"data": {
"site": {
"id": 4,
"siteID": "abc123",
"configuration": SiteConfiguration,
"latestSettings": Settings,
"settingsCascade": SettingsCascade,
"configurationCascade": ConfigurationCascade,
"settingsURL": "abc123",
"canReloadSite": true,
"viewerCanAdminister": false,
"accessTokens": AccessTokenConnection,
"authProviders": AuthProviderConnection,
"externalAccounts": ExternalAccountConnection,
"buildVersion": "xyz789",
"productVersion": "abc123",
"updateCheck": UpdateCheck,
"needsRepositoryConfiguration": true,
"externalServicesFromFile": false,
"allowEditExternalServicesWithFile": true,
"freeUsersExceeded": true,
"alerts": [Alert],
"hasCodeIntelligence": false,
"sendsEmailVerificationEmails": true,
"productSubscription": ProductSubscriptionStatus,
"usageStatistics": SiteUsageStatistics,
"analytics": Analytics,
"users": SiteUsers,
"monitoringStatistics": MonitoringStatistics,
"allowSiteSettingsEdits": true,
"enableLegacyExtensions": false,
"upgradeReadiness": UpgradeReadiness
}
}
}
slowRequests
Description
List slow GraphQL requests that were recently captured (requires site-admin permissions).
Response
Returns a SlowRequestConnection!
Arguments
Name | Description |
---|---|
after - String | Opaque pagnination cursor. |
Example
Query
query slowRequests($after: String) {
slowRequests(after: $after) {
nodes {
...SlowRequestFragment
}
totalCount
pageInfo {
...PageInfoFragment
}
}
}
Variables
{"after": "abc123"}
Response
{
"data": {
"slowRequests": {
"nodes": [SlowRequest],
"totalCount": 123,
"pageInfo": PageInfo
}
}
}
statusMessages
Description
FOR INTERNAL USE ONLY: Lists all status messages
Response
Returns [StatusMessage!]!
Example
Query
query statusMessages {
statusMessages {
... on GitUpdatesDisabled {
...GitUpdatesDisabledFragment
}
... on CloningProgress {
...CloningProgressFragment
}
... on ExternalServiceSyncError {
...ExternalServiceSyncErrorFragment
}
... on SyncError {
...SyncErrorFragment
}
... on IndexingProgress {
...IndexingProgressFragment
}
}
}
Response
{"data": {"statusMessages": [GitUpdatesDisabled]}}
surveyResponses
Description
Retrieve responses to surveys.
Response
Returns a SurveyResponseConnection!
Arguments
Name | Description |
---|---|
first - Int | Returns the first n survey responses from the list. |
Example
Query
query surveyResponses($first: Int) {
surveyResponses(first: $first) {
nodes {
...SurveyResponseFragment
}
totalCount
last30DaysCount
averageScore
netPromoterScore
}
}
Variables
{"first": 123}
Response
{
"data": {
"surveyResponses": {
"nodes": [SurveyResponse],
"totalCount": 123,
"last30DaysCount": 987,
"averageScore": 987.65,
"netPromoterScore": 123
}
}
}
team
Description
Get a single team by name. Returns null if not found.
Example
Query
query team($name: String!) {
team(name: $name) {
id
name
url
displayName
readonly
members {
...TeamMemberConnectionFragment
}
parentTeam {
...TeamFragment
}
childTeams {
...TeamConnectionFragment
}
viewerCanAdminister
}
}
Variables
{"name": "xyz789"}
Response
{
"data": {
"team": {
"id": "4",
"name": "abc123",
"url": "xyz789",
"displayName": "abc123",
"readonly": false,
"members": TeamMemberConnection,
"parentTeam": Team,
"childTeams": TeamConnection,
"viewerCanAdminister": false
}
}
}
teams
Description
Get the global list of all root teams. (Those without a parent team).
Response
Returns a TeamConnection!
Example
Query
query teams(
$first: Int,
$after: String,
$search: String
) {
teams(
first: $first,
after: $after,
search: $search
) {
totalCount
pageInfo {
...PageInfoFragment
}
nodes {
...TeamFragment
}
}
}
Variables
{
"first": 123,
"after": "abc123",
"search": "abc123"
}
Response
{
"data": {
"teams": {
"totalCount": 123,
"pageInfo": PageInfo,
"nodes": [Team]
}
}
}
temporarySettings
Description
Retrieves the temporary settings for the current user.
Response
Returns a TemporarySettings!
Example
Query
query temporarySettings {
temporarySettings {
contents
}
}
Response
{
"data": {
"temporarySettings": {
"contents": "xyz789"
}
}
}
user
Description
Looks up a user by username or email address.
Response
Returns a User
Example
Query
query user(
$username: String,
$email: String
) {
user(
username: $username,
email: $email
) {
executorSecrets {
...ExecutorSecretConnectionFragment
}
id
username
email
displayName
avatarURL
url
settingsURL
createdAt
updatedAt
siteAdmin
builtinAuth
latestSettings {
...SettingsFragment
}
settingsCascade {
...SettingsCascadeFragment
}
configurationCascade {
...ConfigurationCascadeFragment
}
organizations {
...OrgConnectionFragment
}
organizationMemberships {
...OrganizationMembershipConnectionFragment
}
tags
tosAccepted
searchable
usageStatistics {
...UserUsageStatisticsFragment
}
eventLogs {
...EventLogsConnectionFragment
}
emails {
...UserEmailFragment
}
accessTokens {
...AccessTokenConnectionFragment
}
externalAccounts {
...ExternalAccountConnectionFragment
}
session {
...SessionFragment
}
viewerCanAdminister
viewerCanChangeUsername
surveyResponses {
...SurveyResponseFragment
}
databaseID
namespaceName
invitableCollaborators {
...PersonFragment
}
teams {
...TeamConnectionFragment
}
}
}
Variables
{
"username": "xyz789",
"email": "xyz789"
}
Response
{
"data": {
"user": {
"executorSecrets": ExecutorSecretConnection,
"id": 4,
"username": "abc123",
"email": "xyz789",
"displayName": "abc123",
"avatarURL": "abc123",
"url": "abc123",
"settingsURL": "xyz789",
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z",
"siteAdmin": false,
"builtinAuth": false,
"latestSettings": Settings,
"settingsCascade": SettingsCascade,
"configurationCascade": ConfigurationCascade,
"organizations": OrgConnection,
"organizationMemberships": OrganizationMembershipConnection,
"tags": ["xyz789"],
"tosAccepted": true,
"searchable": false,
"usageStatistics": UserUsageStatistics,
"eventLogs": EventLogsConnection,
"emails": [UserEmail],
"accessTokens": AccessTokenConnection,
"externalAccounts": ExternalAccountConnection,
"session": Session,
"viewerCanAdminister": true,
"viewerCanChangeUsername": true,
"surveyResponses": [SurveyResponse],
"databaseID": 987,
"namespaceName": "abc123",
"invitableCollaborators": [Person],
"teams": TeamConnection
}
}
}
users
Description
List all users.
Response
Returns a UserConnection!
Arguments
Name | Description |
---|---|
first - Int | Returns the first n users from the list. |
after - String | Opaque pagination cursor. |
query - String | Return users whose usernames or display names match the query. |
tag - String | Return only users with the given tag. |
activePeriod - UserActivePeriod | Returns users who have been active in a given period of time. |
inactiveSince - DateTime | Returns users who have NOT been active since a given point in time. |
Example
Query
query users(
$first: Int,
$after: String,
$query: String,
$tag: String,
$activePeriod: UserActivePeriod,
$inactiveSince: DateTime
) {
users(
first: $first,
after: $after,
query: $query,
tag: $tag,
activePeriod: $activePeriod,
inactiveSince: $inactiveSince
) {
nodes {
...UserFragment
}
totalCount
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"first": 987,
"after": "abc123",
"query": "xyz789",
"tag": "xyz789",
"activePeriod": "TODAY",
"inactiveSince": "2007-12-03T10:15:30Z"
}
Response
{
"data": {
"users": {
"nodes": [User],
"totalCount": 987,
"pageInfo": PageInfo
}
}
}
viewerConfiguration
Description
DEPRECATED
Response
Returns a ConfigurationCascade!
Example
Query
query viewerConfiguration {
viewerConfiguration {
subjects {
...SettingsSubjectFragment
}
merged {
...ConfigurationFragment
}
}
}
Response
{
"data": {
"viewerConfiguration": {
"subjects": [SettingsSubject],
"merged": Configuration
}
}
}
viewerSettings
Description
The settings for the viewer. The viewer is either an anonymous visitor (in which case viewer settings is global settings) or an authenticated user (in which case viewer settings are the user's settings).
Response
Returns a SettingsCascade!
Example
Query
query viewerSettings {
viewerSettings {
subjects {
...SettingsSubjectFragment
}
final
merged {
...ConfigurationFragment
}
}
}
Response
{
"data": {
"viewerSettings": {
"subjects": [SettingsSubject],
"final": "xyz789",
"merged": Configuration
}
}
}
webhookLogs
Description
Returns recently received webhooks across all external services, optionally limiting the returned values to only those that didn't match any external service.
Only site admins can access this field.
Response
Returns a WebhookLogConnection!
Arguments
Name | Description |
---|---|
first - Int | Returns the first n webhook logs. |
after - String | Opaque pagination cursor. |
onlyErrors - Boolean | Only include webhook logs that resulted in errors. |
onlyUnmatched - Boolean | Only include webhook logs that were not matched to an external service. |
since - DateTime | Only include webhook logs on or after this time. |
until - DateTime | Only include webhook logs on or before this time. |
webhookID - ID | Only include webhook logs of given webhook ID. |
legacyOnly - Boolean | Only include webhook logs that have no webhook ID set. |
Example
Query
query webhookLogs(
$first: Int,
$after: String,
$onlyErrors: Boolean,
$onlyUnmatched: Boolean,
$since: DateTime,
$until: DateTime,
$webhookID: ID,
$legacyOnly: Boolean
) {
webhookLogs(
first: $first,
after: $after,
onlyErrors: $onlyErrors,
onlyUnmatched: $onlyUnmatched,
since: $since,
until: $until,
webhookID: $webhookID,
legacyOnly: $legacyOnly
) {
nodes {
...WebhookLogFragment
}
totalCount
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"first": 123,
"after": "abc123",
"onlyErrors": false,
"onlyUnmatched": false,
"since": "2007-12-03T10:15:30Z",
"until": "2007-12-03T10:15:30Z",
"webhookID": "4",
"legacyOnly": true
}
Response
{
"data": {
"webhookLogs": {
"nodes": [WebhookLog],
"totalCount": 123,
"pageInfo": PageInfo
}
}
}
webhooks
Description
Lists webhooks. Only available to site admins. If no kind is given, it returns all webhooks. If first is omitted, 20 items are returned
Response
Returns a WebhookConnection!
Arguments
Name | Description |
---|---|
first - Int | Returns the first n webhooks from the list. |
after - String | Opaque pagination cursor. |
kind - ExternalServiceKind | Optionally filter by kind. |
Example
Query
query webhooks(
$first: Int,
$after: String,
$kind: ExternalServiceKind
) {
webhooks(
first: $first,
after: $after,
kind: $kind
) {
nodes {
...WebhookFragment
}
totalCount
pageInfo {
...PageInfoFragment
}
}
}
Variables
{
"first": 123,
"after": "abc123",
"kind": "AWSCODECOMMIT"
}
Response
{
"data": {
"webhooks": {
"nodes": [Webhook],
"totalCount": 987,
"pageInfo": PageInfo
}
}
}
Mutations
addExternalAccount
Description
Adds an external account to the authenticated user's account. The service type and service ID must correspond to a valid auth provider on the site. The account details must be a stringified JSON object that contains valid credentials for the provided service type.
Response
Returns an EmptyResponse!
Example
Query
mutation addExternalAccount(
$serviceType: String!,
$serviceID: String!,
$accountDetails: String!
) {
addExternalAccount(
serviceType: $serviceType,
serviceID: $serviceID,
accountDetails: $accountDetails
) {
alwaysNil
}
}
Variables
{
"serviceType": "abc123",
"serviceID": "abc123",
"accountDetails": "xyz789"
}
Response
{
"data": {
"addExternalAccount": {
"alwaysNil": "abc123"
}
}
}
addExternalService
Description
Adds a external service. Only site admins may perform this mutation.
Response
Returns an ExternalService!
Arguments
Name | Description |
---|---|
input - AddExternalServiceInput! |
Example
Query
mutation addExternalService($input: AddExternalServiceInput!) {
addExternalService(input: $input) {
id
kind
displayName
config
createdAt
updatedAt
repoCount
webhookURL
warning
lastSyncError
lastSyncAt
nextSyncAt
webhookLogs {
...WebhookLogConnectionFragment
}
syncJobs {
...ExternalServiceSyncJobConnectionFragment
}
checkConnection {
... on ExternalServiceAvailable {
...ExternalServiceAvailableFragment
}
... on ExternalServiceUnavailable {
...ExternalServiceUnavailableFragment
}
... on ExternalServiceAvailabilityUnknown {
...ExternalServiceAvailabilityUnknownFragment
}
}
hasConnectionCheck
supportsRepoExclusion
}
}
Variables
{"input": AddExternalServiceInput}
Response
{
"data": {
"addExternalService": {
"id": "4",
"kind": "AWSCODECOMMIT",
"displayName": "abc123",
"config": JSONCString,
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z",
"repoCount": 987,
"webhookURL": "abc123",
"warning": "xyz789",
"lastSyncError": "abc123",
"lastSyncAt": "2007-12-03T10:15:30Z",
"nextSyncAt": "2007-12-03T10:15:30Z",
"webhookLogs": WebhookLogConnection,
"syncJobs": ExternalServiceSyncJobConnection,
"checkConnection": ExternalServiceAvailable,
"hasConnectionCheck": false,
"supportsRepoExclusion": false
}
}
}
addPhabricatorRepo
Description
Adds a Phabricator repository to Sourcegraph.
Response
Returns an EmptyResponse
Arguments
Name | Description |
---|---|
callsign - String! | The callsign, for example "MUX". |
name - String | The name, for example "github.com/gorilla/mux". |
uri - String | An alias for name. DEPRECATED: use name instead. |
url - String! | The URL to the phabricator instance (e.g. http://phabricator.sgdev.org). |
Example
Query
mutation addPhabricatorRepo(
$callsign: String!,
$name: String,
$uri: String,
$url: String!
) {
addPhabricatorRepo(
callsign: $callsign,
name: $name,
uri: $uri,
url: $url
) {
alwaysNil
}
}
Variables
{
"callsign": "xyz789",
"name": "xyz789",
"uri": "abc123",
"url": "abc123"
}
Response
{
"data": {
"addPhabricatorRepo": {
"alwaysNil": "xyz789"
}
}
}
addRepoKeyValuePair
Description
Associate a new key-value pair with a repo.
Response
Returns an EmptyResponse!
Example
Query
mutation addRepoKeyValuePair(
$repo: ID!,
$key: String!,
$value: String
) {
addRepoKeyValuePair(
repo: $repo,
key: $key,
value: $value
) {
alwaysNil
}
}
Variables
{
"repo": "4",
"key": "abc123",
"value": "abc123"
}
Response
{
"data": {
"addRepoKeyValuePair": {
"alwaysNil": "abc123"
}
}
}
addTeamMembers
Description
Add a list of team members to an existing team. People that already are part of the team are ignored.
Either team XOR teamName can be specified to specify the team. Must be team member to add new team members, or site-admin.
For now, members can only be the IDs of User entities in Sourcegraph. Later, we will expand this to allow Persons as well.
Example
Query
mutation addTeamMembers(
$team: ID,
$teamName: String,
$members: [ID!]!
) {
addTeamMembers(
team: $team,
teamName: $teamName,
members: $members
) {
id
name
url
displayName
readonly
members {
...TeamMemberConnectionFragment
}
parentTeam {
...TeamFragment
}
childTeams {
...TeamConnectionFragment
}
viewerCanAdminister
}
}
Variables
{
"team": "4",
"teamName": "abc123",
"members": ["4"]
}
Response
{
"data": {
"addTeamMembers": {
"id": "4",
"name": "xyz789",
"url": "abc123",
"displayName": "abc123",
"readonly": false,
"members": TeamMemberConnection,
"parentTeam": Team,
"childTeams": TeamConnection,
"viewerCanAdminister": false
}
}
}
addUserEmail
Description
Adds an email address to the user's account. The email address will be marked as unverified until the user has followed the email verification process.
Only the user and site admins may perform this mutation.
Response
Returns an EmptyResponse!
Example
Query
mutation addUserEmail(
$user: ID!,
$email: String!
) {
addUserEmail(
user: $user,
email: $email
) {
alwaysNil
}
}
Variables
{
"user": "4",
"email": "abc123"
}
Response
{
"data": {
"addUserEmail": {"alwaysNil": "abc123"}
}
}
addUserToOrganization
Description
Immediately add a user as a member to the organization, without sending an invitation email.
Only site admins may perform this mutation. Organization members may use the inviteUserToOrganization mutation to invite users.
Response
Returns an EmptyResponse!
Example
Query
mutation addUserToOrganization(
$organization: ID!,
$username: String!
) {
addUserToOrganization(
organization: $organization,
username: $username
) {
alwaysNil
}
}
Variables
{
"organization": "4",
"username": "xyz789"
}
Response
{
"data": {
"addUserToOrganization": {
"alwaysNil": "abc123"
}
}
}
cancelExternalServiceSync
Description
Cancels an external service sync job. Must be in queued or processing state.
Site-admin or owner of the external service only.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
id - ID! |
Example
Query
mutation cancelExternalServiceSync($id: ID!) {
cancelExternalServiceSync(id: $id) {
alwaysNil
}
}
Variables
{"id": "4"}
Response
{
"data": {
"cancelExternalServiceSync": {
"alwaysNil": "abc123"
}
}
}
checkMirrorRepositoryConnection
Description
Tests the connection to a mirror repository's original source repository. This is an expensive and slow operation, so it should only be used for interactive diagnostics.
Only site admins may perform this mutation.
Response
Returns a CheckMirrorRepositoryConnectionResult!
Arguments
Name | Description |
---|---|
repository - ID | The ID of the existing repository whose mirror to check. |
name - String | The name of a repository whose mirror to check. If the name is provided, the repository need not be added to the site (but the site configuration must define a code host that knows how to handle the name). |
Example
Query
mutation checkMirrorRepositoryConnection(
$repository: ID,
$name: String
) {
checkMirrorRepositoryConnection(
repository: $repository,
name: $name
) {
error
}
}
Variables
{"repository": 4, "name": "abc123"}
Response
{
"data": {
"checkMirrorRepositoryConnection": {
"error": "abc123"
}
}
}
configurationMutation
Description
DEPRECATED: Use settingsMutation instead. This field is a deprecated alias for settingsMutation and will be removed in a future release.
Response
Returns a SettingsMutation
Arguments
Name | Description |
---|---|
input - SettingsMutationGroupInput! |
Example
Query
mutation configurationMutation($input: SettingsMutationGroupInput!) {
configurationMutation(input: $input) {
editSettings {
...UpdateSettingsPayloadFragment
}
editConfiguration {
...UpdateSettingsPayloadFragment
}
overwriteSettings {
...UpdateSettingsPayloadFragment
}
}
}
Variables
{"input": SettingsMutationGroupInput}
Response
{
"data": {
"configurationMutation": {
"editSettings": UpdateSettingsPayload,
"editConfiguration": UpdateSettingsPayload,
"overwriteSettings": UpdateSettingsPayload
}
}
}
createAccessToken
Description
Creates an access token that grants the privileges of the specified user (referred to as the access token's "subject" user after token creation). The result is the access token value, which the caller is responsible for storing (it is not accessible by Sourcegraph after creation).
The supported scopes are:
- "user:all": Full control of all resources accessible to the user account.
- "site-admin:sudo": Ability to perform any action as any other user. (Only site admins may create tokens with this scope.)
Only the user or site admins may perform this mutation.
Response
Returns a CreateAccessTokenResult!
Arguments
Name | Description |
---|---|
user - ID! | |
scopes - [String!]! | |
note - String! |
Example
Query
mutation createAccessToken(
$user: ID!,
$scopes: [String!]!,
$note: String!
) {
createAccessToken(
user: $user,
scopes: $scopes,
note: $note
) {
id
token
}
}
Variables
{
"user": 4,
"scopes": ["xyz789"],
"note": "xyz789"
}
Response
{
"data": {
"createAccessToken": {
"id": 4,
"token": "xyz789"
}
}
}
createExecutorSecret
Description
Create a new executor secret. See argument descriptions for more details.
Response
Returns an ExecutorSecret!
Arguments
Name | Description |
---|---|
scope - ExecutorSecretScope! | The scope for which the secret is usable. |
key - String! | The key under which the secret is known. For executions, this is the name of the environment variable this secret will be accessible under. It is therefore advised that key only contains uppercase letters, numbers and underscores. |
value - String! | The secret value. |
namespace - ID | The namespace this secret is for. If not set, a global secret is created that is accessible by all users. Creating a global secret requires site-admin permissions. Creating a namespaced secret requires write-access to the namespace. |
Example
Query
mutation createExecutorSecret(
$scope: ExecutorSecretScope!,
$key: String!,
$value: String!,
$namespace: ID
) {
createExecutorSecret(
scope: $scope,
key: $key,
value: $value,
namespace: $namespace
) {
id
key
scope
overwritesGlobalSecret
namespace {
...NamespaceFragment
}
creator {
...UserFragment
}
createdAt
updatedAt
accessLogs {
...ExecutorSecretAccessLogConnectionFragment
}
}
}
Variables
{
"scope": "BATCHES",
"key": "abc123",
"value": "abc123",
"namespace": "4"
}
Response
{
"data": {
"createExecutorSecret": {
"id": "4",
"key": "abc123",
"scope": "BATCHES",
"overwritesGlobalSecret": true,
"namespace": Namespace,
"creator": User,
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z",
"accessLogs": ExecutorSecretAccessLogConnection
}
}
}
createFeatureFlag
Description
(experimental) Create a new feature flag
Response
Returns a FeatureFlag!
Arguments
Name | Description |
---|---|
name - String! | The name of the feature flag |
value - Boolean | The value of the feature flag. Only set if the new feature flag will be a concrete boolean flag. Mutually exclusive with rolloutBasisPoints. |
rolloutBasisPoints - Int | The ratio of users the feature flag will apply to, expressed in basis points (0.01%). Only set if the new feature flag will be a rollout flag. Mutually exclusive with value. |
Example
Query
mutation createFeatureFlag(
$name: String!,
$value: Boolean,
$rolloutBasisPoints: Int
) {
createFeatureFlag(
name: $name,
value: $value,
rolloutBasisPoints: $rolloutBasisPoints
) {
... on FeatureFlagBoolean {
...FeatureFlagBooleanFragment
}
... on FeatureFlagRollout {
...FeatureFlagRolloutFragment
}
}
}
Variables
{
"name": "xyz789",
"value": true,
"rolloutBasisPoints": 987
}
Response
{"data": {"createFeatureFlag": FeatureFlagBoolean}}
createFeatureFlagOverride
Description
(experimental) Create a new feature flag override for the given org or user
Response
Returns a FeatureFlagOverride!
Example
Query
mutation createFeatureFlagOverride(
$namespace: ID!,
$flagName: String!,
$value: Boolean!
) {
createFeatureFlagOverride(
namespace: $namespace,
flagName: $flagName,
value: $value
) {
id
namespace {
...NamespaceFragment
}
targetFlag {
... on FeatureFlagBoolean {
...FeatureFlagBooleanFragment
}
... on FeatureFlagRollout {
...FeatureFlagRolloutFragment
}
}
value
}
}
Variables
{
"namespace": 4,
"flagName": "abc123",
"value": false
}
Response
{
"data": {
"createFeatureFlagOverride": {
"id": "4",
"namespace": Namespace,
"targetFlag": FeatureFlagBoolean,
"value": true
}
}
}
createOrganization
Description
Creates an organization. The caller is added as a member of the newly created organization.
Only authenticated users may perform this mutation.
Example
Query
mutation createOrganization(
$name: String!,
$displayName: String,
$statsID: ID
) {
createOrganization(
name: $name,
displayName: $displayName,
statsID: $statsID
) {
executorSecrets {
...ExecutorSecretConnectionFragment
}
id
name
displayName
createdAt
members {
...NewUsersConnectionFragment
}
latestSettings {
...SettingsFragment
}
settingsCascade {
...SettingsCascadeFragment
}
configurationCascade {
...ConfigurationCascadeFragment
}
viewerPendingInvitation {
...OrganizationInvitationFragment
}
viewerCanAdminister
viewerIsMember
url
settingsURL
namespaceName
}
}
Variables
{
"name": "abc123",
"displayName": "xyz789",
"statsID": "4"
}
Response
{
"data": {
"createOrganization": {
"executorSecrets": ExecutorSecretConnection,
"id": 4,
"name": "xyz789",
"displayName": "xyz789",
"createdAt": "2007-12-03T10:15:30Z",
"members": NewUsersConnection,
"latestSettings": Settings,
"settingsCascade": SettingsCascade,
"configurationCascade": ConfigurationCascade,
"viewerPendingInvitation": OrganizationInvitation,
"viewerCanAdminister": false,
"viewerIsMember": false,
"url": "xyz789",
"settingsURL": "abc123",
"namespaceName": "abc123"
}
}
}
createPassword
Description
Creates a password for the current user. It is only permitted if the user does not have a password.
Response
Returns an EmptyResponse
Arguments
Name | Description |
---|---|
newPassword - String! |
Example
Query
mutation createPassword($newPassword: String!) {
createPassword(newPassword: $newPassword) {
alwaysNil
}
}
Variables
{"newPassword": "xyz789"}
Response
{
"data": {
"createPassword": {
"alwaysNil": "abc123"
}
}
}
createSavedSearch
Description
Creates a saved search.
Response
Returns a SavedSearch!
Example
Query
mutation createSavedSearch(
$description: String!,
$query: String!,
$notifyOwner: Boolean!,
$notifySlack: Boolean!,
$orgID: ID,
$userID: ID
) {
createSavedSearch(
description: $description,
query: $query,
notifyOwner: $notifyOwner,
notifySlack: $notifySlack,
orgID: $orgID,
userID: $userID
) {
id
description
query
notify
notifySlack
namespace {
...NamespaceFragment
}
slackWebhookURL
}
}
Variables
{
"description": "abc123",
"query": "abc123",
"notifyOwner": false,
"notifySlack": false,
"orgID": "4",
"userID": 4
}
Response
{
"data": {
"createSavedSearch": {
"id": "4",
"description": "xyz789",
"query": "abc123",
"notify": true,
"notifySlack": true,
"namespace": Namespace,
"slackWebhookURL": "abc123"
}
}
}
createTeam
Description
Creates a team. The name must be unique, display name can be used to set a custom display value for the team inside Sourcegraph.
If readonly is true, the Sourcegraph UI will show a warning banner that this team is managed externally, and it can only be modified by site-admins. This is to prevent state drift from external systems that ingest team information into Sourcegraph. Readonly can only be set by site-admins.
Either parentTeam XOR parentTeamName can be specified to make the team a child team of the given parent. Only members of the parent team or site-admis can create a child team.
Response
Returns a Team!
Example
Query
mutation createTeam(
$name: String!,
$displayName: String,
$readonly: Boolean,
$parentTeam: ID,
$parentTeamName: String
) {
createTeam(
name: $name,
displayName: $displayName,
readonly: $readonly,
parentTeam: $parentTeam,
parentTeamName: $parentTeamName
) {
id
name
url
displayName
readonly
members {
...TeamMemberConnectionFragment
}
parentTeam {
...TeamFragment
}
childTeams {
...TeamConnectionFragment
}
viewerCanAdminister
}
}
Variables
{
"name": "abc123",
"displayName": "xyz789",
"readonly": false,
"parentTeam": "4",
"parentTeamName": "abc123"
}
Response
{
"data": {
"createTeam": {
"id": 4,
"name": "abc123",
"url": "abc123",
"displayName": "xyz789",
"readonly": true,
"members": TeamMemberConnection,
"parentTeam": Team,
"childTeams": TeamConnection,
"viewerCanAdminister": true
}
}
}
createUser
Description
Creates a new user account.
Only site admins may perform this mutation.
Response
Returns a CreateUserResult!
Arguments
Name | Description |
---|---|
username - String! | The new user's username. |
email - String | The new user's optional email address. If given, it must be verified by the user. |
verifiedEmail - Boolean | Whether or not to mark the provided email address as verified. If unset or set to true, then the email address is immediately marked as verified - otherwise, the email may be marked as unverified if SMTP and password resets are enabled. |
Example
Query
mutation createUser(
$username: String!,
$email: String,
$verifiedEmail: Boolean
) {
createUser(
username: $username,
email: $email,
verifiedEmail: $verifiedEmail
) {
user {
...UserFragment
}
resetPasswordURL
}
}
Variables
{
"username": "abc123",
"email": "abc123",
"verifiedEmail": false
}
Response
{
"data": {
"createUser": {
"user": User,
"resetPasswordURL": "xyz789"
}
}
}
createWebhook
Description
Creates a webhook for the specified code host. Only site admins may perform this mutation.
Response
Returns a Webhook!
Example
Query
mutation createWebhook(
$name: String!,
$codeHostKind: String!,
$codeHostURN: String!,
$secret: String
) {
createWebhook(
name: $name,
codeHostKind: $codeHostKind,
codeHostURN: $codeHostURN,
secret: $secret
) {
id
uuid
url
name
codeHostKind
codeHostURN
secret
updatedAt
updatedBy {
...UserFragment
}
createdAt
createdBy {
...UserFragment
}
webhookLogs {
...WebhookLogConnectionFragment
}
}
}
Variables
{
"name": "abc123",
"codeHostKind": "abc123",
"codeHostURN": "xyz789",
"secret": "xyz789"
}
Response
{
"data": {
"createWebhook": {
"id": "4",
"uuid": "abc123",
"url": "xyz789",
"name": "xyz789",
"codeHostKind": "AWSCODECOMMIT",
"codeHostURN": "abc123",
"secret": "abc123",
"updatedAt": "2007-12-03T10:15:30Z",
"updatedBy": User,
"createdAt": "2007-12-03T10:15:30Z",
"createdBy": User,
"webhookLogs": WebhookLogConnection
}
}
}
deleteAccessToken
Description
Deletes and immediately revokes the specified access token, specified by either its ID or by the token itself.
Only site admins or the user who owns the token may perform this mutation.
Response
Returns an EmptyResponse!
Example
Query
mutation deleteAccessToken(
$byID: ID,
$byToken: String
) {
deleteAccessToken(
byID: $byID,
byToken: $byToken
) {
alwaysNil
}
}
Variables
{"byID": 4, "byToken": "xyz789"}
Response
{
"data": {
"deleteAccessToken": {
"alwaysNil": "xyz789"
}
}
}
deleteExecutorSecret
Description
Deletes the given executor secret.
Response
Returns an EmptyResponse
Arguments
Name | Description |
---|---|
scope - ExecutorSecretScope! | The scope of the secret. |
id - ID! | The identifier of the secret that shall be deleted. |
Example
Query
mutation deleteExecutorSecret(
$scope: ExecutorSecretScope!,
$id: ID!
) {
deleteExecutorSecret(
scope: $scope,
id: $id
) {
alwaysNil
}
}
Variables
{"scope": "BATCHES", "id": "4"}
Response
{
"data": {
"deleteExecutorSecret": {
"alwaysNil": "xyz789"
}
}
}
deleteExternalAccount
Description
Deletes the association between an external account and its Sourcegraph user. It does NOT delete the external account on the external service where it resides.
Only site admins or the user who is associated with the external account may perform this mutation.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
externalAccount - ID! |
Example
Query
mutation deleteExternalAccount($externalAccount: ID!) {
deleteExternalAccount(externalAccount: $externalAccount) {
alwaysNil
}
}
Variables
{"externalAccount": 4}
Response
{
"data": {
"deleteExternalAccount": {
"alwaysNil": "abc123"
}
}
}
deleteExternalService
Description
Delete an external service. Only site admins may perform this mutation.
Response
Returns an EmptyResponse!
Example
Query
mutation deleteExternalService(
$externalService: ID!,
$async: Boolean
) {
deleteExternalService(
externalService: $externalService,
async: $async
) {
alwaysNil
}
}
Variables
{"externalService": 4, "async": false}
Response
{
"data": {
"deleteExternalService": {
"alwaysNil": "abc123"
}
}
}
deleteFeatureFlag
Description
(experimental) Delete a feature flag
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
name - String! | The name of the feature flag |
Example
Query
mutation deleteFeatureFlag($name: String!) {
deleteFeatureFlag(name: $name) {
alwaysNil
}
}
Variables
{"name": "xyz789"}
Response
{
"data": {
"deleteFeatureFlag": {
"alwaysNil": "xyz789"
}
}
}
deleteFeatureFlagOverride
Description
Delete a feature flag override
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
id - ID! | The ID of the feature flag override to delete |
Example
Query
mutation deleteFeatureFlagOverride($id: ID!) {
deleteFeatureFlagOverride(id: $id) {
alwaysNil
}
}
Variables
{"id": 4}
Response
{
"data": {
"deleteFeatureFlagOverride": {
"alwaysNil": "xyz789"
}
}
}
deleteOrganization
Description
Soft or hard deletes an organization.
- When the second argument is not provided, it soft deletes an organization, marking it as deleted. Only site admins may perform this mutation.
- When the second argument is true, it hard deletes an organization and its associated resources. Hard deletion is currently only supported on cloud. Only org members may perform this mutation
Response
Returns an EmptyResponse
Example
Query
mutation deleteOrganization(
$organization: ID!,
$hard: Boolean
) {
deleteOrganization(
organization: $organization,
hard: $hard
) {
alwaysNil
}
}
Variables
{"organization": "4", "hard": false}
Response
{
"data": {
"deleteOrganization": {
"alwaysNil": "xyz789"
}
}
}
deleteRepoKeyValuePair
Description
Delete a key-value pair associated with a repo.
Response
Returns an EmptyResponse!
Example
Query
mutation deleteRepoKeyValuePair(
$repo: ID!,
$key: String!
) {
deleteRepoKeyValuePair(
repo: $repo,
key: $key
) {
alwaysNil
}
}
Variables
{
"repo": "4",
"key": "xyz789"
}
Response
{
"data": {
"deleteRepoKeyValuePair": {
"alwaysNil": "abc123"
}
}
}
deleteRepositoryFromDisk
Description
INTERNAL ONLY: Delete a repository from the gitserver. This involves deleting the file on disk, and marking it as not-cloned in the database.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
repo - ID! |
Example
Query
mutation deleteRepositoryFromDisk($repo: ID!) {
deleteRepositoryFromDisk(repo: $repo) {
alwaysNil
}
}
Variables
{"repo": "4"}
Response
{
"data": {
"deleteRepositoryFromDisk": {
"alwaysNil": "xyz789"
}
}
}
deleteSavedSearch
Description
Deletes a saved search
Response
Returns an EmptyResponse
Arguments
Name | Description |
---|---|
id - ID! |
Example
Query
mutation deleteSavedSearch($id: ID!) {
deleteSavedSearch(id: $id) {
alwaysNil
}
}
Variables
{"id": "4"}
Response
{
"data": {
"deleteSavedSearch": {
"alwaysNil": "xyz789"
}
}
}
deleteTeam
Description
Delete team deletes a team. ID or Name must be specified, but not both. Must be team-member to delete. If the team is marked as read-only, must be site-admin.
Response
Returns an EmptyResponse
Example
Query
mutation deleteTeam(
$id: ID,
$name: String
) {
deleteTeam(
id: $id,
name: $name
) {
alwaysNil
}
}
Variables
{
"id": "4",
"name": "abc123"
}
Response
{
"data": {
"deleteTeam": {"alwaysNil": "abc123"}
}
}
deleteUser
Description
Deletes a user account. Only site admins may perform this mutation.
If hard == true, a hard delete is performed. By default, deletes are 'soft deletes' and could theoretically be undone with manual DB commands. If a hard delete is performed, the data is truly removed from the database and deletion can NEVER be undone.
Data that is deleted as part of this operation:
- All user data (access tokens, email addresses, external account info, survey responses, etc)
- Organization membership information (which organizations the user is a part of, any invitations created by or targeting the user).
- Sourcegraph extensions published by the user.
- User, Organization, or Global settings authored by the user.
Response
Returns an EmptyResponse
Example
Query
mutation deleteUser(
$user: ID!,
$hard: Boolean
) {
deleteUser(
user: $user,
hard: $hard
) {
alwaysNil
}
}
Variables
{"user": 4, "hard": false}
Response
{
"data": {
"deleteUser": {"alwaysNil": "abc123"}
}
}
deleteUsers
Description
Bulk "deleteUser" action.
Response
Returns an EmptyResponse
Example
Query
mutation deleteUsers(
$users: [ID!]!,
$hard: Boolean
) {
deleteUsers(
users: $users,
hard: $hard
) {
alwaysNil
}
}
Variables
{"users": [4], "hard": false}
Response
{
"data": {
"deleteUsers": {"alwaysNil": "xyz789"}
}
}
deleteWebhook
Description
Deletes a webhook by given ID. Only site admins may perform this mutation.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
id - ID! |
Example
Query
mutation deleteWebhook($id: ID!) {
deleteWebhook(id: $id) {
alwaysNil
}
}
Variables
{"id": 4}
Response
{
"data": {
"deleteWebhook": {"alwaysNil": "abc123"}
}
}
editTemporarySettings
Description
Merges the given settings edit with the current temporary settings for the current user. Keys in the given edit take priority over key in the temporary settings. The merge is not recursive. If temporary settings for the user do not exist, they are created.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
settingsToEdit - String! | The settings to merge with the current temporary settings for the current user, as a JSON string. |
Example
Query
mutation editTemporarySettings($settingsToEdit: String!) {
editTemporarySettings(settingsToEdit: $settingsToEdit) {
alwaysNil
}
}
Variables
{"settingsToEdit": "abc123"}
Response
{
"data": {
"editTemporarySettings": {
"alwaysNil": "abc123"
}
}
}
excludeRepoFromExternalServices
Description
Excludes a repo from external services configs. Only site admins may perform this mutation.
Response
Returns an EmptyResponse!
Example
Query
mutation excludeRepoFromExternalServices(
$externalServices: [ID!]!,
$repo: ID!
) {
excludeRepoFromExternalServices(
externalServices: $externalServices,
repo: $repo
) {
alwaysNil
}
}
Variables
{"externalServices": ["4"], "repo": 4}
Response
{
"data": {
"excludeRepoFromExternalServices": {
"alwaysNil": "xyz789"
}
}
}
invalidateSessionsByID
Description
Invalidates all sessions belonging to a user.
Only site admins may perform this mutation.
Response
Returns an EmptyResponse
Arguments
Name | Description |
---|---|
userID - ID! |
Example
Query
mutation invalidateSessionsByID($userID: ID!) {
invalidateSessionsByID(userID: $userID) {
alwaysNil
}
}
Variables
{"userID": "4"}
Response
{
"data": {
"invalidateSessionsByID": {
"alwaysNil": "abc123"
}
}
}
invalidateSessionsByIDs
Description
Bulk "invalidateSessionsByID" action.
Response
Returns an EmptyResponse
Arguments
Name | Description |
---|---|
userIDs - [ID!]! |
Example
Query
mutation invalidateSessionsByIDs($userIDs: [ID!]!) {
invalidateSessionsByIDs(userIDs: $userIDs) {
alwaysNil
}
}
Variables
{"userIDs": ["4"]}
Response
{
"data": {
"invalidateSessionsByIDs": {
"alwaysNil": "xyz789"
}
}
}
inviteEmailToSourcegraph
Description
Sends an invitation to join Sourcegraph to the given email address.
Returns instantly regardless of whether or not an invitation email was actually sent. For example, the email may fail to send if there is a typo or it is invalid, or Sourcegraph may refuse to send it due to spam concerns or if the user has been invited too recently.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
email - String! |
Example
Query
mutation inviteEmailToSourcegraph($email: String!) {
inviteEmailToSourcegraph(email: $email) {
alwaysNil
}
}
Variables
{"email": "xyz789"}
Response
{
"data": {
"inviteEmailToSourcegraph": {
"alwaysNil": "abc123"
}
}
}
inviteUserToOrganization
Description
Invite the user with the given username to join the organization. The invited user account must already exist.
Only site admins and any organization member may perform this mutation.
Response
Returns an InviteUserToOrganizationResult!
Example
Query
mutation inviteUserToOrganization(
$organization: ID!,
$username: String,
$email: String
) {
inviteUserToOrganization(
organization: $organization,
username: $username,
email: $email
) {
sentInvitationEmail
invitationURL
}
}
Variables
{
"organization": "4",
"username": "abc123",
"email": "abc123"
}
Response
{
"data": {
"inviteUserToOrganization": {
"sentInvitationEmail": true,
"invitationURL": "abc123"
}
}
}
logEvent
Description
Logs an event.
Response
Returns an EmptyResponse
Arguments
Name | Description |
---|---|
event - String! | The name of the event. |
userCookieID - String! | The randomly generated unique user ID stored in a browser cookie. |
firstSourceURL - String | The first sourcegraph URL visited by the user, stored in a browser cookie. |
lastSourceURL - String | The last sourcegraph URL visited by the user, stored in a browser cookie. |
url - String! | The URL when the event was logged. |
source - EventSource! | The source of the event. |
cohortID - String | An optional cohort ID to identify the user as part of a specific A/B test. The cohort ID is expected to be a date in the form YYYY-MM-DD |
referrer - String | An optional referrer parameter for the user's current session. Only captured and stored on Sourcegraph Cloud. |
originalReferrer - String | The original referrer for a user |
sessionReferrer - String | The session referrer for a user |
sessionFirstURL - String | The sessions first url for a user |
deviceSessionID - String | Device session ID to identify the user's session for analytics. |
argument - String | The additional argument information. |
publicArgument - String | Public argument information. PRIVACY: Do NOT include any potentially private information in this field. These properties get sent to our analytics tools for Cloud, so must not include private information, such as search queries or repository names. |
deviceID - String | Device ID used for Amplitude analytics. Used on Sourcegraph Cloud only. |
eventID - Int | Event ID used to deduplicate events that occur simultaneously in Amplitude analytics. See https://developers.amplitude.com/docs/http-api-v2#optional-keys. Used on Sourcegraph Cloud only. |
insertID - String | Insert ID used to deduplicate events that re-occur in the event of retries or backfills in Amplitude analytics. See https://developers.amplitude.com/docs/http-api-v2#optional-keys. Used on Sourcegraph Cloud only. |
Example
Query
mutation logEvent(
$event: String!,
$userCookieID: String!,
$firstSourceURL: String,
$lastSourceURL: String,
$url: String!,
$source: EventSource!,
$cohortID: String,
$referrer: String,
$originalReferrer: String,
$sessionReferrer: String,
$sessionFirstURL: String,
$deviceSessionID: String,
$argument: String,
$publicArgument: String,
$deviceID: String,
$eventID: Int,
$insertID: String
) {
logEvent(
event: $event,
userCookieID: $userCookieID,
firstSourceURL: $firstSourceURL,
lastSourceURL: $lastSourceURL,
url: $url,
source: $source,
cohortID: $cohortID,
referrer: $referrer,
originalReferrer: $originalReferrer,
sessionReferrer: $sessionReferrer,
sessionFirstURL: $sessionFirstURL,
deviceSessionID: $deviceSessionID,
argument: $argument,
publicArgument: $publicArgument,
deviceID: $deviceID,
eventID: $eventID,
insertID: $insertID
) {
alwaysNil
}
}
Variables
{
"event": "xyz789",
"userCookieID": "abc123",
"firstSourceURL": "xyz789",
"lastSourceURL": "abc123",
"url": "xyz789",
"source": "WEB",
"cohortID": "xyz789",
"referrer": "xyz789",
"originalReferrer": "abc123",
"sessionReferrer": "xyz789",
"sessionFirstURL": "abc123",
"deviceSessionID": "abc123",
"argument": "abc123",
"publicArgument": "xyz789",
"deviceID": "xyz789",
"eventID": 123,
"insertID": "xyz789"
}
Response
{
"data": {
"logEvent": {"alwaysNil": "abc123"}
}
}
logEvents
Description
Logs a batch of events.
Response
Returns an EmptyResponse
Arguments
Name | Description |
---|---|
events - [Event!] |
Example
Query
mutation logEvents($events: [Event!]) {
logEvents(events: $events) {
alwaysNil
}
}
Variables
{"events": [Event]}
Response
{
"data": {
"logEvents": {"alwaysNil": "abc123"}
}
}
logUserEvent
Description
Logs a user event. No longer used, only here for backwards compatibility with IDE and browser extensions.
Response
Returns an EmptyResponse
Arguments
Name | Description |
---|---|
event - UserEvent! | |
userCookieID - String! |
Example
Query
mutation logUserEvent(
$event: UserEvent!,
$userCookieID: String!
) {
logUserEvent(
event: $event,
userCookieID: $userCookieID
) {
alwaysNil
}
}
Variables
{
"event": "PAGEVIEW",
"userCookieID": "abc123"
}
Response
{
"data": {
"logUserEvent": {"alwaysNil": "xyz789"}
}
}
overwriteTemporarySettings
Description
Overwrites and saves the temporary settings for the current user. If temporary settings for the user do not exist, they are created.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
contents - String! | The new temporary settings for the current user, as a JSON string. |
Example
Query
mutation overwriteTemporarySettings($contents: String!) {
overwriteTemporarySettings(contents: $contents) {
alwaysNil
}
}
Variables
{"contents": "abc123"}
Response
{
"data": {
"overwriteTemporarySettings": {
"alwaysNil": "abc123"
}
}
}
randomizeUserPassword
Description
Randomize a user's password so that they need to reset it before they can sign in again.
Only site admins may perform this mutation.
Response
Returns a RandomizeUserPasswordResult!
Arguments
Name | Description |
---|---|
user - ID! |
Example
Query
mutation randomizeUserPassword($user: ID!) {
randomizeUserPassword(user: $user) {
resetPasswordURL
emailSent
}
}
Variables
{"user": 4}
Response
{
"data": {
"randomizeUserPassword": {
"resetPasswordURL": "abc123",
"emailSent": true
}
}
}
recloneRepository
Description
INTERNAL ONLY: Reclone a repository from the gitserver. This involves deleting the file on disk, marking it as not-cloned in the database, and then initiating a repo clone.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
repo - ID! |
Example
Query
mutation recloneRepository($repo: ID!) {
recloneRepository(repo: $repo) {
alwaysNil
}
}
Variables
{"repo": "4"}
Response
{
"data": {
"recloneRepository": {
"alwaysNil": "xyz789"
}
}
}
recoverUsers
Description
Bulk "recoverUser" action.
Response
Returns an EmptyResponse
Arguments
Name | Description |
---|---|
userIDs - [ID!]! |
Example
Query
mutation recoverUsers($userIDs: [ID!]!) {
recoverUsers(userIDs: $userIDs) {
alwaysNil
}
}
Variables
{"userIDs": ["4"]}
Response
{
"data": {
"recoverUsers": {"alwaysNil": "xyz789"}
}
}
reindexRepository
Description
Force Zoekt to reindex the repository right now. Reindexing occurs automatically, so this should not normally be needed.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
repository - ID! | The repository to index |
Example
Query
mutation reindexRepository($repository: ID!) {
reindexRepository(repository: $repository) {
alwaysNil
}
}
Variables
{"repository": "4"}
Response
{
"data": {
"reindexRepository": {
"alwaysNil": "abc123"
}
}
}
reloadSite
Description
Reloads the site by restarting the server. This is not supported for all deployment types. This may cause downtime.
Only site admins may perform this mutation.
Response
Returns an EmptyResponse
Example
Query
mutation reloadSite {
reloadSite {
alwaysNil
}
}
Response
{
"data": {
"reloadSite": {"alwaysNil": "abc123"}
}
}
removeTeamMembers
Description
This mutation removes team membership for the given team and set of members. Members that weren't part of the team are ignored.
Either team XOR teamName can be specified to specify the team. Must be team member to remove team members, or site-admin.
For now, members can only be the IDs of User entities in Sourcegraph. Later, we will expand this to allow Persons as well.
Example
Query
mutation removeTeamMembers(
$team: ID,
$teamName: String,
$members: [ID!]!
) {
removeTeamMembers(
team: $team,
teamName: $teamName,
members: $members
) {
id
name
url
displayName
readonly
members {
...TeamMemberConnectionFragment
}
parentTeam {
...TeamFragment
}
childTeams {
...TeamConnectionFragment
}
viewerCanAdminister
}
}
Variables
{
"team": 4,
"teamName": "abc123",
"members": [4]
}
Response
{
"data": {
"removeTeamMembers": {
"id": 4,
"name": "abc123",
"url": "abc123",
"displayName": "xyz789",
"readonly": false,
"members": TeamMemberConnection,
"parentTeam": Team,
"childTeams": TeamConnection,
"viewerCanAdminister": false
}
}
}
removeUserEmail
Description
Removes an email address from the user's account.
Only the user and site admins may perform this mutation.
Response
Returns an EmptyResponse!
Example
Query
mutation removeUserEmail(
$user: ID!,
$email: String!
) {
removeUserEmail(
user: $user,
email: $email
) {
alwaysNil
}
}
Variables
{
"user": "4",
"email": "abc123"
}
Response
{
"data": {
"removeUserEmail": {
"alwaysNil": "abc123"
}
}
}
removeUserFromOrganization
Description
Removes a user as a member from an organization.
Only site admins and any member of the organization may perform this mutation.
Response
Returns an EmptyResponse
Example
Query
mutation removeUserFromOrganization(
$user: ID!,
$organization: ID!
) {
removeUserFromOrganization(
user: $user,
organization: $organization
) {
alwaysNil
}
}
Variables
{"user": 4, "organization": "4"}
Response
{
"data": {
"removeUserFromOrganization": {
"alwaysNil": "xyz789"
}
}
}
resendOrganizationInvitationNotification
Description
Resend the notification about an organization invitation to the recipient.
Only site admins and any member of the organization may perform this mutation.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
organizationInvitation - ID! | The organization invitation. |
Example
Query
mutation resendOrganizationInvitationNotification($organizationInvitation: ID!) {
resendOrganizationInvitationNotification(organizationInvitation: $organizationInvitation) {
alwaysNil
}
}
Variables
{"organizationInvitation": "4"}
Response
{
"data": {
"resendOrganizationInvitationNotification": {
"alwaysNil": "abc123"
}
}
}
resendVerificationEmail
Description
Resend a verification email, no op if the email is already verified.
Only the user and site admins may perform this mutation.
Response
Returns an EmptyResponse!
Example
Query
mutation resendVerificationEmail(
$user: ID!,
$email: String!
) {
resendVerificationEmail(
user: $user,
email: $email
) {
alwaysNil
}
}
Variables
{"user": 4, "email": "xyz789"}
Response
{
"data": {
"resendVerificationEmail": {
"alwaysNil": "xyz789"
}
}
}
resolvePhabricatorDiff
Description
Resolves a revision for a given diff from Phabricator.
Response
Returns a GitCommit
Arguments
Name | Description |
---|---|
repoName - String! | The name of the repository that the diff is based on. |
diffID - ID! | The ID of the diff on Phabricator. |
baseRev - String! | The base revision this diff is based on. |
patch - String | The raw contents of the diff from Phabricator. Required if Sourcegraph doesn't have a Conduit API token. |
description - String | The description of the diff. This will be used as the commit message. |
authorName - String | The name of author of the diff. |
authorEmail - String | The author's email. |
date - String | When the diff was created. |
Example
Query
mutation resolvePhabricatorDiff(
$repoName: String!,
$diffID: ID!,
$baseRev: String!,
$patch: String,
$description: String,
$authorName: String,
$authorEmail: String,
$date: String
) {
resolvePhabricatorDiff(
repoName: $repoName,
diffID: $diffID,
baseRev: $baseRev,
patch: $patch,
description: $description,
authorName: $authorName,
authorEmail: $authorEmail,
date: $date
) {
id
repository {
...RepositoryFragment
}
oid
abbreviatedOID
author {
...SignatureFragment
}
committer {
...SignatureFragment
}
message
subject
body
parents {
...GitCommitFragment
}
url
canonicalURL
externalURLs {
...ExternalLinkFragment
}
path {
... on GitTree {
...GitTreeFragment
}
... on GitBlob {
...GitBlobFragment
}
}
tree {
...GitTreeFragment
}
fileNames
blob {
...GitBlobFragment
}
file {
...File2Fragment
}
languages
languageStatistics {
...LanguageStatisticsFragment
}
ancestors {
...GitCommitConnectionFragment
}
behindAhead {
...BehindAheadCountsFragment
}
symbols {
...SymbolConnectionFragment
}
diff {
...RepositoryComparisonFragment
}
}
}
Variables
{
"repoName": "xyz789",
"diffID": "4",
"baseRev": "xyz789",
"patch": "abc123",
"description": "xyz789",
"authorName": "xyz789",
"authorEmail": "abc123",
"date": "abc123"
}
Response
{
"data": {
"resolvePhabricatorDiff": {
"id": "4",
"repository": Repository,
"oid": GitObjectID,
"abbreviatedOID": "xyz789",
"author": Signature,
"committer": Signature,
"message": "xyz789",
"subject": "abc123",
"body": "abc123",
"parents": [GitCommit],
"url": "abc123",
"canonicalURL": "xyz789",
"externalURLs": [ExternalLink],
"path": GitTree,
"tree": GitTree,
"fileNames": ["abc123"],
"blob": GitBlob,
"file": File2,
"languages": ["abc123"],
"languageStatistics": [LanguageStatistics],
"ancestors": GitCommitConnection,
"behindAhead": BehindAheadCounts,
"symbols": SymbolConnection,
"diff": RepositoryComparison
}
}
}
respondToOrganizationInvitation
Description
Accept or reject an existing organization invitation.
Only the recipient of the invitation may perform this mutation.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
organizationInvitation - ID! | The organization invitation. |
responseType - OrganizationInvitationResponseType! | The response to the invitation. |
Example
Query
mutation respondToOrganizationInvitation(
$organizationInvitation: ID!,
$responseType: OrganizationInvitationResponseType!
) {
respondToOrganizationInvitation(
organizationInvitation: $organizationInvitation,
responseType: $responseType
) {
alwaysNil
}
}
Variables
{
"organizationInvitation": "4",
"responseType": "ACCEPT"
}
Response
{
"data": {
"respondToOrganizationInvitation": {
"alwaysNil": "xyz789"
}
}
}
revokeOrganizationInvitation
Description
Revoke an existing organization invitation.
If the invitation has been accepted or rejected, it may no longer be revoked. After an invitation is revoked, the recipient may not accept or reject it. Both cases yield an error.
Only site admins and any member of the organization may perform this mutation.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
organizationInvitation - ID! | The organization invitation. |
Example
Query
mutation revokeOrganizationInvitation($organizationInvitation: ID!) {
revokeOrganizationInvitation(organizationInvitation: $organizationInvitation) {
alwaysNil
}
}
Variables
{"organizationInvitation": 4}
Response
{
"data": {
"revokeOrganizationInvitation": {
"alwaysNil": "xyz789"
}
}
}
sendTestEmail
Description
Sends an email for testing Sourcegraph's email configuration.
Only administrators can use this API.
setMigrationDirection
Description
Updates an out-of-band migration to run in a particular direction.
Applied in the forward direction, an out-of-band migration migrates data into a format that is readable by newer Sourcegraph instances. This may be destructive or non-destructive process, depending on the nature and implementation of the migration.
Applied in the reverse direction, an out-of-band migration ensures that data is moved back into a format that is readable by the previous Sourcegraph instance. Recently introduced migrations should be applied in reverse prior to downgrading the instance.
Response
Returns an EmptyResponse!
Example
Query
mutation setMigrationDirection(
$id: ID!,
$applyReverse: Boolean!
) {
setMigrationDirection(
id: $id,
applyReverse: $applyReverse
) {
alwaysNil
}
}
Variables
{"id": "4", "applyReverse": false}
Response
{
"data": {
"setMigrationDirection": {
"alwaysNil": "xyz789"
}
}
}
setSearchable
Description
Current user opt in/out from being searchable in the users picker.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
searchable - Boolean! |
Example
Query
mutation setSearchable($searchable: Boolean!) {
setSearchable(searchable: $searchable) {
alwaysNil
}
}
Variables
{"searchable": true}
Response
{
"data": {
"setSearchable": {"alwaysNil": "xyz789"}
}
}
setTag
Description
Adds or removes a tag on a user.
Tags are used internally by Sourcegraph as feature flags for experimental features.
Only site admins may perform this mutation.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
node - ID! | The ID of the user whose tags to set. (This parameter is named "node" to make it easy to support tagging other types of nodes other than users in the future.) |
tag - String! | The tag to set. |
present - Boolean! | The desired state of the tag on the user (whether to add or remove): true to add, false to remove. |
Example
Query
mutation setTag(
$node: ID!,
$tag: String!,
$present: Boolean!
) {
setTag(
node: $node,
tag: $tag,
present: $present
) {
alwaysNil
}
}
Variables
{
"node": 4,
"tag": "abc123",
"present": false
}
Response
{
"data": {
"setTag": {"alwaysNil": "xyz789"}
}
}
setTeamMembers
Description
This is a convenience method to forcefully overwrite the full set of members of a team. This is handy to sync external state without diffing the current members vs the desired set of members.
Either team XOR teamName can be specified to specify the team. Must be team member to modify team members, or site-admin.
For now, members can only be the IDs of User entities in Sourcegraph. Later, we will expand this to allow Persons as well.
Example
Query
mutation setTeamMembers(
$team: ID,
$teamName: String,
$members: [ID!]!
) {
setTeamMembers(
team: $team,
teamName: $teamName,
members: $members
) {
id
name
url
displayName
readonly
members {
...TeamMemberConnectionFragment
}
parentTeam {
...TeamFragment
}
childTeams {
...TeamConnectionFragment
}
viewerCanAdminister
}
}
Variables
{
"team": 4,
"teamName": "abc123",
"members": [4]
}
Response
{
"data": {
"setTeamMembers": {
"id": 4,
"name": "abc123",
"url": "xyz789",
"displayName": "abc123",
"readonly": true,
"members": TeamMemberConnection,
"parentTeam": Team,
"childTeams": TeamConnection,
"viewerCanAdminister": true
}
}
}
setTosAccepted
Description
Sets the user to accept the site's Terms of Service and Privacy Policy. If the ID is omitted, the current user is assumed.
Only the user or site admins may perform this mutation.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
userID - ID |
Example
Query
mutation setTosAccepted($userID: ID) {
setTosAccepted(userID: $userID) {
alwaysNil
}
}
Variables
{"userID": 4}
Response
{
"data": {
"setTosAccepted": {
"alwaysNil": "abc123"
}
}
}
setUserEmailPrimary
Description
Set an email address as the user's primary.
Only the user and site admins may perform this mutation.
Response
Returns an EmptyResponse!
Example
Query
mutation setUserEmailPrimary(
$user: ID!,
$email: String!
) {
setUserEmailPrimary(
user: $user,
email: $email
) {
alwaysNil
}
}
Variables
{"user": 4, "email": "abc123"}
Response
{
"data": {
"setUserEmailPrimary": {
"alwaysNil": "abc123"
}
}
}
setUserEmailVerified
Description
Manually set the verification status of a user's email, without going through the normal verification process (of clicking on a link in the email with a verification code).
Only site admins may perform this mutation.
Response
Returns an EmptyResponse!
Example
Query
mutation setUserEmailVerified(
$user: ID!,
$email: String!,
$verified: Boolean!
) {
setUserEmailVerified(
user: $user,
email: $email,
verified: $verified
) {
alwaysNil
}
}
Variables
{
"user": 4,
"email": "xyz789",
"verified": false
}
Response
{
"data": {
"setUserEmailVerified": {
"alwaysNil": "xyz789"
}
}
}
setUserIsSiteAdmin
Description
Sets whether the user with the specified user ID is a site admin.
Only site admins may perform this mutation.
Response
Returns an EmptyResponse
Example
Query
mutation setUserIsSiteAdmin(
$userID: ID!,
$siteAdmin: Boolean!
) {
setUserIsSiteAdmin(
userID: $userID,
siteAdmin: $siteAdmin
) {
alwaysNil
}
}
Variables
{"userID": "4", "siteAdmin": true}
Response
{
"data": {
"setUserIsSiteAdmin": {
"alwaysNil": "xyz789"
}
}
}
settingsMutation
Description
All mutations that update settings (global, organization, and user settings) are under this field.
Only the settings subject whose settings are being mutated (and site admins) may perform this mutation.
This mutation only affects global, organization, and user settings, not site configuration. For site configuration (which is a separate set of configuration properties from global/organization/user settings), use updateSiteConfiguration.
Response
Returns a SettingsMutation
Arguments
Name | Description |
---|---|
input - SettingsMutationGroupInput! |
Example
Query
mutation settingsMutation($input: SettingsMutationGroupInput!) {
settingsMutation(input: $input) {
editSettings {
...UpdateSettingsPayloadFragment
}
editConfiguration {
...UpdateSettingsPayloadFragment
}
overwriteSettings {
...UpdateSettingsPayloadFragment
}
}
}
Variables
{"input": SettingsMutationGroupInput}
Response
{
"data": {
"settingsMutation": {
"editSettings": UpdateSettingsPayload,
"editConfiguration": UpdateSettingsPayload,
"overwriteSettings": UpdateSettingsPayload
}
}
}
submitHappinessFeedback
Description
Submits happiness feedback.
Response
Returns an EmptyResponse
Arguments
Name | Description |
---|---|
input - HappinessFeedbackSubmissionInput! |
Example
Query
mutation submitHappinessFeedback($input: HappinessFeedbackSubmissionInput!) {
submitHappinessFeedback(input: $input) {
alwaysNil
}
}
Variables
{"input": HappinessFeedbackSubmissionInput}
Response
{
"data": {
"submitHappinessFeedback": {
"alwaysNil": "xyz789"
}
}
}
submitSurvey
Description
Submits a user satisfaction (NPS) survey.
Response
Returns an EmptyResponse
Arguments
Name | Description |
---|---|
input - SurveySubmissionInput! |
Example
Query
mutation submitSurvey($input: SurveySubmissionInput!) {
submitSurvey(input: $input) {
alwaysNil
}
}
Variables
{"input": SurveySubmissionInput}
Response
{
"data": {
"submitSurvey": {"alwaysNil": "abc123"}
}
}
syncExternalService
Description
Enqueues a sync for the external service. It will be picked up in the background.
Site-admin or owner of the external service only.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
id - ID! |
Example
Query
mutation syncExternalService($id: ID!) {
syncExternalService(id: $id) {
alwaysNil
}
}
Variables
{"id": "4"}
Response
{
"data": {
"syncExternalService": {
"alwaysNil": "xyz789"
}
}
}
triggerObservabilityTestAlert
Description
OBSERVABILITY
Set the status of a test alert of the specified parameters - useful for validating 'observability.alerts' configuration. Alerts may take up to a minute to fire.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
level - String! | Level of alert to test - either warning or critical. |
Example
Query
mutation triggerObservabilityTestAlert($level: String!) {
triggerObservabilityTestAlert(level: $level) {
alwaysNil
}
}
Variables
{"level": "abc123"}
Response
{
"data": {
"triggerObservabilityTestAlert": {
"alwaysNil": "xyz789"
}
}
}
updateExecutorSecret
Description
Update the value of an existing executor secret.
Response
Returns an ExecutorSecret!
Arguments
Name | Description |
---|---|
scope - ExecutorSecretScope! | The scope of the secret. |
id - ID! | The identifier of the secret that shall be updated. |
value - String! | The new secret value. |
Example
Query
mutation updateExecutorSecret(
$scope: ExecutorSecretScope!,
$id: ID!,
$value: String!
) {
updateExecutorSecret(
scope: $scope,
id: $id,
value: $value
) {
id
key
scope
overwritesGlobalSecret
namespace {
...NamespaceFragment
}
creator {
...UserFragment
}
createdAt
updatedAt
accessLogs {
...ExecutorSecretAccessLogConnectionFragment
}
}
}
Variables
{
"scope": "BATCHES",
"id": 4,
"value": "abc123"
}
Response
{
"data": {
"updateExecutorSecret": {
"id": 4,
"key": "xyz789",
"scope": "BATCHES",
"overwritesGlobalSecret": true,
"namespace": Namespace,
"creator": User,
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z",
"accessLogs": ExecutorSecretAccessLogConnection
}
}
}
updateExternalService
Description
Updates a external service. Only site admins may perform this mutation.
Response
Returns an ExternalService!
Arguments
Name | Description |
---|---|
input - UpdateExternalServiceInput! |
Example
Query
mutation updateExternalService($input: UpdateExternalServiceInput!) {
updateExternalService(input: $input) {
id
kind
displayName
config
createdAt
updatedAt
repoCount
webhookURL
warning
lastSyncError
lastSyncAt
nextSyncAt
webhookLogs {
...WebhookLogConnectionFragment
}
syncJobs {
...ExternalServiceSyncJobConnectionFragment
}
checkConnection {
... on ExternalServiceAvailable {
...ExternalServiceAvailableFragment
}
... on ExternalServiceUnavailable {
...ExternalServiceUnavailableFragment
}
... on ExternalServiceAvailabilityUnknown {
...ExternalServiceAvailabilityUnknownFragment
}
}
hasConnectionCheck
supportsRepoExclusion
}
}
Variables
{"input": UpdateExternalServiceInput}
Response
{
"data": {
"updateExternalService": {
"id": 4,
"kind": "AWSCODECOMMIT",
"displayName": "abc123",
"config": JSONCString,
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z",
"repoCount": 987,
"webhookURL": "abc123",
"warning": "abc123",
"lastSyncError": "abc123",
"lastSyncAt": "2007-12-03T10:15:30Z",
"nextSyncAt": "2007-12-03T10:15:30Z",
"webhookLogs": WebhookLogConnection,
"syncJobs": ExternalServiceSyncJobConnection,
"checkConnection": ExternalServiceAvailable,
"hasConnectionCheck": false,
"supportsRepoExclusion": true
}
}
}
updateFeatureFlag
Description
(experimental) Update a feature flag
Response
Returns a FeatureFlag!
Arguments
Name | Description |
---|---|
name - String! | The name of the feature flag |
value - Boolean | The value of the feature flag. Only set if the new feature flag will be a concrete boolean flag. Mutually exclusive with rollout. |
rolloutBasisPoints - Int | The ratio of users the feature flag will apply to, expressed in basis points (0.01%). Mutually exclusive with value. |
Example
Query
mutation updateFeatureFlag(
$name: String!,
$value: Boolean,
$rolloutBasisPoints: Int
) {
updateFeatureFlag(
name: $name,
value: $value,
rolloutBasisPoints: $rolloutBasisPoints
) {
... on FeatureFlagBoolean {
...FeatureFlagBooleanFragment
}
... on FeatureFlagRollout {
...FeatureFlagRolloutFragment
}
}
}
Variables
{
"name": "xyz789",
"value": false,
"rolloutBasisPoints": 123
}
Response
{"data": {"updateFeatureFlag": FeatureFlagBoolean}}
updateFeatureFlagOverride
Description
Update a feature flag override
Response
Returns a FeatureFlagOverride!
Example
Query
mutation updateFeatureFlagOverride(
$id: ID!,
$value: Boolean!
) {
updateFeatureFlagOverride(
id: $id,
value: $value
) {
id
namespace {
...NamespaceFragment
}
targetFlag {
... on FeatureFlagBoolean {
...FeatureFlagBooleanFragment
}
... on FeatureFlagRollout {
...FeatureFlagRolloutFragment
}
}
value
}
}
Variables
{"id": "4", "value": false}
Response
{
"data": {
"updateFeatureFlagOverride": {
"id": "4",
"namespace": Namespace,
"targetFlag": FeatureFlagBoolean,
"value": false
}
}
}
updateMirrorRepository
Description
Schedule the mirror repository to be updated from its original source repository. Updating occurs automatically, so this should not normally be needed.
Only site admins may perform this mutation.
Response
Returns an EmptyResponse!
Arguments
Name | Description |
---|---|
repository - ID! | The mirror repository to update. |
Example
Query
mutation updateMirrorRepository($repository: ID!) {
updateMirrorRepository(repository: $repository) {
alwaysNil
}
}
Variables
{"repository": 4}
Response
{
"data": {
"updateMirrorRepository": {
"alwaysNil": "xyz789"
}
}
}
updateOrganization
Description
Updates an organization.
Only site admins and any member of the organization may perform this mutation.
Example
Query
mutation updateOrganization(
$id: ID!,
$displayName: String
) {
updateOrganization(
id: $id,
displayName: $displayName
) {
executorSecrets {
...ExecutorSecretConnectionFragment
}
id
name
displayName
createdAt
members {
...NewUsersConnectionFragment
}
latestSettings {
...SettingsFragment
}
settingsCascade {
...SettingsCascadeFragment
}
configurationCascade {
...ConfigurationCascadeFragment
}
viewerPendingInvitation {
...OrganizationInvitationFragment
}
viewerCanAdminister
viewerIsMember
url
settingsURL
namespaceName
}
}
Variables
{"id": 4, "displayName": "abc123"}
Response
{
"data": {
"updateOrganization": {
"executorSecrets": ExecutorSecretConnection,
"id": 4,
"name": "abc123",
"displayName": "abc123",
"createdAt": "2007-12-03T10:15:30Z",
"members": NewUsersConnection,
"latestSettings": Settings,
"settingsCascade": SettingsCascade,
"configurationCascade": ConfigurationCascade,
"viewerPendingInvitation": OrganizationInvitation,
"viewerCanAdminister": true,
"viewerIsMember": false,
"url": "xyz789",
"settingsURL": "abc123",
"namespaceName": "abc123"
}
}
}
updatePassword
Description
Updates the current user's password. The oldPassword arg must match the user's current password.
Response
Returns an EmptyResponse
Example
Query
mutation updatePassword(
$oldPassword: String!,
$newPassword: String!
) {
updatePassword(
oldPassword: $oldPassword,
newPassword: $newPassword
) {
alwaysNil
}
}
Variables
{
"oldPassword": "xyz789",
"newPassword": "xyz789"
}
Response
{
"data": {
"updatePassword": {
"alwaysNil": "abc123"
}
}
}
updateRepoKeyValuePair
Description
Update a key-value pair associated with a repo.
Response
Returns an EmptyResponse!
Example
Query
mutation updateRepoKeyValuePair(
$repo: ID!,
$key: String!,
$value: String
) {
updateRepoKeyValuePair(
repo: $repo,
key: $key,
value: $value
) {
alwaysNil
}
}
Variables
{
"repo": "4",
"key": "xyz789",
"value": "abc123"
}
Response
{
"data": {
"updateRepoKeyValuePair": {
"alwaysNil": "abc123"
}
}
}
updateSavedSearch
Description
Updates a saved search
Response
Returns a SavedSearch!
Example
Query
mutation updateSavedSearch(
$id: ID!,
$description: String!,
$query: String!,
$notifyOwner: Boolean!,
$notifySlack: Boolean!,
$orgID: ID,
$userID: ID
) {
updateSavedSearch(
id: $id,
description: $description,
query: $query,
notifyOwner: $notifyOwner,
notifySlack: $notifySlack,
orgID: $orgID,
userID: $userID
) {
id
description
query
notify
notifySlack
namespace {
...NamespaceFragment
}
slackWebhookURL
}
}
Variables
{
"id": "4",
"description": "abc123",
"query": "abc123",
"notifyOwner": true,
"notifySlack": false,
"orgID": "4",
"userID": "4"
}
Response
{
"data": {
"updateSavedSearch": {
"id": "4",
"description": "xyz789",
"query": "abc123",
"notify": false,
"notifySlack": true,
"namespace": Namespace,
"slackWebhookURL": "xyz789"
}
}
}
updateSiteConfiguration
Description
Updates the site configuration. Returns whether or not a restart is required for the update to be applied.
Only site admins may perform this mutation.
Response
Returns a Boolean!
Arguments
Name | Description |
---|---|
lastID - Int! | The last ID of the site configuration that is known by the client, to prevent race conditions. An error will be returned if someone else has already written a new update. |
input - String! | A JSON object containing the entire site configuration. The previous site configuration will be replaced with this new value. |
Example
Query
mutation updateSiteConfiguration(
$lastID: Int!,
$input: String!
) {
updateSiteConfiguration(
lastID: $lastID,
input: $input
)
}
Variables
{"lastID": 123, "input": "abc123"}
Response
{"data": {"updateSiteConfiguration": false}}
updateTeam
Description
Update an existing team. ID or Name must be specified, but not both.
To unset the display name, pass an empty string. Null will make it ignore updates.
Either parentTeam XOR parentTeamName can be specified to make the team a child team of the given parent. The user has to be a team-member of both the child and parent team for that, and neither can be read-only. Site-admin can modify all teams without constraints.
Response
Returns a Team!
Example
Query
mutation updateTeam(
$id: ID,
$name: String,
$displayName: String,
$parentTeam: ID,
$parentTeamName: String
) {
updateTeam(
id: $id,
name: $name,
displayName: $displayName,
parentTeam: $parentTeam,
parentTeamName: $parentTeamName
) {
id
name
url
displayName
readonly
members {
...TeamMemberConnectionFragment
}
parentTeam {
...TeamFragment
}
childTeams {
...TeamConnectionFragment
}
viewerCanAdminister
}
}
Variables
{
"id": 4,
"name": "abc123",
"displayName": "xyz789",
"parentTeam": 4,
"parentTeamName": "xyz789"
}
Response
{
"data": {
"updateTeam": {
"id": 4,
"name": "abc123",
"url": "abc123",
"displayName": "abc123",
"readonly": false,
"members": TeamMemberConnection,
"parentTeam": Team,
"childTeams": TeamConnection,
"viewerCanAdminister": true
}
}
}
updateUser
Description
Updates the user profile information for the user with the given ID.
Only the user and site admins may perform this mutation.
Response
Returns a User!
Example
Query
mutation updateUser(
$user: ID!,
$username: String,
$displayName: String,
$avatarURL: String
) {
updateUser(
user: $user,
username: $username,
displayName: $displayName,
avatarURL: $avatarURL
) {
executorSecrets {
...ExecutorSecretConnectionFragment
}
id
username
email
displayName
avatarURL
url
settingsURL
createdAt
updatedAt
siteAdmin
builtinAuth
latestSettings {
...SettingsFragment
}
settingsCascade {
...SettingsCascadeFragment
}
configurationCascade {
...ConfigurationCascadeFragment
}
organizations {
...OrgConnectionFragment
}
organizationMemberships {
...OrganizationMembershipConnectionFragment
}
tags
tosAccepted
searchable
usageStatistics {
...UserUsageStatisticsFragment
}
eventLogs {
...EventLogsConnectionFragment
}
emails {
...UserEmailFragment
}
accessTokens {
...AccessTokenConnectionFragment
}
externalAccounts {
...ExternalAccountConnectionFragment
}
session {
...SessionFragment
}
viewerCanAdminister
viewerCanChangeUsername
surveyResponses {
...SurveyResponseFragment
}
databaseID
namespaceName
invitableCollaborators {
...PersonFragment
}
teams {
...TeamConnectionFragment
}
}
}
Variables
{
"user": 4,
"username": "xyz789",
"displayName": "abc123",
"avatarURL": "abc123"
}
Response
{
"data": {
"updateUser": {
"executorSecrets": ExecutorSecretConnection,
"id": 4,
"username": "xyz789",
"email": "xyz789",
"displayName": "abc123",
"avatarURL": "abc123",
"url": "abc123",
"settingsURL": "abc123",
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z",
"siteAdmin": true,
"builtinAuth": true,
"latestSettings": Settings,
"settingsCascade": SettingsCascade,
"configurationCascade": ConfigurationCascade,
"organizations": OrgConnection,
"organizationMemberships": OrganizationMembershipConnection,
"tags": ["xyz789"],
"tosAccepted": false,
"searchable": true,
"usageStatistics": UserUsageStatistics,
"eventLogs": EventLogsConnection,
"emails": [UserEmail],
"accessTokens": AccessTokenConnection,
"externalAccounts": ExternalAccountConnection,
"session": Session,
"viewerCanAdminister": false,
"viewerCanChangeUsername": false,
"surveyResponses": [SurveyResponse],
"databaseID": 123,
"namespaceName": "abc123",
"invitableCollaborators": [Person],
"teams": TeamConnection
}
}
}
updateWebhook
Description
Updates a webhook with given ID. Null values aren't updated.
Response
Returns a Webhook!
Example
Query
mutation updateWebhook(
$id: ID!,
$name: String,
$codeHostKind: String,
$codeHostURN: String,
$secret: String
) {
updateWebhook(
id: $id,
name: $name,
codeHostKind: $codeHostKind,
codeHostURN: $codeHostURN,
secret: $secret
) {
id
uuid
url
name
codeHostKind
codeHostURN
secret
updatedAt
updatedBy {
...UserFragment
}
createdAt
createdBy {
...UserFragment
}
webhookLogs {
...WebhookLogConnectionFragment
}
}
}
Variables
{
"id": 4,
"name": "xyz789",
"codeHostKind": "xyz789",
"codeHostURN": "xyz789",
"secret": "xyz789"
}
Response
{
"data": {
"updateWebhook": {
"id": "4",
"uuid": "xyz789",
"url": "abc123",
"name": "xyz789",
"codeHostKind": "AWSCODECOMMIT",
"codeHostURN": "abc123",
"secret": "xyz789",
"updatedAt": "2007-12-03T10:15:30Z",
"updatedBy": User,
"createdAt": "2007-12-03T10:15:30Z",
"createdBy": User,
"webhookLogs": WebhookLogConnection
}
}
}
Types
AccessToken
Description
An access token that grants to the holder the privileges of the user who created it.
Fields
Field Name | Description |
---|---|
id - ID! | The unique ID for the access token. |
subject - User! | The user whose privileges the access token grants. |
scopes - [String!]! | The scopes that define the allowed set of operations that can be performed using this access token. |
note - String! | A user-supplied descriptive note for the access token. |
creator - User! | The user who created the access token. This is either the subject user (if the access token was created by the same user) or a site admin (who can create access tokens for any user). |
createdAt - DateTime! | The date when the access token was created. |
lastUsedAt - DateTime | The date when the access token was last used to authenticate a request. |
Example
{
"id": 4,
"subject": User,
"scopes": ["abc123"],
"note": "xyz789",
"creator": User,
"createdAt": "2007-12-03T10:15:30Z",
"lastUsedAt": "2007-12-03T10:15:30Z"
}
AccessTokenConnection
Description
A list of access tokens.
Fields
Field Name | Description |
---|---|
nodes - [AccessToken!]! | A list of access tokens. |
totalCount - Int! | The total count of access tokens in the connection. This total count may be larger than the number of nodes in this object when the result is paginated. |
pageInfo - PageInfo! | Pagination information. |
Example
{
"nodes": [AccessToken],
"totalCount": 987,
"pageInfo": PageInfo
}
AddExternalServiceInput
Description
A new external service.
Fields
Input Field | Description |
---|---|
kind - ExternalServiceKind! | The kind of the external service. |
displayName - String! | The display name of the external service. |
config - String! | The JSON configuration of the external service. |
namespace - ID | The namespace this external service belongs to. This can be used both for a user and an organization. |
Example
{
"kind": "AWSCODECOMMIT",
"displayName": "abc123",
"config": "abc123",
"namespace": 4
}
Alert
Description
An alert message shown to the viewer.
Fields
Field Name | Description |
---|---|
type - AlertType! | The type of this alert. |
message - String! | The message body of this alert. Markdown is supported. |
isDismissibleWithKey - String | If set, this alert is dismissible. After being dismissed, no other alerts with the same isDismissibleWithKey value will be shown. If null, this alert is not dismissible. |
Example
{
"type": "INFO",
"message": "abc123",
"isDismissibleWithKey": "abc123"
}
AlertType
Description
The possible types of alerts (Alert.type values).
Values
Enum Value | Description |
---|---|
| |
| |
|
Example
"INFO"
Analytics
Description
Analytics describes a new site statistics.
Fields
Field Name | Description |
---|---|
search - AnalyticsSearchResult! | Search statistics. |
Arguments
| |
notebooks - AnalyticsNotebooksResults! | Notebooks statistics. |
Arguments
| |
users - AnalyticsUsersResult! | Users statistics. |
Arguments
| |
codeIntel - AnalyticsCodeIntelResult! | Code-intelligence statistics. |
Arguments
| |
codeIntelByLanguage - [AnalyticsCodeIntelByLanguageResult!]! | Code-intelligence statistics grouped by language and precision. |
Arguments
| |
codeIntelTopRepositories - [AnalyticsCodeIntelRepositoryResult!]! | Top repositories by code-intelligence events. |
Arguments
| |
repos - AnalyticsReposSummartResult! | Repositories summary statistics. |
batchChanges - AnalyticsBatchChangesResult! | Batch changes statistics |
Arguments
| |
extensions - AnalyticsExtensionsResult! | Extensions statistics |
Arguments
| |
codeInsights - AnalyticsCodesInsightsResult! | Code insights statistics |
Arguments
|
Example
{
"search": AnalyticsSearchResult,
"notebooks": AnalyticsNotebooksResults,
"users": AnalyticsUsersResult,
"codeIntel": AnalyticsCodeIntelResult,
"codeIntelByLanguage": [
AnalyticsCodeIntelByLanguageResult
],
"codeIntelTopRepositories": [
AnalyticsCodeIntelRepositoryResult
],
"repos": AnalyticsReposSummartResult,
"batchChanges": AnalyticsBatchChangesResult,
"extensions": AnalyticsExtensionsResult,
"codeInsights": AnalyticsCodesInsightsResult
}
AnalyticsBatchChangesResult
Description
Batch changes analytics.
Fields
Field Name | Description |
---|---|
changesetsCreated - AnalyticsStatItem! | Changesets created |
changesetsMerged - AnalyticsStatItem! | Changesets merged |
Example
{
"changesetsCreated": AnalyticsStatItem,
"changesetsMerged": AnalyticsStatItem
}
AnalyticsCodeIntelByLanguageResult
AnalyticsCodeIntelRepositoryResult
Description
CodeIntelTopRepositories analytics.
Example
{
"name": "abc123",
"language": "xyz789",
"kind": "abc123",
"precision": "xyz789",
"events": 987.65,
"hasPrecise": false
}
AnalyticsCodeIntelResult
Description
CodeIntel' analytics.
Fields
Field Name | Description |
---|---|
referenceClicks - AnalyticsStatItem! | "GoToRef" click |
definitionClicks - AnalyticsStatItem! | "GoToDef" click |
inAppEvents - AnalyticsStatItem! | Code Intel events made from web |
codeHostEvents - AnalyticsStatItem! | Code Intel events made from code host |
searchBasedEvents - AnalyticsStatItem! | Search based events |
preciseEvents - AnalyticsStatItem! | Precise events |
crossRepoEvents - AnalyticsStatItem! | Cross-repo events |
Example
{
"referenceClicks": AnalyticsStatItem,
"definitionClicks": AnalyticsStatItem,
"inAppEvents": AnalyticsStatItem,
"codeHostEvents": AnalyticsStatItem,
"searchBasedEvents": AnalyticsStatItem,
"preciseEvents": AnalyticsStatItem,
"crossRepoEvents": AnalyticsStatItem
}
AnalyticsCodesInsightsResult
Description
Code insights analytics.
Fields
Field Name | Description |
---|---|
insightHovers - AnalyticsStatItem! | Insights hovers statistics. |
insightDataPointClicks - AnalyticsStatItem! | Insights data point clicks statistics. |
Example
{
"insightHovers": AnalyticsStatItem,
"insightDataPointClicks": AnalyticsStatItem
}
AnalyticsDateRange
Description
A pre-defined periods to get site analytics.
Values
Enum Value | Description |
---|---|
| Last 3 months date range. |
| Last month date range. |
| Last week date range. |
| Custom date range. |
Example
"LAST_THREE_MONTHS"
AnalyticsExtensionsResult
Description
Extentions analytics.
Fields
Field Name | Description |
---|---|
jetbrains - AnalyticsStatItem! | JetBrains IDE plugin search events. |
vscode - AnalyticsStatItem! | VSCode IDE extension search events. |
browser - AnalyticsStatItem! | Browser (chrome, firefox, safari) extensions code navigation events. This includes events like "Go to Def", "Find ref" and "Find implementation" |
Example
{
"jetbrains": AnalyticsStatItem,
"vscode": AnalyticsStatItem,
"browser": AnalyticsStatItem
}
AnalyticsGrouping
Description
Group site analytics by period.
Values
Enum Value | Description |
---|---|
| Group data by day. |
| Group data by week. |
Example
"DAILY"
AnalyticsMonthlyActiveUsers
AnalyticsNotebooksResults
Description
Notebook analytics.
Fields
Field Name | Description |
---|---|
creations - AnalyticsStatItem! | Notebooks creation analytics. |
views - AnalyticsStatItem! | Notebooks views analytics. |
blockRuns - AnalyticsStatItem! | Notebooks block run analytics. |
Example
{
"creations": AnalyticsStatItem,
"views": AnalyticsStatItem,
"blockRuns": AnalyticsStatItem
}
AnalyticsReposSummartResult
AnalyticsSearchResult
Description
Search analytics.
Fields
Field Name | Description |
---|---|
searches - AnalyticsStatItem! | Searches analytics |
resultClicks - AnalyticsStatItem! | Search result click analytics |
fileViews - AnalyticsStatItem! | File view analytics |
fileOpens - AnalyticsStatItem! | File open analytics |
codeCopied - AnalyticsStatItem! | Code copied from search results analytics |
Example
{
"searches": AnalyticsStatItem,
"resultClicks": AnalyticsStatItem,
"fileViews": AnalyticsStatItem,
"fileOpens": AnalyticsStatItem,
"codeCopied": AnalyticsStatItem
}
AnalyticsStatItem
Description
Analytics result item.
Fields
Field Name | Description |
---|---|
summary - AnalyticsStatItemSummary! | Analytics summary. |
nodes - [AnalyticsStatItemNode!]! | Array of analytics by period. |
Example
{
"summary": AnalyticsStatItemSummary,
"nodes": [AnalyticsStatItemNode]
}
AnalyticsStatItemNode
Description
Analytics for certain date.
Fields
Field Name | Description |
---|---|
date - String! | A date in ISO format |
count - Float! | Total number of events. |
uniqueUsers - Float! | Unique number of users who triggered event. This counts deleted users as well as anonymous users. |
registeredUsers - Float! | Unique number of currently registered users who triggered event. |
Example
{
"date": "xyz789",
"count": 987.65,
"uniqueUsers": 123.45,
"registeredUsers": 987.65
}
AnalyticsStatItemSummary
Description
Analytics summary.
Fields
Field Name | Description |
---|---|
totalCount - Float! | Total number of events. |
totalUniqueUsers - Float! | Total unique number of users who triggered event. This counts deleted users as well as anonymous users. |
totalRegisteredUsers - Float! | Total unique number of currently registered users who triggered event. |
Example
{
"totalCount": 123.45,
"totalUniqueUsers": 123.45,
"totalRegisteredUsers": 123.45
}
AnalyticsUsersFrequencyItem
AnalyticsUsersResult
Description
Users' analytics.
Fields
Field Name | Description |
---|---|
activity - AnalyticsStatItem! | Users' activity analytics. |
frequencies - [AnalyticsUsersFrequencyItem!]! | Frequency of usage by day. |
monthlyActiveUsers - [AnalyticsMonthlyActiveUsers!]! | Monthly active users for last 3 months. |
Example
{
"activity": AnalyticsStatItem,
"frequencies": [AnalyticsUsersFrequencyItem],
"monthlyActiveUsers": [AnalyticsMonthlyActiveUsers]
}
AuthProvider
Description
A provider of user authentication, such as an external single-sign-on service (e.g., using OpenID Connect or SAML). The provider information in this type is visible to all viewers and does not contain any secret values.
Fields
Field Name | Description |
---|---|
serviceType - String! | The type of the auth provider. |
serviceID - String! | An identifier for the service that the auth provider represents. |
clientID - String! | An identifier for the client of the service that the auth provider represents. |
displayName - String! | The human-readable name of the provider. |
isBuiltin - Boolean! | Whether this auth provider is the builtin username-password auth provider. |
authenticationURL - String | A URL that, when visited, initiates the authentication process for this auth provider. |
Example
{
"serviceType": "xyz789",
"serviceID": "xyz789",
"clientID": "xyz789",
"displayName": "xyz789",
"isBuiltin": false,
"authenticationURL": "abc123"
}
AuthProviderConnection
Description
A list of authentication providers.
Fields
Field Name | Description |
---|---|
nodes - [AuthProvider!]! | A list of authentication providers. |
totalCount - Int! | The total count of authentication providers in the connection. This total count may be larger than the number of nodes in this object when the result is paginated. |
pageInfo - PageInfo! | Pagination information. |
Example
{
"nodes": [AuthProvider],
"totalCount": 123,
"pageInfo": PageInfo
}
AutocompleteMemberSearchItem
Description
Result user returned by invite members autocomplete search.
Example
{
"id": 4,
"username": "xyz789",
"displayName": "abc123",
"avatarURL": "xyz789",
"inOrg": true
}
BackgroundJob
Description
A single background job.
Fields
Field Name | Description |
---|---|
id - ID! | The background job ID. |
name - String! | The name of the job. |
routines - [BackgroundRoutine!]! | The routines that run inside this job. |
Example
{
"id": "4",
"name": "xyz789",
"routines": [BackgroundRoutine]
}
BackgroundJobConnection
Description
A list of background jobs that are currently known in the system
Fields
Field Name | Description |
---|---|
nodes - [BackgroundJob!]! | A list of outbound requests. |
totalCount - Int! | The total number of outbound request log items in the connection. |
pageInfo - PageInfo! | Pagination information. |
Example
{
"nodes": [BackgroundJob],
"totalCount": 123,
"pageInfo": PageInfo
}
BackgroundRoutine
Description
A routine that runs inside a background job.
Fields
Field Name | Description |
---|---|
name - String! | The name of the routine. |
type - BackgroundRoutineType! | Tells whether this is a periodic goroutine, a DB worker, or something else |
description - String! | Explains what the routine does. |
intervalMs - Int | The interval at which the routine runs, if it's periodic. |
instances - [BackgroundRoutineInstance!]! | The instances of this routine that are running or ran recently. An instance means one routine on one host. |
recentRuns - [BackgroundRoutineRecentRun!]! | The recent runs of this routine. |
stats - BackgroundRoutineStats! | Some stats of the runs of this routine in the past few days. |
Example
{
"name": "abc123",
"type": "PERIODIC",
"description": "abc123",
"intervalMs": 987,
"instances": [BackgroundRoutineInstance],
"recentRuns": [BackgroundRoutineRecentRun],
"stats": BackgroundRoutineStats
}
BackgroundRoutineInstance
Description
One instance of the background routine, running on a host.
Example
{
"hostName": "abc123",
"lastStartedAt": "2007-12-03T10:15:30Z",
"lastStoppedAt": "2007-12-03T10:15:30Z"
}
BackgroundRoutineRecentRun
Description
A single run of the routine. A run is not the start/stop event but the actual execution of the routine handler.
Example
{
"at": "2007-12-03T10:15:30Z",
"hostName": "xyz789",
"durationMs": 123,
"errorMessage": "xyz789"
}
BackgroundRoutineStats
Description
Holds statistics about a background routine.
Fields
Field Name | Description |
---|---|
since - DateTime | The start of the earliest day for which we have any runs registered. |
runCount - Int! | The number of times the routine ran in the period. |
errorCount - Int! | The number of times the routine run ended with an error. |
minDurationMs - Int! | The minimum duration of a run, in milliseconds. |
avgDurationMs - Int! | The average duration of a run, in milliseconds. |
maxDurationMs - Int! | The maximum duration of a run, in milliseconds. |
Example
{
"since": "2007-12-03T10:15:30Z",
"runCount": 123,
"errorCount": 123,
"minDurationMs": 123,
"avgDurationMs": 123,
"maxDurationMs": 123
}
BackgroundRoutineType
Description
Enum of the possible background routine types
Values
Enum Value | Description |
---|---|
| Periodic routine |
| Periodic routine with metrics set up |
| DB-backed worker |
| Custom routine |
Example
"PERIODIC"
BehindAheadCounts
BidirectionalPageInfo
Description
Pagination information for bi-directional pagination. See https://facebook.github.io/relay/graphql/connections.htm#sec-undefined.PageInfo.
Fields
Field Name | Description |
---|---|
startCursor - String | When paginating backwards, the cursor to continue. |
endCursor - String | When paginating forwards, the cursor to continue. |
hasPreviousPage - Boolean! | When paginating backwards, are there more items? |
hasNextPage - Boolean! | When paginating forwards, are there more items? |
Example
{
"startCursor": "xyz789",
"endCursor": "abc123",
"hasPreviousPage": true,
"hasNextPage": false
}
BigInt
Description
An arbitrarily large integer encoded as a decimal string.
Example
{}
Boolean
Description
The Boolean
scalar type represents true
or false
.
CheckMirrorRepositoryConnectionResult
Description
The result for Mutation.checkMirrorRepositoryConnection.
Fields
Field Name | Description |
---|---|
error - String | The error message encountered during the update operation, if any. If null, then the connection check succeeded. |
Example
{"error": "abc123"}
ChunkMatch
Description
A set of matched ranges contained in a chunk of contiguous lines.
Example
{
"content": "xyz789",
"contentStart": Position,
"ranges": [Range]
}
ClientConfigurationDetails
Description
Configuration details for the browser extension, editor extensions, etc.
Fields
Field Name | Description |
---|---|
contentScriptUrls - [String!]! | The list of phabricator/gitlab/bitbucket/etc instance URLs that specifies which pages the content script will be injected into. |
parentSourcegraph - ParentSourcegraphDetails! | Returns details about the parent Sourcegraph instance. |
Example
{
"contentScriptUrls": ["xyz789"],
"parentSourcegraph": ParentSourcegraphDetails
}
CloneStatus
Description
The clone status of a repository.
Values
Enum Value | Description |
---|---|
| |
| |
|
Example
"NOT_CLONED"
CloningProgress
Description
FOR INTERNAL USE ONLY: A status message produced when repositories are being cloned
Fields
Field Name | Description |
---|---|
message - String! | The message of this status message |
Example
{"message": "abc123"}
CodeIntelCommit
Description
A Code Intel Commit.
Fields
Field Name | Description |
---|---|
id - ID! | The globally addressable ID for this commit. |
oid - GitObjectID! | This commit's Git object ID (OID), a 40-character SHA-1 hash. |
abbreviatedOID - String! | The abbreviated form of this commit's OID. |
url - String! | The URL to this commit (using the input revision specifier, which may not be immutable). |
repository - CodeIntelRepository! | The repository that contains this commit. |
Example
{
"id": "4",
"oid": GitObjectID,
"abbreviatedOID": "xyz789",
"url": "xyz789",
"repository": CodeIntelRepository
}
CodeIntelExternalRepository
Description
A repository on an external service (such as GitHub, GitLab, Phabricator, etc.).
Fields
Field Name | Description |
---|---|
serviceType - String! | The type of external service where this repository resides. Example: "github", "gitlab", etc. |
serviceID - String! | The particular instance of the external service where this repository resides. Its value is opaque but typically consists of the canonical base URL to the service. Example: For GitHub.com, this is "https://github.com/". |
Example
{
"serviceType": "xyz789",
"serviceID": "xyz789"
}
CodeIntelGitBlob
Description
A gitblob resolver specific to code intel.
Fields
Field Name | Description |
---|---|
path - String! | The full path (relative to the root) of this tree. |
name - String! | The base name (i.e., last path component only) of this tree. |
commit - CodeIntelCommit! | The Git commit containing this tree. |
url - String! | The URL to this tree (using the input revision specifier, which may not be immutable). |
repository - CodeIntelRepository! | The repository containing this tree. |
content - String! | The content of this blob. |
Example
{
"path": "xyz789",
"name": "abc123",
"commit": CodeIntelCommit,
"url": "abc123",
"repository": CodeIntelRepository,
"content": "abc123"
}
CodeIntelRepository
Description
A codeintel repository is a Git source control repository that is mirrored from some origin code host and it is specific to code intel.
Fields
Field Name | Description |
---|---|
id - ID! | The globally addressable ID for this commit. |
name - String! | The repository's name, as a path with one or more components. It conventionally consists of the repository's hostname and path (joined by "/"), minus any suffixes (such as ".git"). Examples:
|
url - String! | The URL to this repository. |
externalRepository - CodeIntelExternalRepository | Information about this repository from the external service that it originates from (such as GitHub, GitLab, Phabricator, etc.). Only populated when used as part of repository list previews for configuration policies. |
Example
{
"id": 4,
"name": "xyz789",
"url": "xyz789",
"externalRepository": CodeIntelExternalRepository
}
CodeIntelligenceCommitGraph
Description
Information and status related to the commit graph of this repository calculated for use by code intelligence features.
Example
{
"stale": true,
"updatedAt": "2007-12-03T10:15:30Z"
}
CommitSearchResult
Description
A search result that is a Git commit.
Fields
Field Name | Description |
---|---|
label - Markdown! | A markdown string that is rendered prominently. |
url - String! | The URL of the result. |
detail - Markdown! | A markdown string of that is rendered less prominently. |
matches - [SearchResultMatch!]! | The result previews of the result. |
commit - GitCommit! | The commit that matched the search query. |
refs - [GitRef!]! | The ref names of the commit. |
sourceRefs - [GitRef!]! | The refs by which this commit was reached. |
messagePreview - HighlightedString | The matching portion of the commit message, if any. |
diffPreview - HighlightedString | The matching portion of the diff, if any. |
Example
{
"label": Markdown,
"url": "abc123",
"detail": Markdown,
"matches": [SearchResultMatch],
"commit": GitCommit,
"refs": [GitRef],
"sourceRefs": [GitRef],
"messagePreview": HighlightedString,
"diffPreview": HighlightedString
}
Configuration
Description
DEPRECATED: Use the contents field on the parent type instead. This type will be removed in a future release.
Fields
Field Name | Description |
---|---|
contents - JSONCString! | DEPRECATED: This field will be removed in a future release. The raw JSON contents, encoded as a string. use the contents field on the parent type instead |
messages - [String!]! | DEPRECATED: This field is always empty. It will be removed in a future release. use client-side JSON Schema validation instead |
Example
{
"contents": JSONCString,
"messages": ["xyz789"]
}
ConfigurationCascade
Description
DEPRECATED: Renamed to SettingsCascade.
Fields
Field Name | Description |
---|---|
subjects - [SettingsSubject!]! | DEPRECATED use SettingsCascade.subjects instead |
merged - Configuration! | DEPRECATED use SettingsCascade.final instead |
Example
{
"subjects": [SettingsSubject],
"merged": Configuration
}
ConfigurationEdit
Description
DEPRECATED: This type was renamed to SettingsEdit. NOTE: GraphQL does not support @deprecated directives on INPUT_FIELD_DEFINITION (input fields).
Fields
Input Field | Description |
---|---|
keyPath - [KeyPathSegment!]! | DEPRECATED |
value - JSONValue | DEPRECATED |
valueIsJSONCEncodedString - Boolean | DEPRECATED. Default = false |
Example
{
"keyPath": [KeyPathSegment],
"value": JSONValue,
"valueIsJSONCEncodedString": true
}
Connection
Description
An object with totalCount and PageInfo.
Fields
Field Name | Description |
---|---|
totalCount - Int! | The total count of items in the connection. |
pageInfo - ConnectionPageInfo! | The pagination info for the connection. |
Possible Types
Connection Types |
---|
Example
{"totalCount": 987, "pageInfo": ConnectionPageInfo}
ConnectionPageInfo
Description
Pagination information.
Fields
Field Name | Description |
---|---|
endCursor - String | When paginating forwards, the cursor to continue. |
hasNextPage - Boolean! | When paginating forwards, are there more items? |
startCursor - String | When paginating backward, the cursor to continue. |
hasPreviousPage - Boolean! | When paginating backward, are there more items? |
Example
{
"endCursor": "abc123",
"hasNextPage": true,
"startCursor": "abc123",
"hasPreviousPage": true
}
CreateAccessTokenResult
Description
The result for Mutation.createAccessToken.
Example
{
"id": "4",
"token": "xyz789"
}
CreateUserResult
Description
The result for Mutation.createUser.
Fields
Field Name | Description |
---|---|
user - User! | The new user. |
resetPasswordURL - String | The reset password URL that the new user must visit to sign into their account. If the builtin username-password authentication provider is not enabled, this field's value is null. If email sending (SMTP) is configured on this instance and an email was provided, an email containing this URL will also be sent to the primary email address associated with the user. |
Example
{
"user": User,
"resetPasswordURL": "abc123"
}
DateTime
Description
An RFC 3339-encoded UTC date string, such as 1973-11-29T21:33:09Z. This value can be parsed into a JavaScript Date using Date.parse. To produce this value from a JavaScript Date instance, use Date#toISOString.
Example
"2007-12-03T10:15:30Z"
DefaultSettings
Description
The default settings for the Sourcegraph instance. This is hardcoded in Sourcegraph, but may change from release to release.
Fields
Field Name | Description |
---|---|
id - ID! | The opaque GraphQL ID. |
latestSettings - Settings | The latest default settings (this never changes). |
settingsURL - String | The URL to the default settings. This URL does not exist because you cannot edit or directly view default settings. |
viewerCanAdminister - Boolean! | Whether the viewer can modify the subject's settings. Always false for default settings. |
settingsCascade - SettingsCascade! | The default settings, and the final merged settings. All viewers can access this field. |
configurationCascade - ConfigurationCascade! | DEPRECATED Use settingsCascade instead. This field is a deprecated alias for it and will be removed in a future release. |
Example
{
"id": 4,
"latestSettings": Settings,
"settingsURL": "xyz789",
"viewerCanAdminister": true,
"settingsCascade": SettingsCascade,
"configurationCascade": ConfigurationCascade
}
DiffHunkLineType
Description
The type of content in a hunk line.
Values
Enum Value | Description |
---|---|
| Added line. |
| Unchanged line. |
| Deleted line. |
Example
"ADDED"
DiffStat
EmptyResponse
Description
Represents a null return value.
Fields
Field Name | Description |
---|---|
alwaysNil - String | A dummy null value. |
Example
{"alwaysNil": "abc123"}
EvaluatedFeatureFlag
Description
An evaluated feature flag is any feature flag (static or random) that has been evaluated to a concrete value for a given viewer.
Example
{"name": "xyz789", "value": false}
Event
Description
A description of a user event.
Fields
Input Field | Description |
---|---|
event - String! | The name of the event. |
userCookieID - String! | The randomly generated unique user ID stored in a browser cookie. |
firstSourceURL - String | The first sourcegraph URL visited by the user, stored in a browser cookie. |
lastSourceURL - String | The last sourcegraph URL visited by the user, stored in a browser cookie. |
url - String! | The URL when the event was logged. |
source - EventSource! | The source of the event. |
cohortID - String | An optional cohort ID to identify the user as part of a specific A/B test. The cohort ID is expected to be a date in the form YYYY-MM-DD |
referrer - String | An optional referrer parameter for the user's current session. Only captured and stored on Sourcegraph Cloud. |
originalReferrer - String | The original referrer for a user |
sessionReferrer - String | The session referrer for a user |
sessionFirstURL - String | The sessions first url for a user |
deviceSessionID - String | Device session ID to identify the user's session for analytics. |
argument - String | The additional argument information. |
publicArgument - String | Public argument information. PRIVACY: Do NOT include any potentially private information in this field. These properties get sent to our analytics tools for Cloud, so must not include private information, such as search queries or repository names. |
deviceID - String | Device ID used for Amplitude analytics. Used on Sourcegraph Cloud only. |
eventID - Int | Event ID used to deduplicate events that occur simultaneously in Amplitude analytics. See https://developers.amplitude.com/docs/http-api-v2#optional-keys. Used on Sourcegraph Cloud only. |
insertID - String | Insert ID used to deduplicate events that re-occur in the event of retries or backfills in Amplitude analytics. See https://developers.amplitude.com/docs/http-api-v2#optional-keys. Used on Sourcegraph Cloud only. |
Example
{
"event": "xyz789",
"userCookieID": "xyz789",
"firstSourceURL": "abc123",
"lastSourceURL": "xyz789",
"url": "abc123",
"source": "WEB",
"cohortID": "xyz789",
"referrer": "xyz789",
"originalReferrer": "xyz789",
"sessionReferrer": "abc123",
"sessionFirstURL": "xyz789",
"deviceSessionID": "xyz789",
"argument": "abc123",
"publicArgument": "abc123",
"deviceID": "xyz789",
"eventID": 987,
"insertID": "abc123"
}
EventLog
Description
A single user event that has been logged.
Fields
Field Name | Description |
---|---|
name - String! | The name of the event. |
user - User | The user who executed the event, if one exists. |
anonymousUserID - String! | The randomly generated unique user ID stored in a browser cookie. |
url - String! | The URL when the event was logged. |
source - EventSource! | The source of the event. |
argument - String | The additional argument information. |
version - String! | The Sourcegraph version when the event was logged. |
timestamp - DateTime! | The timestamp when the event was logged. |
Example
{
"name": "abc123",
"user": User,
"anonymousUserID": "abc123",
"url": "abc123",
"source": "WEB",
"argument": "xyz789",
"version": "xyz789",
"timestamp": "2007-12-03T10:15:30Z"
}
EventLogsConnection
Description
A list of event logs.
Fields
Field Name | Description |
---|---|
nodes - [EventLog!]! | A list of event logs. |
totalCount - Int! | The total count of event logs in the connection. This total count may be larger than the number of nodes in this object when the result is paginated. |
pageInfo - PageInfo! | Pagination information. |
Example
{
"nodes": [EventLog],
"totalCount": 987,
"pageInfo": PageInfo
}
EventSource
Description
The product sources where events can come from.
Values
Enum Value | Description |
---|---|
| |
| |
| |
| |
|
Example
"WEB"
Executor
Description
An active executor compute instance.
Fields
Field Name | Description |
---|---|
id - ID! | The unique identifier of this executor. |
hostname - String! | The hostname of the executor instance. |
queueName - String! | The queue name that the executor polls for work. |
active - Boolean! | Active is true, if a heartbeat from the executor has been received at most three heartbeat intervals ago. |
os - String! | The operating system running the executor. |
architecture - String! | The machine architecture running the executor. |
dockerVersion - String! | The version of Git used by the executor. |
executorVersion - String! | The version of the executor. |
gitVersion - String! | The version of Docker used by the executor. |
igniteVersion - String! | The version of Ignite used by the executor. |
srcCliVersion - String! | The version of src-cli used by the executor. |
firstSeenAt - DateTime! | The first time the executor sent a heartbeat to the Sourcegraph instance. |
lastSeenAt - DateTime! | The last time the executor sent a heartbeat to the Sourcegraph instance. |
compatibility - ExecutorCompatibility | The compatibility of the executor with respect to the Sourcegraph instance. If outdated, please make sure that the executor and the Sourcegraph backend are of compatible versions. This means they should match in major and minor version, but they may be 1 minor version apart. If too new, please update the Sourcegraph instance to match the version of the executor or downgrade the executor. Compatibility can be null if the executor or Sourcegraph instance runs in dev mode or there's a version mismatch. |
Example
{
"id": "4",
"hostname": "abc123",
"queueName": "xyz789",
"active": false,
"os": "xyz789",
"architecture": "xyz789",
"dockerVersion": "xyz789",
"executorVersion": "abc123",
"gitVersion": "abc123",
"igniteVersion": "xyz789",
"srcCliVersion": "abc123",
"firstSeenAt": "2007-12-03T10:15:30Z",
"lastSeenAt": "2007-12-03T10:15:30Z",
"compatibility": "OUTDATED"
}
ExecutorCompatibility
Description
The compatibility of the executor with the sourcegraph instance.
Values
Enum Value | Description |
---|---|
| Executor version is more than one version behind the Sourcegraph instance. |
| Executor is up-to-date with the Sourcegraph instance. |
| Executor version is more than one version ahead of the Sourcegraph instance. |
Example
"OUTDATED"
ExecutorConnection
Description
A list of active executors compute instances.
Fields
Field Name | Description |
---|---|
nodes - [Executor!]! | A list of executors. |
totalCount - Int! | The total number of executors in this result set. |
pageInfo - PageInfo! | Pagination information. |
Example
{
"nodes": [Executor],
"totalCount": 987,
"pageInfo": PageInfo
}
ExecutorSecret
Description
A secret to be used in executor jobs.
Fields
Field Name | Description |
---|---|
id - ID! | The unique identifier of the secret. |
key - String! | The key under which the secret is available. Secrets are usually exposed as environment variables named using this key. Recommended format: uppercase letters, numbers and underscores. |
scope - ExecutorSecretScope! | The scope of this secret. The secret will only be usable for jobs in this particular scope. |
overwritesGlobalSecret - Boolean! | If true, this secret is defined in a namespace and a secret with the same key is also defined in the global namespace, which this secret overwrites. |
namespace - Namespace | The namespace this secret belongs to. Null, if a global secret. Global secrets are available to every execution. |
creator - User | The creator of the secret. Null, if the creator has been deleted. |
createdAt - DateTime! | The date and time this secret has been created. |
updatedAt - DateTime! | The date and time this secret has been last updated. |
accessLogs - ExecutorSecretAccessLogConnection! | The list of access events to this secret. Every time the secret value is decoded and used, one of these entries is created. |
Example
{
"id": 4,
"key": "xyz789",
"scope": "BATCHES",
"overwritesGlobalSecret": false,
"namespace": Namespace,
"creator": User,
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z",
"accessLogs": ExecutorSecretAccessLogConnection
}
ExecutorSecretAccessLog
Description
An access log entry for an executor secret. These are created every time the secret value is decoded.
Fields
Field Name | Description |
---|---|
id - ID! | The unique identifier of the log entry. |
executorSecret - ExecutorSecret! | The secret that this log entry belongs to. |
user - User | The user in which name the secret has been used. This is null when the access was not by a user account, or when the user account was deleted. |
machineUser - String! | True when the secret was accessed by an internal procedure. |
createdAt - DateTime! | The date and time when the secret has been used. |
Example
{
"id": 4,
"executorSecret": ExecutorSecret,
"user": User,
"machineUser": "xyz789",
"createdAt": "2007-12-03T10:15:30Z"
}
ExecutorSecretAccessLogConnection
Description
A list of executor secret access logs.
Fields
Field Name | Description |
---|---|
nodes - [ExecutorSecretAccessLog!]! | A list of access logs. |
totalCount - Int! | The total number of records in this result set. |
pageInfo - PageInfo! | Pagination information. |
Example
{
"nodes": [ExecutorSecretAccessLog],
"totalCount": 123,
"pageInfo": PageInfo
}
ExecutorSecretConnection
Description
A list of executor secrets.
Fields
Field Name | Description |
---|---|
nodes - [ExecutorSecret!]! | A list of executor secrets. |
totalCount - Int! | The total number of records in this result set. |
pageInfo - PageInfo! | Pagination information. |
Example
{
"nodes": [ExecutorSecret],
"totalCount": 987,
"pageInfo": PageInfo
}
ExecutorSecretScope
Description
Enum of the possible scopes for executor secrets.
Values
Enum Value | Description |
---|---|
| The secret is meant to be used with Batch Changes execution. |
| The secret is meant to be used with Auto-indexing. |
Example
"BATCHES"
ExtensionManifest
Description
A description of the extension, how to run or access it, and when to activate it.
Fields
Field Name | Description |
---|---|
raw - String! | The raw JSON (or JSONC) contents of the manifest. This value may be large (because many manifests contain README and icon data), and it is JSONC (not strict JSON), which means it must be parsed with a JSON parser that supports trailing commas and comments. Consider using jsonFields instead. |
jsonFields - JSONValue! | The manifest as JSON (not JSONC, even if the raw manifest is JSONC) with only the specified fields. This is useful for callers that only need certain fields and want to avoid fetching a large amount of data (because many manifests contain README and icon data). |
Arguments
|
Example
{
"raw": "xyz789",
"jsonFields": JSONValue
}
ExtensionRegistry
Description
An extension registry.
Fields
Field Name | Description |
---|---|
extensions - RegistryExtensionConnection! | A list of extensions published in the extension registry. |
Example
{"extensions": RegistryExtensionConnection}
ExternalAccount
Description
An external account associated with a user.
Fields
Field Name | Description |
---|---|
id - ID! | The unique ID for the external account. |
user - User! | The user on Sourcegraph. |
serviceType - String! | The type of the external service where the external account resides. |
serviceID - String! | An identifier for the external service where the external account resides. |
clientID - String! | An identifier for the client of the external service where the external account resides. This distinguishes among multiple authentication providers that access the same service with different parameters. |
accountID - String! | An identifier for the external account (typically equal to or derived from the ID on the external service). |
createdAt - DateTime! | The creation date of this external account on Sourcegraph. |
updatedAt - DateTime! | The last-updated date of this external account on Sourcegraph. |
refreshURL - String | A URL that, when visited, re-initiates the authentication process. |
accountData - JSONValue | Provider-specific data about the external account. Only site admins may query this field. |
publicAccountData - PublicExternalAccountData | Public provider-specific data about the external account. Only users that are linked to the external account and site admins may query this field. |
Example
{
"id": 4,
"user": User,
"serviceType": "xyz789",
"serviceID": "abc123",
"clientID": "abc123",
"accountID": "xyz789",
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z",
"refreshURL": "xyz789",
"accountData": JSONValue,
"publicAccountData": PublicExternalAccountData
}
ExternalAccountConnection
Description
A list of external accounts.
Fields
Field Name | Description |
---|---|
nodes - [ExternalAccount!]! | A list of external accounts. |
totalCount - Int! | The total count of external accounts in the connection. This total count may be larger than the number of nodes in this object when the result is paginated. |
pageInfo - PageInfo! | Pagination information. |
Example
{
"nodes": [ExternalAccount],
"totalCount": 123,
"pageInfo": PageInfo
}
ExternalLink
Description
A URL to a resource on an external service, such as the URL to a repository on its external (origin) code host.
Fields
Field Name | Description |
---|---|
url - String! | The URL to the resource. |
serviceKind - ExternalServiceKind | The kind of external service, such as "GITHUB", or null if unknown/unrecognized. This is used solely for displaying an icon that represents the service. |
serviceType - String | The type of external service, such as "github", or null if unknown/unrecognized. This is used solely for displaying an icon that represents the service. use name serviceKind instead |
Example
{
"url": "abc123",
"serviceKind": "AWSCODECOMMIT",
"serviceType": "abc123"
}
ExternalRepository
Description
A repository on an external service (such as GitHub, GitLab, Phabricator, etc.).
Fields
Field Name | Description |
---|---|
id - String! | The repository's ID on the external service. Example: For GitHub, this is the GitHub GraphQL API's node ID for the repository. |
serviceType - String! | The type of external service where this repository resides. Example: "github", "gitlab", etc. |
serviceID - String! | The particular instance of the external service where this repository resides. Its value is opaque but typically consists of the canonical base URL to the service. Example: For GitHub.com, this is "https://github.com/". |
Example
{
"id": "abc123",
"serviceType": "abc123",
"serviceID": "abc123"
}
ExternalService
Description
A configured external service.
Fields
Field Name | Description |
---|---|
id - ID! | The external service's unique ID. |
kind - ExternalServiceKind! | The kind of external service. |
displayName - String! | The display name of the external service. |
config - JSONCString! | The JSON configuration of the external service. |
createdAt - DateTime! | When the external service was created. |
updatedAt - DateTime! | When the external service was last updated. |
repoCount - Int! | The number of repos synced by the external service. |
webhookURL - String | An optional URL that will be populated when webhooks have been configured for the external service. |
warning - String | This is an optional field that's populated when we ran into errors on the backend side when trying to create/update an ExternalService, but the create/update still succeeded. It is a field on ExternalService instead of a separate thing in order to not break the API and stay backwards compatible. |
lastSyncError - String | External services are synced with code hosts in the background. This optional field will contain any errors that occurred during the most recent completed sync. |
lastSyncAt - DateTime | LastSyncAt is the time the last sync job was run for this code host. Null if it has never been synced so far. |
nextSyncAt - DateTime | The timestamp of the next sync job. Null if not scheduled for a re-sync. |
webhookLogs - WebhookLogConnection! | Returns recently received webhooks on this external service. Only site admins may access this field. DEPRECATED: Webhook logs linked directly to an external service will be removed. See https://sourcegraph.com/docs/admin/config/webhooks/incoming#deprecation-notice Webhook logs linked directly to an external service will be removed. See https://sourcegraph.com/docs/admin/config/webhooks/incoming#deprecation-notice |
syncJobs - ExternalServiceSyncJobConnection! | The list of recent sync jobs for this external service. |
Arguments
| |
checkConnection - ExternalServiceAvailability! | Checks the availability of the external service. |
hasConnectionCheck - Boolean! | True if this external service can perform availability check by running checkConnection. If this is false, then checkConnection responds with ExternalServiceAvailabilityUnknown. |
supportsRepoExclusion - Boolean! | True if this external service configuration supports exclude parameter. |
Example
{
"id": "4",
"kind": "AWSCODECOMMIT",
"displayName": "abc123",
"config": JSONCString,
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z",
"repoCount": 987,
"webhookURL": "abc123",
"warning": "xyz789",
"lastSyncError": "abc123",
"lastSyncAt": "2007-12-03T10:15:30Z",
"nextSyncAt": "2007-12-03T10:15:30Z",
"webhookLogs": WebhookLogConnection,
"syncJobs": ExternalServiceSyncJobConnection,
"checkConnection": ExternalServiceAvailable,
"hasConnectionCheck": true,
"supportsRepoExclusion": false
}
ExternalServiceAvailability
Description
Availability status of an external service for diagnostic purposes.
This is so that the UI can surface whether the external service can serve requests, and if not, why is the reason for that.
Example
ExternalServiceAvailable
ExternalServiceAvailabilityUnknown
Description
Availability for some external services may not be determined, or only partially supported. In that case unknown variant of ExternalServiceAvailability is returned.
Fields
Field Name | Description |
---|---|
implementationNote - String! | User-friendly textual description of the implementation status of availability. This is expected to be tied to specific kinds of external services. |
Example
{"implementationNote": "xyz789"}
ExternalServiceAvailable
Description
Indicator that the external service was recently found to be available.
Fields
Field Name | Description |
---|---|
lastCheckedAt - DateTime! | The timestamp of the last successful availability check that was performed. |
Example
{"lastCheckedAt": "2007-12-03T10:15:30Z"}
ExternalServiceConnection
Description
A list of external services.
Fields
Field Name | Description |
---|---|
nodes - [ExternalService!]! | A list of external services. |
totalCount - Int! | The total number of external services in the connection. |
pageInfo - PageInfo! | Pagination information. |
Example
{
"nodes": [ExternalService],
"totalCount": 987,
"pageInfo": PageInfo
}
ExternalServiceKind
Description
A specific kind of external service.
Values
Enum Value | Description |
---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Example
"AWSCODECOMMIT"
ExternalServiceNamespace
Description
A namespace sourced from a defined external service (such as GitHub, GitLab, Phabricator, etc.) that can be discovered before any sync or mirror operations.
Fields
Field Name | Description |
---|---|
id - ID! | The unique identifier of the external service namespace. |
name - String! | The name of the external service namespace. |
externalID - String! | The Namespace's ID on the external service. Example: For GitHub, this is the GitHub GraphQL API's node ID for the organization. |
Example
{
"id": 4,
"name": "abc123",
"externalID": "xyz789"
}
ExternalServiceNamespaceConnection
Description
A list of namespaces available to an external service configuration.
Fields
Field Name | Description |
---|---|
nodes - [ExternalServiceNamespace!]! | A list of namespaces available on the source. Namespaces are used to organize which members and users can access repositories and are defined by external service kind (e.g. Github organizations, Bitbucket projects, etc.) |
totalCount - Int! | The total number of source repos in the connection. |
Example
{"nodes": [ExternalServiceNamespace], "totalCount": 123}
ExternalServiceSyncError
Description
FOR INTERNAL USE ONLY: A status message produced when repositories could not be synced from an external service
Fields
Field Name | Description |
---|---|
message - String! | The message of this status message |
externalService - ExternalService! | The external service that failed to sync |
Example
{
"message": "xyz789",
"externalService": ExternalService
}
ExternalServiceSyncJob
Description
An external service sync job represents one sync with the code host. It's a background job that will eventually be run by the repo syncer.
Fields
Field Name | Description |
---|---|
id - ID! | The unique identifier of the sync job. |
state - ExternalServiceSyncJobState! | The current state of the sync job. |
queuedAt - DateTime! | When the sync job was added to the queue. |
startedAt - DateTime | Set when sync begins. |
finishedAt - DateTime | Set when sync finished. |
failureMessage - String | Error message, if the sync failed. |
reposSynced - Int! | The number of repos synced during this sync job. |
repoSyncErrors - Int! | The number of times an error occurred syncing a repo during this sync job. |
reposAdded - Int! | The number of new repos discovered during this sync job. |
reposDeleted - Int! | The number of repos deleted as a result of this sync job. |
reposModified - Int! | The number of existing repos whose metadata has changed during this sync job. |
reposUnmodified - Int! | The number of existing repos whose metadata did not change during this sync job. |
Example
{
"id": 4,
"state": "QUEUED",
"queuedAt": "2007-12-03T10:15:30Z",
"startedAt": "2007-12-03T10:15:30Z",
"finishedAt": "2007-12-03T10:15:30Z",
"failureMessage": "abc123",
"reposSynced": 987,
"repoSyncErrors": 987,
"reposAdded": 123,
"reposDeleted": 123,
"reposModified": 987,
"reposUnmodified": 123
}
ExternalServiceSyncJobConnection
Description
A list of external service sync jobs.
Fields
Field Name | Description |
---|---|
nodes - [ExternalServiceSyncJob!]! | A list of sync jobs. |
totalCount - Int! | The total number of jobs in the connection. |
pageInfo - PageInfo! | Pagination information. |
Example
{
"nodes": [ExternalServiceSyncJob],
"totalCount": 987,
"pageInfo": PageInfo
}
ExternalServiceSyncJobState
Description
The possible states of an external service sync job.
Values
Enum Value | Description |
---|---|
| Not yet started. Will be picked up by a worker eventually. |
| Currently syncing. |
| An error occurred while syncing. Will be retried eventually. |
| A fatal error occurred while syncing. No retries will be made. |
| Sync finished successfully. |
| Sync job is being canceled. |
| Sync job has been canceled. |
Example
"QUEUED"
FeatureFlag
Description
A feature flag is either a static boolean feature flag or a rollout feature flag
Types
Union Types |
---|
Example
FeatureFlagBoolean
FeatureFlagBoolean
Description
A feature flag that has a statically configured value
Fields
Field Name | Description |
---|---|
name - String! | The name of the feature flag |
value - Boolean! | The static value of the feature flag |
overrides - [FeatureFlagOverride!]! | Overrides that apply to the feature flag |
Example
{
"name": "abc123",
"value": false,
"overrides": [FeatureFlagOverride]
}
FeatureFlagOverride
Description
A feature flag override is an override of a feature flag's value for a specific org or user
Fields
Field Name | Description |
---|---|
id - ID! | A unique ID for this feature flag override |
namespace - Namespace! | The namespace for this override. Will always be a user or org. |
targetFlag - FeatureFlag! | The name of the feature flag being overridden |
value - Boolean! | The overridden value of the feature flag |
Example
{
"id": "4",
"namespace": Namespace,
"targetFlag": FeatureFlagBoolean,
"value": true
}
FeatureFlagRollout
Description
A feature flag that is randomly evaluated to a boolean based on the rollout parameter
Fields
Field Name | Description |
---|---|
name - String! | The name of the feature flag |
rolloutBasisPoints - Int! | The ratio of users that will be assigned this this feature flag, expressed in basis points (0.01%). |
overrides - [FeatureFlagOverride!]! | Overrides that apply to the feature flag |
Example
{
"name": "abc123",
"rolloutBasisPoints": 123,
"overrides": [FeatureFlagOverride]
}
File
Description
File is temporarily preserved for backcompat with browser extension search API client code.
Fields
Field Name | Description |
---|---|
path - String! | The full path (relative to the repository root) of this file. |
name - String! | The base name (i.e., file name only) of this file's path. |
isDirectory - Boolean! | Whether this is a directory. |
url - String! | The URL to this file on Sourcegraph. |
repository - Repository! | The repository that contains this file. |
Example
{
"path": "xyz789",
"name": "abc123",
"isDirectory": false,
"url": "abc123",
"repository": Repository
}
File2
Description
A file. In a future version of Sourcegraph, a repository's files may be distinct from a repository's blobs (for example, to support searching/browsing generated files that aren't committed and don't exist as Git blobs). Clients should generally use the GitBlob concrete type and GitCommit.blobs (not GitCommit.files), unless they explicitly want to opt-in to different behavior in the future. INTERNAL: This is temporarily named File2 during a migration. Do not refer to the name File2 in any API clients as the name will change soon.
Fields
Field Name | Description |
---|---|
path - String! | The full path (relative to the root) of this file. |
name - String! | The base name (i.e., file name only) of this file. |
isDirectory - Boolean! | False because this is a file, not a directory. |
content - String! | The content of this file. |
byteSize - Int! | The file size in bytes. |
totalLines - Int! | Total line count for the file. Returns 0 for binary files. |
binary - Boolean! | Whether or not it is binary. |
richHTML - String! | The file rendered as rich HTML, or an empty string if it is not a supported rich file type. This HTML string is already escaped and thus is always safe to render. |
url - String! | The URL to this file (using the input revision specifier, which may not be immutable). |
canonicalURL - String! | The canonical URL to this file (using an immutable revision specifier). |
externalURLs - [ExternalLink!]! | The URLs to this file on external services. |
highlight - HighlightedFile! | Highlight the file. |
Arguments
|
Possible Types
File2 Types |
---|
Example
{
"path": "abc123",
"name": "abc123",
"isDirectory": false,
"content": "xyz789",
"byteSize": 987,
"totalLines": 987,
"binary": true,
"richHTML": "xyz789",
"url": "xyz789",
"canonicalURL": "xyz789",
"externalURLs": [ExternalLink],
"highlight": HighlightedFile
}
FileDiff
Description
A diff for a single file.
Fields
Field Name | Description |
---|---|
oldPath - String | The old (original) path of the file, or null if the file was added. |
oldFile - File2 | The old file, or null if the file was created (oldFile.path == oldPath). |
newPath - String | The new (changed) path of the file, or null if the file was deleted. |
newFile - File2 | The new file, or null if the file was deleted (newFile.path == newPath). |
mostRelevantFile - File2! | The old file (if the file was deleted) and otherwise the new file. This file field is typically used by clients that want to show a "View" link to the file. |
hunks - [FileDiffHunk!]! | Hunks that were changed from old to new. |
stat - DiffStat! | The diff stat for the whole file. |
internalID - String! | FOR INTERNAL USE ONLY. An identifier for the file diff that is unique among all other file diffs in the list that contains it. |
Example
{
"oldPath": "xyz789",
"oldFile": File2,
"newPath": "xyz789",
"newFile": File2,
"mostRelevantFile": File2,
"hunks": [FileDiffHunk],
"stat": DiffStat,
"internalID": "abc123"
}
FileDiffConnection
Description
A list of file diffs.
Fields
Field Name | Description |
---|---|
nodes - [FileDiff!]! | A list of file diffs. |
totalCount - Int | The total count of file diffs in the connection, if available. This total count may be larger than the number of nodes in this object when the result is paginated. |
pageInfo - PageInfo! | Pagination information. |
diffStat - DiffStat! | The diff stat for the file diffs in this object, which may be a subset of the entire diff if the result is paginated. |
rawDiff - String! | The raw diff for the file diffs in this object, which may be a subset of the entire diff if the result is paginated. |
Example
{
"nodes": [FileDiff],
"totalCount": 987,
"pageInfo": PageInfo,
"diffStat": DiffStat,
"rawDiff": "abc123"
}
FileDiffHunk
Description
A changed region ("hunk") in a file diff.
Fields
Field Name | Description |
---|---|
oldRange - FileDiffHunkRange! | The range of the old file that the hunk applies to. |
oldNoNewlineAt - Boolean! | Whether the old file had a trailing newline. |
newRange - FileDiffHunkRange! | The range of the new file that the hunk applies to. |
section - String | The diff hunk section heading, if any. |
body - String! | The hunk body, with lines prefixed with '-', '+', or ' '. |
highlight - HighlightedDiffHunkBody! | Highlight the hunk. |
Arguments
|
Example
{
"oldRange": FileDiffHunkRange,
"oldNoNewlineAt": true,
"newRange": FileDiffHunkRange,
"section": "abc123",
"body": "abc123",
"highlight": HighlightedDiffHunkBody
}
FileDiffHunkRange
FileMatch
Description
A file match.
Fields
Field Name | Description |
---|---|
file - GitBlob! | The file containing the match. KNOWN ISSUE: This file's "commit" field contains incomplete data. KNOWN ISSUE: This field's type should be File! not GitBlob!. |
repository - Repository! | The repository containing the file match. |
revSpec - GitRevSpec | The revspec of the revision that contains this match. If no revspec was given (such as when no repository filter or revspec is specified in the search query), it is null. |
symbols - [Symbol!]! | The symbols found in this file that match the query. |
lineMatches - [LineMatch!]! | The line matches. |
chunkMatches - [ChunkMatch!]! | EXPERIMENTAL: This field is experimental and may be unstable. The chunk matches. |
limitHit - Boolean! | Whether or not the limit was hit. |
Example
{
"file": GitBlob,
"repository": Repository,
"revSpec": GitRef,
"symbols": [Symbol],
"lineMatches": [LineMatch],
"chunkMatches": [ChunkMatch],
"limitHit": true
}
Float
Description
The Float
scalar type represents signed double-precision fractional values as specified by IEEE 754.
Example
987.65
GenericSearchResultInterface
Description
A search result. Every type of search result, except FileMatch, must implement this interface.
Fields
Field Name | Description |
---|---|
label - Markdown! | A markdown string that is rendered prominently. |
url - String! | The URL of the result. |
detail - Markdown! | A markdown string that is rendered less prominently. |
matches - [SearchResultMatch!]! | A list of matches in this search result. |
Possible Types
GenericSearchResultInterface Types |
---|