Get detailed data for each Splatfest

This commit is contained in:
Matt Isenhower 2022-09-19 15:03:46 -07:00
parent 0820c07be7
commit c2df39acea
2 changed files with 16 additions and 2 deletions

View File

@ -10,8 +10,18 @@ export default class FestivalUpdater extends DataUpdater
'$..image.url',
];
getData() {
return this.splatnet.getFestRecordData();
async getData() {
let result = await this.splatnet.getFestRecordData();
// Get the detailed data for each Splatfest
// TODO: Implement caching for past Splatfests to reduce the number of requests needed.
for (let node of result.data.festRecords.nodes) {
let detailResult = await this.splatnet.getFestDetailData(node.id);
Object.assign(node, detailResult.data.fest);
}
return result;
}
async formatDataForWrite(data) {

View File

@ -128,4 +128,8 @@ export default class SplatNet3Client
getFestRecordData() {
return this.getGraphQLPersistedQuery(1, '44c76790b68ca0f3da87f2a3452de986');
}
getFestDetailData(festId) {
return this.getGraphQLPersistedQuery(1, '2d661988c055d843b3be290f04fb0db9', { festId });
}
}