initial index

This commit is contained in:
41666 2023-05-22 21:04:29 -04:00
parent 62cc828d6a
commit 88015a98cd
21 changed files with 343 additions and 56 deletions

View file

@ -44,6 +44,7 @@ export type Health = {
worlds: {
name: string;
status: string;
lastEvent: string;
}[];
};
@ -55,19 +56,16 @@ export type IndexResponse = {
export const indexQuery = async (): Promise<IndexResponse> => {
const query = `{
health {
ingestReachable
ingest
database
worlds {
name
status
lastEvent
}
}
allWorlds {
id
name
population {
total
nc
tr
vs
@ -77,7 +75,6 @@ export const indexQuery = async (): Promise<IndexResponse> => {
id
name
population {
total
nc
tr
vs
@ -91,8 +88,6 @@ export const indexQuery = async (): Promise<IndexResponse> => {
indexData.allWorlds.sort((a, b) => a.id - b.id);
console.log(indexData);
return indexData;
};
@ -169,3 +164,6 @@ export const worldQuery = async (worldID: string): Promise<WorldResponse> => {
return worldData;
};
export const totalPopulation = ({ nc, vs, tr }: Population): number =>
nc + vs + tr;