Skip to content

Commit

Permalink
Using groupName parameter for batching
Browse files Browse the repository at this point in the history
  • Loading branch information
ptsochantaris committed Jul 9, 2023
1 parent a749038 commit c68cd7f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Shared/GraphQL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ enum GraphQL {
}
}

let queries = Query.batching("\(serverName): \(name)", idList: ids, perNode: nodeBlock, fields: fields)
let queries = Query.batching("\(serverName): \(name)", groupName: "nodes", idList: ids, perNode: nodeBlock, fields: fields)

do {
try await server.run(queries: queries)
Expand Down Expand Up @@ -500,7 +500,7 @@ enum GraphQL {
}

let prGroup = Group("pullRequests") { prFragment(assigneesAndLabelPageSize: 1, includeRepo: true) }
let group = BatchGroup(templateGroup: prGroup, idList: prsToCheck.compactMap(\.nodeId))
let group = BatchGroup(name: "nodes", templateGroup: prGroup, idList: prsToCheck.compactMap(\.nodeId))
let nodes = Lista<Node>()
let query = Query(name: "Closed Authored PRs", rootElement: group, allowsEmptyResponse: true) { node in
node.forcedUpdate = true
Expand Down Expand Up @@ -615,12 +615,12 @@ enum GraphQL {
}

if idsForReposInThisServerWantingLatestPrs.count > 0 {
let q = Query.batching("\(serverLabel): Updated PRs", idList: Array(idsForReposInThisServerWantingLatestPrs), perNode: perNodeBlock) { latestPrsFragment }
let q = Query.batching("\(serverLabel): Updated PRs", groupName: "nodes", idList: Array(idsForReposInThisServerWantingLatestPrs), perNode: perNodeBlock) { latestPrsFragment }
queriesForServer.append(contentsOf: q)
}

if idsForReposInThisServerWantingAllOpenPrs.count > 0 {
let q = Query.batching("\(serverLabel): Open PRs", idList: Array(idsForReposInThisServerWantingAllOpenPrs), perNode: perNodeBlock) { allOpenPrsFragment }
let q = Query.batching("\(serverLabel): Open PRs", groupName: "nodes", idList: Array(idsForReposInThisServerWantingAllOpenPrs), perNode: perNodeBlock) { allOpenPrsFragment }
queriesForServer.append(contentsOf: q)
}

Expand Down Expand Up @@ -695,12 +695,12 @@ enum GraphQL {
}

if idsForReposInThisServerWantingLatestIssues.count > 0 {
let q = Query.batching("\(serverLabel): Updated Issues", idList: Array(idsForReposInThisServerWantingLatestIssues), perNode: perNodeBlock) { latestIssuesFragment }
let q = Query.batching("\(serverLabel): Updated Issues", groupName: "nodes", idList: Array(idsForReposInThisServerWantingLatestIssues), perNode: perNodeBlock) { latestIssuesFragment }
queriesForServer.append(contentsOf: q)
}

if idsForReposInThisServerWantingAllOpenIssues.count > 0 {
let q = Query.batching("\(serverLabel): Open Issues", idList: Array(idsForReposInThisServerWantingAllOpenIssues), perNode: perNodeBlock) { allOpenIssuesFragment }
let q = Query.batching("\(serverLabel): Open Issues", groupName: "nodes", idList: Array(idsForReposInThisServerWantingAllOpenIssues), perNode: perNodeBlock) { allOpenIssuesFragment }
queriesForServer.append(contentsOf: q)
}

Expand Down

0 comments on commit c68cd7f

Please sign in to comment.