Skip to content

Commit 89deaa1

Browse files
authored
Merge pull request #234 from mapswipe/fix/remove-query-filters
fix: remove query filters from publicProjects
2 parents d7b798b + 341db46 commit 89deaa1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/fetchData.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ async function getCsrfTokenValue() {
212212
}
213213

214214
async function fetchAndWriteData() {
215-
let data = {};
215+
let data = {} as AllDataQuery;
216216
if (pipelineType === 'ci') {
217217
data = dummyData;
218218
} else {
@@ -226,7 +226,7 @@ async function fetchAndWriteData() {
226226
graphQLClient.setHeader('X-CSRFToken', csrfTokenValue);
227227
graphQLClient.setHeader('Cookie', `${COOKIE_NAME}=${csrfTokenValue}`);
228228
graphQLClient.setHeader('Referer', process.env.MAPSWIPE_REFERER_ENDPOINT ?? '');
229-
data = await graphQLClient.request(query);
229+
data = (await graphQLClient.request(query)) as AllDataQuery;
230230
}
231231

232232
// ensure the `data` directory exists
@@ -237,6 +237,7 @@ async function fetchAndWriteData() {
237237
fs.writeFileSync(outputPath, JSON.stringify(data, null, 2));
238238
console.log(`Data written to ${outputPath}`);
239239
console.log(`Top-level keys: ${Object.keys(data ?? {}).join(', ')}`);
240+
console.log(`Total projects count: ${data?.publicProjects?.totalCount}`);
240241

241242
const lastModifiedEpoch = Date.now();
242243
if (process.env.GITHUB_ENV) {

0 commit comments

Comments
 (0)