master
1// DO NOT EDIT. This is a generated file. Instead of this file, edit "commits.graphql".
2
3const Commit = `#graphql
4fragment Commit on Commit {
5 id
6 sha: oid
7 committedDate
8 message
9 messageBody
10 additions
11 deletions
12 author {
13 user {
14 login
15 }
16 }
17 committer {
18 user {
19 login
20 }
21 }
22 repository {
23 owner {
24 login
25 }
26 name
27 }
28}`
29
30export type Commit = {
31 id: string
32 sha: string
33 committedDate: string
34 message: string
35 messageBody: string
36 additions: number
37 deletions: number
38 author: {
39 user: {
40 login: string
41 } | null
42 } | null
43 committer: {
44 user: {
45 login: string
46 } | null
47 } | null
48 repository: {
49 owner: {
50 login: string
51 }
52 name: string
53 }
54}
55
56const History = `#graphql
57fragment History on Repository {
58 defaultBranchRef {
59 target {
60 ... on Commit {
61 history(first: $num, after: $cursor, author: {id: $author}) {
62 totalCount
63 nodes {
64 ...Commit
65 }
66 pageInfo {
67 hasNextPage
68 endCursor
69 }
70 }
71 }
72 }
73 }
74}`
75
76export type History = {
77 defaultBranchRef: {
78 target:
79 | ({} & {
80 history: {
81 totalCount: number
82 nodes: Array<{} & Commit> | null
83 pageInfo: {
84 hasNextPage: boolean
85 endCursor: string | null
86 }
87 }
88 })
89 | null
90 | null
91 } | null
92}
93
94export const CommitsQuery = `#graphql
95${Commit}
96${History}
97query CommitsQuery($id: ID!, $author: ID!, $num: Int = 100, $cursor: String) {
98 node(id: $id) {
99 ...History
100 }
101 rateLimit {
102 limit
103 cost
104 remaining
105 resetAt
106 }
107}` as string & CommitsQuery
108
109export type CommitsQuery = (vars: {
110 id: string
111 author: string
112 num?: number | null
113 cursor?: string | null
114}) => {
115 node: ({} & History) | null
116 rateLimit: {
117 limit: number
118 cost: number
119 remaining: number
120 resetAt: string
121 } | null
122}
123
124export const CommitsBatchQuery = `#graphql
125${Commit}
126${History}
127query CommitsBatchQuery($ids: [ID!]!, $author: ID!, $num: Int = 100, $cursor: String) {
128 nodes(ids: $ids) {
129 id
130 ...History
131 }
132 rateLimit {
133 limit
134 cost
135 remaining
136 resetAt
137 }
138}` as string & CommitsBatchQuery
139
140export type CommitsBatchQuery = (vars: {
141 ids: string[]
142 author: string
143 num?: number | null
144 cursor?: string | null
145}) => {
146 nodes: Array<
147 {
148 id: string
149 } & History
150 >
151 rateLimit: {
152 limit: number
153 cost: number
154 remaining: number
155 resetAt: string
156 } | null
157}