Skip to content

Commit 31cd2ca

Browse files
committed
feat(api): merge query
Signed-off-by: Adam Setch <[email protected]>
1 parent ec89e35 commit 31cd2ca

File tree

13 files changed

+1446
-95
lines changed

13 files changed

+1446
-95
lines changed

src/renderer/utils/api/client.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ export async function fetchDiscussionByNumber(
209209
notification.account.token,
210210
FetchDiscussionByNumberDocument,
211211
{
212-
ownerINDEX: notification.repository.owner.login,
213-
nameINDEX: notification.repository.name,
214-
numberINDEX: number,
212+
owner: notification.repository.owner.login,
213+
name: notification.repository.name,
214+
number: number,
215215
firstLabels: 100,
216-
lastComments: 10,
216+
lastThreadedComments: 10,
217217
lastReplies: 10,
218218
includeIsAnswered: isAnsweredDiscussionFeatureSupported(
219219
notification.account,
@@ -236,9 +236,9 @@ export async function fetchIssueByNumber(
236236
notification.account.token,
237237
FetchIssueByNumberDocument,
238238
{
239-
ownerINDEX: notification.repository.owner.login,
240-
nameINDEX: notification.repository.name,
241-
numberINDEX: number,
239+
owner: notification.repository.owner.login,
240+
name: notification.repository.name,
241+
number: number,
242242
firstLabels: 100,
243243
lastComments: 1,
244244
},
@@ -259,9 +259,9 @@ export async function fetchPullByNumber(
259259
notification.account.token,
260260
FetchPullRequestByNumberDocument,
261261
{
262-
ownerINDEX: notification.repository.owner.login,
263-
nameINDEX: notification.repository.name,
264-
numberINDEX: number,
262+
owner: notification.repository.owner.login,
263+
name: notification.repository.name,
264+
number: number,
265265
firstClosingIssues: 100,
266266
firstLabels: 100,
267267
lastComments: 1,

src/renderer/utils/api/graphql/discussion.graphql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#import './common.graphql'
22

33
query FetchDiscussionByNumber(
4-
$ownerINDEX: String!
5-
$nameINDEX: String!
6-
$numberINDEX: Int!
7-
$lastComments: Int
4+
$owner: String!
5+
$name: String!
6+
$number: Int!
7+
$lastThreadedComments: Int
88
$lastReplies: Int
99
$firstLabels: Int
1010
$includeIsAnswered: Boolean!
@@ -13,8 +13,8 @@ query FetchDiscussionByNumber(
1313
}
1414

1515
fragment DiscussionMergeQuery on Query {
16-
nodeINDEX: repository(owner: $ownerINDEX, name: $nameINDEX) {
17-
discussion(number: $numberINDEX) {
16+
repository(owner: $owner, name: $name) {
17+
discussion(number: $number) {
1818
...DiscussionDetails
1919
}
2020
}
@@ -30,7 +30,7 @@ fragment DiscussionDetails on Discussion {
3030
author {
3131
...AuthorFields
3232
}
33-
comments(last: $lastComments) {
33+
comments(last: $lastThreadedComments) {
3434
totalCount
3535
nodes {
3636
...DiscussionCommentFields

0 commit comments

Comments
 (0)