Repository navigation
Expand file tree
/
Copy pathgit.graphql
More file actions
220 lines (202 loc) · 7.72 KB
/
Copy pathgit.graphql
File metadata and controls
220 lines (202 loc) · 7.72 KB
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
"""A git branch or tag reference."""
type GitRef
@goModel(model: "github.com/git-bug/git-bug/api/graphql/models.GitRef") {
"""Full reference name, e.g. refs/heads/main or refs/tags/v1.0."""
name: String!
"""Short name, e.g. main or v1.0."""
shortName: String!
"""Whether this reference is a branch or a tag."""
type: GitRefType!
"""Commit hash the reference points to."""
hash: String!
"""Git commit the reference points to."""
commit: GitCommit!
}
"""An entry in a git tree (directory listing)."""
type GitTreeEntry
@goModel(model: "github.com/git-bug/git-bug/api/graphql/models.GitTreeEntry") {
"""File or directory name within the parent tree."""
name: String!
"""Whether this entry is a file, directory, symlink, or submodule."""
type: GitObjectType! @goField(name: "ObjectType")
"""Git object hash."""
hash: String!
"""The last git commit that touched this tree entry. Null when the entry
cannot be resolved within the history depth limit."""
lastCommit: GitCommit
}
"""The content of a git blob (file)."""
type GitBlob {
"""Path of the file relative to the repository root."""
path: String!
"""Git object hash. Can be used as a stable cache key or to construct a
raw download URL."""
hash: String!
"""UTF-8 text content of the file. Null when isBinary is true or when
the file is too large to be returned inline (see isTruncated)."""
text: String
"""Size in bytes."""
size: Int!
"""True when the file contains null bytes and is treated as binary.
text will be null."""
isBinary: Boolean!
"""True when the file exceeds the maximum inline size and text has been
omitted. Use the raw download endpoint to retrieve the full content."""
isTruncated: Boolean!
}
"""Metadata for a single git commit."""
type GitCommit
@goModel(model: "github.com/git-bug/git-bug/api/graphql/models.GitCommitMeta") {
"""Full SHA-1 commit hash."""
hash: String!
"""Abbreviated commit hash, typically 8 characters."""
shortHash: String!
"""First line of the commit message."""
message: String!
"""Full commit message."""
fullMessage: String!
"""Name of the commit author."""
authorName: String!
"""Email address of the commit author."""
authorEmail: String!
"""Timestamp from the author field (when the change was originally made)."""
date: Time!
"""Hashes of parent commits. Empty for the initial commit."""
parents: [String!]!
"""Files changed relative to the first parent (or the empty tree for the
initial commit)."""
files(
"""Returns the elements in the list that come after the specified cursor."""
after: String
"""Returns the elements in the list that come before the specified cursor."""
before: String
"""Returns the first _n_ elements from the list."""
first: Int
"""Returns the last _n_ elements from the list."""
last: Int
): GitChangedFileConnection!
"""Unified diff for a single file in this commit."""
diff(path: String!): GitFileDiff
}
"""The last commit that touched each requested entry in a directory."""
type GitLastCommit {
"""Entry name within the directory."""
name: String!
"""Most recent commit that modified this entry."""
commit: GitCommit!
}
# ── connection types ──────────────────────────────────────────────────────────
type GitRefConnection {
nodes: [GitRef!]!
pageInfo: PageInfo!
totalCount: Int!
}
"""Paginated list of commits."""
type GitCommitConnection {
nodes: [GitCommit!]!
pageInfo: PageInfo!
totalCount: Int!
}
type GitChangedFileConnection {
nodes: [GitChangedFile!]!
pageInfo: PageInfo!
totalCount: Int!
}
# ── commit sub-types ──────────────────────────────────────────────────────────
"""A file that was changed in a commit."""
type GitChangedFile
@goModel(model: "github.com/git-bug/git-bug/repository.ChangedFile") {
"""Path of the file in the new version of the commit."""
path: String!
"""Previous path, non-null only for renames."""
oldPath: String
"""How the file was affected by the commit."""
status: GitChangeStatus!
}
"""The diff for a single file in a commit."""
type GitFileDiff
@goModel(model: "github.com/git-bug/git-bug/repository.FileDiff") {
"""Path of the file in the new version."""
path: String!
"""Previous path, non-null only for renames."""
oldPath: String
"""True when the file is binary and no textual diff is available."""
isBinary: Boolean!
"""True when the file was created in this commit."""
isNew: Boolean!
"""True when the file was deleted in this commit."""
isDelete: Boolean!
"""Contiguous blocks of changes. Empty for binary files."""
hunks: [GitDiffHunk!]!
}
"""A contiguous block of changes in a unified diff."""
type GitDiffHunk
@goModel(model: "github.com/git-bug/git-bug/repository.DiffHunk") {
"""Starting line number in the old file."""
oldStart: Int!
"""Number of lines from the old file included in this hunk."""
oldLines: Int!
"""Starting line number in the new file."""
newStart: Int!
"""Number of lines from the new file included in this hunk."""
newLines: Int!
"""Lines in this hunk, including context, additions, and deletions."""
lines: [GitDiffLine!]!
}
"""A single line in a unified diff hunk."""
type GitDiffLine
@goModel(model: "github.com/git-bug/git-bug/repository.DiffLine") {
"""Whether this line is context, an addition, or a deletion."""
type: GitDiffLineType!
"""Raw line content, without the leading +/- prefix."""
content: String!
"""Line number in the old file. 0 for added lines."""
oldLine: Int!
"""Line number in the new file. 0 for deleted lines."""
newLine: Int!
}
# ── enums ─────────────────────────────────────────────────────────────────────
"""The kind of git reference: a branch, a tag, or a detached commit."""
enum GitRefType
@goModel(model: "github.com/git-bug/git-bug/repository.GitRefType") {
"""A local branch (refs/heads/*)."""
BRANCH @goEnum(value: "github.com/git-bug/git-bug/repository.GitRefTypeBranch")
"""An annotated or lightweight tag (refs/tags/*)."""
TAG @goEnum(value: "github.com/git-bug/git-bug/repository.GitRefTypeTag")
"""A detached HEAD pointing directly at a commit."""
COMMIT @goEnum(value: "github.com/git-bug/git-bug/repository.GitRefTypeCommit")
}
"""The type of object a git tree entry points to."""
enum GitObjectType
@goModel(model: "github.com/git-bug/git-bug/repository.ObjectType") {
"""A directory."""
TREE
"""A regular or executable file."""
BLOB
"""A symbolic link."""
SYMLINK
"""A git submodule."""
SUBMODULE
}
"""How a file was affected by a commit."""
enum GitChangeStatus
@goModel(model: "github.com/git-bug/git-bug/repository.ChangeStatus") {
"""File was created in this commit."""
ADDED
"""File content changed in this commit."""
MODIFIED
"""File was removed in this commit."""
DELETED
"""File was moved or renamed in this commit."""
RENAMED
}
"""The role of a line within a unified diff hunk."""
enum GitDiffLineType
@goModel(model: "github.com/git-bug/git-bug/repository.DiffLineType") {
"""An unchanged line present in both old and new versions."""
CONTEXT
"""A line added in the new version."""
ADDED
"""A line removed from the old version."""
DELETED
}