mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-04-25 07:18:35 -05:00
Tweak Splatfest updater to handle new paginated query
This commit is contained in:
parent
9d59b03476
commit
2736996f05
|
|
@ -59,7 +59,20 @@ export default class FestivalUpdater extends DataUpdater
|
|||
}
|
||||
|
||||
async getData(locale) {
|
||||
let result = await this.splatnet(locale).getFestRecordData();
|
||||
let cursor = null;
|
||||
let hasNextPage = true;
|
||||
let result = { data: { festRecords: { nodes: [] } } };
|
||||
|
||||
while (hasNextPage) {
|
||||
let data = await this.splatnet(locale).getFestRecordDataPage(cursor);
|
||||
|
||||
// Grab the nodes from the current page
|
||||
result.data.festRecords.nodes.push(...jsonpath.query(data, '$..festRecords.edges.*.node'));
|
||||
|
||||
// Update the cursor and next page indicator
|
||||
cursor = data.data.festRecords.pageInfo.endCursor;
|
||||
hasNextPage = data.data.festRecords.pageInfo.hasNextPage;
|
||||
}
|
||||
|
||||
this.deriveFestivalIds(result);
|
||||
|
||||
|
|
|
|||
|
|
@ -156,8 +156,8 @@ export default class SplatNet3Client
|
|||
return this.getGraphQLPersistedQuery(1, 'CoopHistoryQuery');
|
||||
}
|
||||
|
||||
getFestRecordData() {
|
||||
return this.getGraphQLPersistedQuery(1, 'FestRecordQuery');
|
||||
getFestRecordDataPage(cursor = null) {
|
||||
return this.getGraphQLPersistedQuery(1, 'FestRecordPaginationQuery', { cursor, first: 100 });
|
||||
}
|
||||
|
||||
getFestDetailData(festId) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user