-
Notifications
You must be signed in to change notification settings - Fork 143
/
schema.graphql
executable file
·3301 lines (3076 loc) · 124 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#! Run this before committing changes to this file
#! go generate github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend
#! This will happen automatically if you are running ./dev/launch.sh
#!
#! Lines that begin with #! are treated as internal comments. They are stripped
#! from the schema before the documentation for each field is generated.
#!
#! See docs/api.md for guidance on schema evolution.
#!
schema {
query: Query
mutation: Mutation
}
# Represents a null return value.
type EmptyResponse {
# A dummy null value.
alwaysNil: String
}
# An object with an ID.
interface Node {
# The ID of the node.
id: ID!
}
# A valid JSON value.
scalar JSONValue
# A mutation.
type Mutation {
# Updates the user profile information for the user with the given ID.
#
# Only the user and site admins may perform this mutation.
updateUser(user: ID!, username: String, displayName: String, avatarURL: String): EmptyResponse!
# Creates an organization. The caller is added as a member of the newly created organization.
#
# Only authenticated users may perform this mutation.
createOrganization(name: String!, displayName: String): Org!
# Updates an organization.
#
# Only site admins and any member of the organization may perform this mutation.
updateOrganization(id: ID!, displayName: String): Org!
# Deletes an organization. Only site admins may perform this mutation.
deleteOrganization(organization: ID!): EmptyResponse
# Adds a repository on a code host that is already present in the site configuration. The name (which may
# consist of one or more path components) of the repository must be recognized by an already configured code
# host, or else Sourcegraph won't know how to clone it.
#
# The newly added repository is not enabled (unless the code host's configuration specifies that it should be
# enabled). The caller must explicitly enable it with setRepositoryEnabled.
#
# If the repository already exists, it is returned.
#
# To add arbitrary repositories (that don't need to reside on an already configured code host), use the site
# configuration "repos.list" property.
#
# As a special case, GitHub.com public repositories may be added by using a name of the form
# "github.com/owner/repo". If there is no GitHub personal access token for github.com configured, the site may
# experience problems with github.com repositories due to the low default github.com API rate limit (60
# requests per hour).
#
# Only site admins may perform this mutation.
addRepository(name: String!): Repository!
# Enables or disables a repository. A disabled repository is only
# accessible to site admins and never appears in search results.
#
# Only site admins may perform this mutation.
setRepositoryEnabled(repository: ID!, enabled: Boolean!): EmptyResponse
# Enables or disables all site repositories.
#
# Only site admins may perform this mutation.
setAllRepositoriesEnabled(enabled: Boolean!): EmptyResponse
# 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.
checkMirrorRepositoryConnection(
# The ID of the existing repository whose mirror to check.
repository: ID
# 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).
name: String
): CheckMirrorRepositoryConnectionResult!
# 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.
updateMirrorRepository(
# The mirror repository to update.
repository: ID!
): EmptyResponse!
# Schedules all repositories to be updated from their original source repositories. Updating
# occurs automatically, so this should not normally be needed.
#
# Only site admins may perform this mutation.
updateAllMirrorRepositories: EmptyResponse!
# Deletes a repository and all data associated with it, irreversibly.
#
# If the repository was added because it was present in the site configuration (directly,
# or because it originated from a configured code host), then it will be re-added during
# the next sync. If you intend to make the repository inaccessible to users and not searchable,
# use setRepositoryEnabled to disable the repository instead of deleteRepository.
#
# Only site admins may perform this mutation.
deleteRepository(repository: ID!): EmptyResponse
# Creates a new user account.
#
# Only site admins may perform this mutation.
createUser(
# The new user's username.
username: String!
# The new user's optional email address. If given, it is marked as verified.
email: String
): CreateUserResult!
# 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.
randomizeUserPassword(user: ID!): RandomizeUserPasswordResult!
# 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.
addUserEmail(user: ID!, email: String!): EmptyResponse!
# Removes an email address from the user's account.
#
# Only the user and site admins may perform this mutation.
removeUserEmail(user: ID!, email: String!): EmptyResponse!
# 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.
setUserEmailVerified(user: ID!, email: String!, verified: Boolean!): EmptyResponse!
# Deletes a user account. Only site admins may perform this mutation.
deleteUser(user: ID!): EmptyResponse
# Updates the current user's password. The oldPassword arg must match the user's current password.
updatePassword(oldPassword: String!, newPassword: String!): EmptyResponse
# 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.
createAccessToken(user: ID!, scopes: [String!]!, note: String!): CreateAccessTokenResult!
# 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.
deleteAccessToken(byID: ID, byToken: String): EmptyResponse!
# 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.
deleteExternalAccount(externalAccount: ID!): EmptyResponse!
# 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.
inviteUserToOrganization(organization: ID!, username: String!): InviteUserToOrganizationResult!
# Accept or reject an existing organization invitation.
#
# Only the recipient of the invitation may perform this mutation.
respondToOrganizationInvitation(
# The organization invitation.
organizationInvitation: ID!
# The response to the invitation.
responseType: OrganizationInvitationResponseType!
): EmptyResponse!
# Resend the notification about an organization invitation to the recipient.
#
# Only site admins and any member of the organization may perform this mutation.
resendOrganizationInvitationNotification(
# The organization invitation.
organizationInvitation: ID!
): EmptyResponse!
# 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.
revokeOrganizationInvitation(
# The organization invitation.
organizationInvitation: ID!
): EmptyResponse!
# 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.
addUserToOrganization(organization: ID!, username: String!): EmptyResponse!
# Removes a user as a member from an organization.
#
# Only site admins and any member of the organization may perform this mutation.
removeUserFromOrganization(user: ID!, organization: ID!): EmptyResponse
# 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.
setTag(
# 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.)
node: ID!
# The tag to set.
tag: String!
# The desired state of the tag on the user (whether to add or remove): true to add, false to
# remove.
present: Boolean!
): EmptyResponse!
# Adds a Phabricator repository to Sourcegraph.
addPhabricatorRepo(
# The callsign, for example "MUX".
callsign: String!
# The name, for example "github.com/gorilla/mux".
name: String
# An alias for name. DEPRECATED: use name instead.
uri: String
# The URL to the phabricator instance (e.g. http://phabricator.sgdev.org).
url: String!
): EmptyResponse
# Resolves a revision for a given diff from Phabricator.
resolvePhabricatorDiff(
# The name of the repository that the diff is based on.
repoName: String!
# The ID of the diff on Phabricator.
diffID: ID!
# The base revision this diff is based on.
baseRev: String!
# The raw contents of the diff from Phabricator.
# Required if Sourcegraph doesn't have a Conduit API token.
patch: String
# The description of the diff. This will be used as the commit message.
description: String
# The name of author of the diff.
authorName: String
# The author's email.
authorEmail: String
# When the diff was created.
date: String
): GitCommit
# Logs a user event.
logUserEvent(event: UserEvent!, userCookieID: String!): EmptyResponse
# Sends a test notification for the saved search. Be careful: this will send a notifcation (email and other
# types of notifications, if configured) to all subscribers of the saved search, which could be bothersome.
#
# Only subscribers to this saved search may perform this action.
sendSavedSearchTestNotification(
# ID of the saved search.
id: ID!
): EmptyResponse
# All mutations that update configuration settings are under this field.
configurationMutation(input: ConfigurationMutationGroupInput!): ConfigurationMutation
# Updates the site configuration. Returns whether or not a restart is
# needed for the update to be applied.
updateSiteConfiguration(input: String!): Boolean!
# Manages language servers.
langServers: LangServersMutation
# Manages discussions.
discussions: DiscussionsMutation
# Sets whether the user with the specified user ID is a site admin.
#!
#! 🚨 SECURITY: Only trusted users should be given site admin permissions.
#! Site admins have full access to the site configuration and other
#! sensitive data, and they can perform destructive actions such as
#! restarting the site.
setUserIsSiteAdmin(userID: ID!, siteAdmin: Boolean!): EmptyResponse
# Reloads the site by restarting the server. This is not supported for all deployment
# types. This may cause downtime.
reloadSite: EmptyResponse
# Submits a user satisfaction (NPS) survey.
submitSurvey(input: SurveySubmissionInput!): EmptyResponse
# Manages the extension registry.
extensionRegistry: ExtensionRegistryMutation!
# Mutations that are only used on Sourcegraph.com.
#
# FOR INTERNAL USE ONLY.
dotcom: DotcomMutation!
}
# Mutations for language servers.
type LangServersMutation {
# Enables the language server for the given language.
#
# Any user can perform this mutation, unless the language has been
# explicitly disabled.
enable(language: String!): EmptyResponse
# Disables the language server for the given language.
#
# Only admins can perform this action. After disabling, it is impossible
# for plain users to enable the language server for this language (until an
# admin re-enables it).
disable(language: String!): EmptyResponse
# Restarts the language server for the given language.
#
# Only admins can perform this action.
restart(language: String!): EmptyResponse
# Updates the language server for the given language.
#
# Only admins can perform this action.
update(language: String!): EmptyResponse
}
# A selection within a file.
input DiscussionThreadTargetRepoSelectionInput {
# The line that the selection started on (zero-based, inclusive).
startLine: Int!
# The character (not byte) of the start line that the selection began on (zero-based, inclusive).
startCharacter: Int!
# The line that the selection ends on (zero-based, exclusive).
endLine: Int!
# The character (not byte) of the end line that the selection ended on (zero-based, exclusive).
endCharacter: Int!
# The literal textual (UTF-8) lines before the line the selection started
# on.
#
# This is an arbitrary number of lines, and may be zero lines, but typically 3.
#
# If null, this information will be gathered from the repository itself
# automatically. This will result in an error if the selection is invalid or
# the DiscussionThreadTargetRepoInput specified an invalid path or
# branch/revision.
linesBefore: [String!]
# The literal textual (UTF-8) lines of the selection. i.e. all lines
# startLine through endLine.
#
# If null, this information will be gathered from the repository itself
# automatically. This will result in an error if the selection is invalid or
# the DiscussionThreadTargetRepoInput specified an invalid path or
# branch/revision.
lines: [String!]
# The literal textual (UTF-8) lines after the line the selection ended on.
#
# This is an arbitrary number of lines, and may be zero lines, but typically 3.
#
# If null, this information will be gathered from the repository itself
# automatically. This will result in an error if the selection is invalid or
# the DiscussionThreadTargetRepoInput specified an invalid path or
# branch/revision.
linesAfter: [String!]
}
# A discussion thread that is centered around:
#
# - A repository.
# - A directory inside a repository.
# - A file inside a repository.
# - A selection inside a file inside a repository.
#
input DiscussionThreadTargetRepoInput {
# The repository in which the thread was created.
#
# One of 'repositoryID', 'repositoryGitCloneURL', or 'repositoryName' must be specified.
repositoryID: ID
# The repository in which the thread was created.
#
# One of 'repositoryID', 'repositoryGitCloneURL', or 'repositoryName' must be specified.
repositoryName: String
# The repository in which the thread was created.
#
# One of 'repositoryID', 'repositoryGitCloneURL', or 'repositoryName' must be specified.
repositoryGitCloneURL: String
# The path (relative to the repository root) of the file or directory that
# the thread is referencing, if any. If the path is null, the thread is not
# talking about a specific path but rather just the repository generally.
path: String
# The branch or other human-readable Git ref (e.g. "HEAD~2", but not exact
# Git revision), that the thread was referencing, if any.
branch: String
# The exact Git object ID (OID / 40-character SHA-1 hash) which the thread
# was referencing, if any.
revision: GitObjectID
# The selection that the thread was referencing, if any.
selection: DiscussionThreadTargetRepoSelectionInput
}
# Describes the creation of a new thread around some target (e.g. a file in a repo).
input DiscussionThreadCreateInput {
# The title of the thread's first comment (i.e. the threads title).
title: String!
# The contents of the thread's first comment (i.e. the threads comment).
contents: String!
# The target repo of this discussion thread. This is nullable so that in
# the future more target types may be added.
targetRepo: DiscussionThreadTargetRepoInput
}
# Describes an update mutation to an existing thread.
input DiscussionThreadUpdateInput {
# The ID of the thread to update.
ThreadID: ID!
# When non-null, indicates that the thread should be archived.
Archive: Boolean
# When non-null, indicates that the thread should be deleted. Only admins
# can perform this action.
Delete: Boolean
}
# Describes an update mutation to an existing comment in a thread.
input DiscussionCommentUpdateInput {
# The ID of the comment to update.
commentID: ID!
# When non-null, indicates that the thread should be deleted. Only admins
# can perform this action.
delete: Boolean
# When non-null, reports the comment with the specified reason.
#
# An error will be returned if the comment's canReport field is false.
report: String
# When non-null, indicates that the reports on the thread should be
# cleared. Only admins can perform this action.
#
# An error will be returned if the comment's canClearReports field is false.
clearReports: Boolean
}
# Mutations for discussions.
type DiscussionsMutation {
# Creates a new thread. Returns the new thread.
createThread(input: DiscussionThreadCreateInput!): DiscussionThread!
# Updates an existing thread. Returns the updated thread.
#
# Returns null if the thread was deleted.
updateThread(input: DiscussionThreadUpdateInput!): DiscussionThread
# Adds a new comment to a thread. Returns the updated thread.
addCommentToThread(threadID: ID!, contents: String!): DiscussionThread!
# Updates an existing comment. Returns the updated thread.
updateComment(input: DiscussionCommentUpdateInput!): DiscussionThread!
}
# Describes options for rendering Markdown.
input MarkdownOptions {
# TODO(slimsag:discussions): add option for controlling relative links
# A dummy null value (empty input types are not allowed yet).
alwaysNil: String
}
# Input for Mutation.configuration, which contains fields that all configuration
# mutations need.
input ConfigurationMutationGroupInput {
# The subject whose configuration to mutate (organization, user, etc.).
subject: ID!
# The ID of the last-known configuration known to the client, or null if
# there is none. This field is used to prevent race conditions when there
# are concurrent editors.
lastID: Int
}
# Mutations that update configuration settings. These mutations are grouped
# together because they:
#
# - are all versioned to avoid race conditions with concurrent editors
# - all apply to a specific configuration subject
#
# Grouping them lets us extract those common parameters to the
# Mutation.configuration field.
type ConfigurationMutation {
# Edit a single property in the configuration object.
editConfiguration(
# The configuration edit to apply.
edit: ConfigurationEdit!
): UpdateConfigurationPayload
# Overwrite the contents to the new contents provided.
overwriteConfiguration(contents: String): UpdateConfigurationPayload
# Create a saved query.
createSavedQuery(
description: String!
query: String!
showOnHomepage: Boolean = false
notify: Boolean = false
notifySlack: Boolean = false
disableSubscriptionNotifications: Boolean = false
): SavedQuery!
# Update the saved query with the given ID in the configuration.
updateSavedQuery(
id: ID!
description: String
query: String
showOnHomepage: Boolean = false
notify: Boolean = false
notifySlack: Boolean = false
): SavedQuery!
# Delete the saved query with the given ID in the configuration.
deleteSavedQuery(id: ID!, disableSubscriptionNotifications: Boolean = false): EmptyResponse
}
# An edit to a (nested) configuration property's value.
input ConfigurationEdit {
# The key path of the property to update.
#
# Inserting into an existing array is not yet supported.
keyPath: [KeyPathSegment!]!
# The new JSON-encoded value to insert. If the field's value is not set, the property is removed. (This is
# different from the field's value being the JSON null value.)
#
# When the value is a non-primitive type, it must be specified using a GraphQL variable, not an inline literal,
# or else the GraphQL parser will return an error.
value: JSONValue
# Whether to treat the value as a JSONC-encoded string, which makes it possible to perform a configuration edit
# that preserves (or adds/removes) comments.
valueIsJSONCEncodedString: Boolean = false
}
# A segment of a key path that locates a nested JSON value in a root JSON value. Exactly one field in each
# KeyPathSegment must be non-null.
#
# For example, in {"a": [0, {"b": 3}]}, the value 3 is located at the key path ["a", 1, "b"].
input KeyPathSegment {
# The name of the property in the object at this location to descend into.
property: String
# The index of the array at this location to descend into.
index: Int
}
# The payload for ConfigurationMutation.updateConfiguration.
type UpdateConfigurationPayload {
# An empty response.
empty: EmptyResponse
}
# The result for Mutation.createAccessToken.
type CreateAccessTokenResult {
# The ID of the newly created access token.
id: ID!
# The secret token value that is used to authenticate API clients. The caller is responsible for storing this
# value.
token: String!
}
# The result for Mutation.checkMirrorRepositoryConnection.
type CheckMirrorRepositoryConnectionResult {
# The error message encountered during the update operation, if any. If null, then
# the connection check succeeded.
error: String
}
# The result for Mutation.createUser.
type CreateUserResult {
# The new user.
user: User!
# 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.
resetPasswordURL: String
}
# The result for Mutation.randomizeUserPassword.
type RandomizeUserPasswordResult {
# The reset password URL that the user must visit to sign into their account again. If the builtin
# username-password authentication provider is not enabled, this field's value is null.
resetPasswordURL: String
}
# Input for a user satisfaction (NPS) survey submission.
input SurveySubmissionInput {
# User-provided email address, if there is no currently authenticated user. If there is, this value
# will not be used.
email: String
# User's likelihood of recommending Sourcegraph to a friend, from 0-10.
score: Int!
# The answer to "What is the most important reason for the score you gave".
reason: String
# The answer to "What can Sourcegraph do to provide a better product"
better: String
}
# A query.
type Query {
# The root of the query.
root: Query! @deprecated(reason: "this will be removed.")
# Looks up a node by ID.
node(id: ID!): Node
# Looks up a repository by name.
repository(
# The name, for example "github.com/gorilla/mux".
name: String
# An alias for name. DEPRECATED: use name instead.
uri: String
): Repository
# List all repositories.
repositories(
# Returns the first n repositories from the list.
first: Int
# Return repositories whose names match the query.
query: String
# Include enabled repositories.
enabled: Boolean = true
# Include disabled repositories.
disabled: Boolean = false
# Include cloned repositories.
cloned: Boolean = true
# Include repositories that are currently being cloned.
cloneInProgress: Boolean = true
# Include repositories that are not yet cloned and for which cloning is not in progress.
notCloned: Boolean = true
# Include repositories that have a text search index.
indexed: Boolean = true
# Include repositories that do not have a text search index.
notIndexed: Boolean = true
# Filter for repositories that have been indexed for cross-repository code intelligence.
ciIndexed: Boolean = false
# Filter for repositories that have not been indexed for cross-repository code intelligence.
notCIIndexed: Boolean = false
# Sort field.
orderBy: RepoOrderBy = REPO_URI
# Sort direction.
descending: Boolean = false
): RepositoryConnection!
# Looks up a Phabricator repository by name.
phabricatorRepo(
# The name, for example "github.com/gorilla/mux".
name: String
# An alias for name. DEPRECATED: use name instead.
uri: String
): PhabricatorRepo
# The current user.
currentUser: User
# Looks up a user by username.
user(username: String!): User
# List all users.
users(
# Returns the first n users from the list.
first: Int
# Return users whose usernames or display names match the query.
query: String
# Return only users with the given tag.
tag: String
# Returns users who have been active in a given period of time.
activePeriod: UserActivePeriod
): UserConnection!
# Looks up an organization by name.
organization(name: String!): Org
# List all organizations.
organizations(
# Returns the first n organizations from the list.
first: Int
# Return organizations whose names or display names match the query.
query: String
): OrgConnection!
# Lists discussion threads.
discussionThreads(
# Returns the first n threads from the list.
first: Int
# Return discussion threads matching the query.
query: String
# When present, lists only the thread with this ID.
threadID: ID
# When present, lists only the threads created by this author.
authorUserID: ID
# When present, lists only the threads whose target is a repository with this ID.
#
# Only one of 'targetRepositoryID', 'targetRepositoryName', or 'targetRepositoryGitCloneURL' may be specified.
targetRepositoryID: ID
# When present, lists only the threads whose target is a repository with this name.
#
# Only one of 'targetRepositoryID', 'targetRepositoryName', or 'targetRepositoryGitCloneURL' may be specified.
targetRepositoryName: String
# When present, lists only the threads whose target is a repository with this Git clone URL.
#
# Only one of 'targetRepositoryID', 'targetRepositoryName', or 'targetRepositoryGitCloneURL' may be specified.
targetRepositoryGitCloneURL: String
# When present, lists only the threads whose target is a repository with this file path.
#
# If the path ends with "/**", any path below that is matched.
targetRepositoryPath: String
): DiscussionThreadConnection!
# Lists discussion comments.
discussionComments(
# Returns the first n comments from the list.
first: Int
# When present, lists only the comments created by this author.
authorUserID: ID
): DiscussionCommentConnection!
# Renders Markdown to HTML. The returned HTML is already sanitized and
# escaped and thus is always safe to render.
renderMarkdown(markdown: String!, options: MarkdownOptions): String!
# Looks up an instance of a type that implements ConfigurationSubject.
configurationSubject(id: ID!): ConfigurationSubject
# The configuration for the viewer.
viewerConfiguration: ConfigurationCascade!
# The configuration for clients.
clientConfiguration: ClientConfigurationDetails!
# Runs a search.
search(
# The search query (such as "foo" or "repo:myrepo foo").
query: String = ""
): Search
# The search scopes.
searchScopes: [SearchScope!]!
# All saved queries configured for the current user, merged from all configurations.
savedQueries: [SavedQuery!]!
# All repository groups for the current user, merged from all configurations.
repoGroups: [RepoGroup!]!
# The current site.
site: Site!
# Retrieve responses to surveys.
surveyResponses(
# Returns the first n survey responses from the list.
first: Int
): SurveyResponseConnection!
# The extension registry.
extensionRegistry: ExtensionRegistry!
}
# Configuration details for the browser extension, editor extensions, etc.
type ClientConfigurationDetails {
# The list of phabricator/gitlab/bitbucket/etc instance URLs that specifies which pages the content script will be injected into.
contentScriptUrls: [String!]!
# Returns details about the parent Sourcegraph instance.
parentSourcegraph: ParentSourcegraphDetails!
}
# Parent Sourcegraph instance
type ParentSourcegraphDetails {
# Sourcegraph instance URL.
url: String!
}
# A search.
type Search {
# The results.
results: SearchResults!
# The suggestions.
suggestions(first: Int): [SearchSuggestion!]!
# A subset of results (excluding actual search results) which are heavily
# cached and thus quicker to query. Useful for e.g. querying sparkline
# data.
stats: SearchResultsStats!
}
# A search result.
union SearchResult = FileMatch | CommitSearchResult | Repository
# Search results.
type SearchResults {
# The results. Inside each SearchResult there may be multiple matches, e.g.
# a FileMatch may contain multiple line matches.
results: [SearchResult!]!
# The total number of results, taking into account the SearchResult type.
# This is different than the length of the results array in that e.g. the
# results array may contain two file matches and this resultCount would
# report 6 ("3 line matches per file").
#
# Typically, 'approximateResultCount', not this field, is shown to users.
resultCount: Int!
# The approximate number of results. This is like the length of the results
# array, except it can indicate the number of results regardless of whether
# or not the limit was hit. Currently, this is represented as e.g. "5+"
# results.
#
# This string is typically shown to users to indicate the true result count.
approximateResultCount: String!
# Whether or not the results limit was hit.
limitHit: Boolean!
# Integers representing the sparkline for the search results.
sparkline: [Int!]!
# Repositories that were eligible to be searched.
repositories: [Repository!]!
# Repositories that were actually searched. Excludes repositories that would have been searched but were not
# because a timeout or error occurred while performing the search, or because the result limit was already
# reached.
repositoriesSearched: [Repository!]!
# Indexed repositories searched. This is a subset of repositoriesSearched.
indexedRepositoriesSearched: [Repository!]!
# Repositories that are busy cloning onto gitserver.
cloning: [Repository!]!
# Repositories or commits that do not exist.
missing: [Repository!]!
# Repositories or commits which we did not manage to search in time. Trying
# again usually will work.
timedout: [Repository!]!
# True if indexed search is enabled but was not available during this search.
indexUnavailable: Boolean!
# An alert message that should be displayed before any results.
alert: SearchAlert
# The time it took to generate these results.
elapsedMilliseconds: Int!
# Dynamic filters generated by the search results
dynamicFilters: [SearchFilter!]!
}
# Statistics about search results.
type SearchResultsStats {
# The approximate number of results returned.
approximateResultCount: String!
# The sparkline.
sparkline: [Int!]!
}
# A search filter.
type SearchFilter {
# The value.
value: String!
# The string to be displayed in the UI.
label: String!
# Number of matches for a given filter.
count: Int!
# Whether the results returned are incomplete.
limitHit: Boolean!
# The kind of filter. Should be "file" or "repo".
kind: String!
}
# A search suggestion.
union SearchSuggestion = Repository | File | Symbol
# A search scope.
type SearchScope {
# A unique identifier for the search scope.
# If set, a scoped search page is available at https://[sourcegraph-hostname]/search/scope/ID, where ID is this value.
id: String
# The name.
name: String!
# The value.
value: String!
# A description for this search scope, which will appear on the scoped search page.
description: String
}
# A search-related alert message.
type SearchAlert {
# The title.
title: String!
# The description.
description: String
# "Did you mean: ____" query proposals
proposedQueries: [SearchQueryDescription!]
}
# A saved search query, defined in configuration.
type SavedQuery {
# The unique ID of the saved query.
id: ID!
# The subject whose configuration this saved query was defined in.
subject: ConfigurationSubject!
# The unique key of this saved query (unique only among all other saved
# queries of the same subject).
key: String
# The 0-indexed index of this saved query in the subject's configuration.
index: Int!
# The description.
description: String!
# The query.
query: String!
# Whether or not to show on the homepage.
showOnHomepage: Boolean!
# Whether or not to notify.
notify: Boolean!
# Whether or not to notify on Slack.
notifySlack: Boolean!
}
# A search query description.
type SearchQueryDescription {
# The description.
description: String
# The query.
query: String!
}
# A group of repositories.
type RepoGroup {
# The name.
name: String!
# The repositories.
repositories: [String!]!
}
# A diff between two diffable Git objects.
type Diff {
# The diff's repository.
repository: Repository!
# The revision range of the diff.
range: GitRevisionRange!
}
# A search result that is a Git commit.
type CommitSearchResult {
# The commit that matched the search query.
commit: GitCommit!
# The ref names of the commit.
refs: [GitRef!]!
# The refs by which this commit was reached.
sourceRefs: [GitRef!]!
# The matching portion of the commit message, if any.
messagePreview: HighlightedString
# The matching portion of the diff, if any.
diffPreview: HighlightedString
}
# A search result that is a diff between two diffable Git objects.
type DiffSearchResult {
# The diff that matched the search query.
diff: Diff!
# The matching portion of the diff.
preview: HighlightedString!
}
# A string that has highlights (e.g, query matches).
type HighlightedString {
# The full contents of the string.
value: String!
# Highlighted matches of the query in the preview string.
highlights: [Highlight!]!
}
# A highlighted region in a string (e.g., matched by a query).
type Highlight {
# The 1-indexed line number.
line: Int!
# The 1-indexed character on the line.
character: Int!
# The length of the highlight, in characters (on the same line).
length: Int!
}
# Ref fields.
type RefFields {
# The ref location.
refLocation: RefLocation
# The URI.
uri: URI
}
# A URI.
type URI {
# The host.
host: String!
# The fragment.
fragment: String!
# The path.
path: String!
# The query.
query: String!
# The scheme.
scheme: String!
}
# A ref location.
type RefLocation {
# The starting line number.
startLineNumber: Int!
# The starting column.
startColumn: Int!
# The ending line number.
endLineNumber: Int!
# The ending column.
endColumn: Int!
}
# A list of repositories.
type RepositoryConnection {
# A list of repositories.
nodes: [Repository!]!
# The total count of repositories in the connection. This total count may be larger
# than the number of nodes in this object when the result is paginated.
#
# In some cases, the total count can't be computed quickly; if so, it is null. Pass
# precise: true to always compute total counts even if it takes a while.
totalCount(precise: Boolean = false): Int
# Pagination information.
pageInfo: PageInfo!
}
# A repository is a Git source control repository that is mirrored from some origin code host.
type Repository implements Node {
# The repository's unique ID.
id: ID!
# 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: