From 41ad875a2ac1e16519a0fd1f5544f7fb216145cc Mon Sep 17 00:00:00 2001 From: broody Date: Tue, 19 Sep 2023 12:25:36 -0700 Subject: [PATCH] chore: yarn/cairo fmt --- src/tests/trade.cairo | 1 + src/tests/travel.cairo | 1 + web/src/components/Leaderboard.tsx | 6 +- web/src/components/Toast.tsx | 2 +- web/src/components/map/Map.tsx | 8 +- web/src/generated/graphql.ts | 1406 ++++++++++-------- web/src/generated/introspection.ts | 29 +- web/src/graphql/components.graphql | 4 +- web/src/hooks/media.tsx | 1 - web/src/pages/[gameId]/end.tsx | 28 +- web/src/pages/[gameId]/event/consequence.tsx | 2 +- web/src/pages/[gameId]/travel.tsx | 5 +- web/src/pages/index.tsx | 6 +- 13 files changed, 835 insertions(+), 664 deletions(-) diff --git a/src/tests/trade.cairo b/src/tests/trade.cairo index 9c317e3ed..6511af30b 100644 --- a/src/tests/trade.cairo +++ b/src/tests/trade.cairo @@ -52,3 +52,4 @@ const QUANTITY: usize = 3; // assert(player.drug_count == QUANTITY - 1, 'wrong sell amount'); // } + diff --git a/src/tests/travel.cairo b/src/tests/travel.cairo index 64b818344..965e9efe1 100644 --- a/src/tests/travel.cairo +++ b/src/tests/travel.cairo @@ -55,3 +55,4 @@ const WEED_ID: felt252 = 0x57656564; // weed // assert(player.location_id == queens_id, 'should have traveled'); // } + diff --git a/web/src/components/Leaderboard.tsx b/web/src/components/Leaderboard.tsx index b3f3222e9..7039db1a6 100644 --- a/web/src/components/Leaderboard.tsx +++ b/web/src/components/Leaderboard.tsx @@ -172,7 +172,11 @@ const Leaderboard = ({ )} - {hasNextPage && } + {hasNextPage && ( + + )} {/* Naming modale */} diff --git a/web/src/components/Toast.tsx b/web/src/components/Toast.tsx index 8a1d85791..ce30e5701 100644 --- a/web/src/components/Toast.tsx +++ b/web/src/components/Toast.tsx @@ -21,7 +21,7 @@ export const Toast = ({ p={["8px", "20px"]} mb={["16px", "20px"]} fontSize={["14px", "16px"]} - lineHeight={["1.2","1.5"]} + lineHeight={["1.2", "1.5"]} bgColor="neon.200" color="neon.900" justify="space-between" diff --git a/web/src/components/map/Map.tsx b/web/src/components/map/Map.tsx index d0414af3d..348c95101 100644 --- a/web/src/components/map/Map.tsx +++ b/web/src/components/map/Map.tsx @@ -18,7 +18,7 @@ const coordinate: CoordinateType = { [Location.Brooklyn]: { x: 0, y: -0 }, }; -const yOffset = -150 +const yOffset = -150; export const Map = ({ target, @@ -35,7 +35,11 @@ export const Map = ({ useEffect(() => { if (target !== undefined) { const animation = isMobile - ? { scale: 1.5, x: coordinate[target].x , y: coordinate[target].y +yOffset} + ? { + scale: 1.5, + x: coordinate[target].x, + y: coordinate[target].y + yOffset, + } : { scale: 1, x: 0, y: 0 }; animate( scope.current, diff --git a/web/src/generated/graphql.ts b/web/src/generated/graphql.ts index 14862970b..3d708b09b 100644 --- a/web/src/generated/graphql.ts +++ b/web/src/generated/graphql.ts @@ -1,10 +1,22 @@ -import { useQuery, useInfiniteQuery, UseQueryOptions, UseInfiniteQueryOptions, QueryFunctionContext } from 'react-query'; -import { useFetchData } from '@/hooks/fetcher'; +import { + useQuery, + useInfiniteQuery, + UseQueryOptions, + UseInfiniteQueryOptions, + QueryFunctionContext, +} from "react-query"; +import { useFetchData } from "@/hooks/fetcher"; export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { [K in keyof T]: T[K] }; -export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; -export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string; @@ -26,51 +38,51 @@ export type Scalars = { }; export type Component = { - __typename?: 'Component'; - classHash?: Maybe; - createdAt?: Maybe; - id?: Maybe; - name?: Maybe; - transactionHash?: Maybe; + __typename?: "Component"; + classHash?: Maybe; + createdAt?: Maybe; + id?: Maybe; + name?: Maybe; + transactionHash?: Maybe; }; export type ComponentConnection = { - __typename?: 'ComponentConnection'; + __typename?: "ComponentConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type ComponentEdge = { - __typename?: 'ComponentEdge'; - cursor: Scalars['Cursor']; + __typename?: "ComponentEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; export type ComponentUnion = Drug | Game | Market | Name | Player | Risks; export enum Direction { - Asc = 'ASC', - Desc = 'DESC' + Asc = "ASC", + Desc = "DESC", } export type Drug = { - __typename?: 'Drug'; - drug_id?: Maybe; + __typename?: "Drug"; + drug_id?: Maybe; entity?: Maybe; - game_id?: Maybe; - player_id?: Maybe; - quantity?: Maybe; + game_id?: Maybe; + player_id?: Maybe; + quantity?: Maybe; }; export type DrugConnection = { - __typename?: 'DrugConnection'; + __typename?: "DrugConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type DrugEdge = { - __typename?: 'DrugEdge'; - cursor: Scalars['Cursor']; + __typename?: "DrugEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; @@ -80,104 +92,104 @@ export type DrugOrder = { }; export enum DrugOrderOrderField { - DrugId = 'DRUG_ID', - GameId = 'GAME_ID', - PlayerId = 'PLAYER_ID', - Quantity = 'QUANTITY' + DrugId = "DRUG_ID", + GameId = "GAME_ID", + PlayerId = "PLAYER_ID", + Quantity = "QUANTITY", } export type DrugWhereInput = { - drug_id?: InputMaybe; - drug_idGT?: InputMaybe; - drug_idGTE?: InputMaybe; - drug_idLT?: InputMaybe; - drug_idLTE?: InputMaybe; - drug_idNEQ?: InputMaybe; - game_id?: InputMaybe; - game_idGT?: InputMaybe; - game_idGTE?: InputMaybe; - game_idLT?: InputMaybe; - game_idLTE?: InputMaybe; - game_idNEQ?: InputMaybe; - player_id?: InputMaybe; - player_idGT?: InputMaybe; - player_idGTE?: InputMaybe; - player_idLT?: InputMaybe; - player_idLTE?: InputMaybe; - player_idNEQ?: InputMaybe; - quantity?: InputMaybe; - quantityGT?: InputMaybe; - quantityGTE?: InputMaybe; - quantityLT?: InputMaybe; - quantityLTE?: InputMaybe; - quantityNEQ?: InputMaybe; + drug_id?: InputMaybe; + drug_idGT?: InputMaybe; + drug_idGTE?: InputMaybe; + drug_idLT?: InputMaybe; + drug_idLTE?: InputMaybe; + drug_idNEQ?: InputMaybe; + game_id?: InputMaybe; + game_idGT?: InputMaybe; + game_idGTE?: InputMaybe; + game_idLT?: InputMaybe; + game_idLTE?: InputMaybe; + game_idNEQ?: InputMaybe; + player_id?: InputMaybe; + player_idGT?: InputMaybe; + player_idGTE?: InputMaybe; + player_idLT?: InputMaybe; + player_idLTE?: InputMaybe; + player_idNEQ?: InputMaybe; + quantity?: InputMaybe; + quantityGT?: InputMaybe; + quantityGTE?: InputMaybe; + quantityLT?: InputMaybe; + quantityLTE?: InputMaybe; + quantityNEQ?: InputMaybe; }; export type Entity = { - __typename?: 'Entity'; - componentNames?: Maybe; + __typename?: "Entity"; + componentNames?: Maybe; components?: Maybe>>; - createdAt?: Maybe; - id?: Maybe; - keys?: Maybe>>; - updatedAt?: Maybe; + createdAt?: Maybe; + id?: Maybe; + keys?: Maybe>>; + updatedAt?: Maybe; }; export type EntityConnection = { - __typename?: 'EntityConnection'; + __typename?: "EntityConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type EntityEdge = { - __typename?: 'EntityEdge'; - cursor: Scalars['Cursor']; + __typename?: "EntityEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; export type Event = { - __typename?: 'Event'; - createdAt?: Maybe; - data?: Maybe; - id?: Maybe; - keys?: Maybe; + __typename?: "Event"; + createdAt?: Maybe; + data?: Maybe; + id?: Maybe; + keys?: Maybe; systemCall: SystemCall; - systemCallId?: Maybe; + systemCallId?: Maybe; }; export type EventConnection = { - __typename?: 'EventConnection'; + __typename?: "EventConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type EventEdge = { - __typename?: 'EventEdge'; - cursor: Scalars['Cursor']; + __typename?: "EventEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; export type Game = { - __typename?: 'Game'; - creator?: Maybe; + __typename?: "Game"; + creator?: Maybe; entity?: Maybe; - game_id?: Maybe; - is_finished?: Maybe; - max_players?: Maybe; - max_turns?: Maybe; - num_players?: Maybe; - start_time?: Maybe; + game_id?: Maybe; + is_finished?: Maybe; + max_players?: Maybe; + max_turns?: Maybe; + num_players?: Maybe; + start_time?: Maybe; }; export type GameConnection = { - __typename?: 'GameConnection'; + __typename?: "GameConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type GameEdge = { - __typename?: 'GameEdge'; - cursor: Scalars['Cursor']; + __typename?: "GameEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; @@ -187,79 +199,79 @@ export type GameOrder = { }; export enum GameOrderOrderField { - Creator = 'CREATOR', - GameId = 'GAME_ID', - IsFinished = 'IS_FINISHED', - MaxPlayers = 'MAX_PLAYERS', - MaxTurns = 'MAX_TURNS', - NumPlayers = 'NUM_PLAYERS', - StartTime = 'START_TIME' + Creator = "CREATOR", + GameId = "GAME_ID", + IsFinished = "IS_FINISHED", + MaxPlayers = "MAX_PLAYERS", + MaxTurns = "MAX_TURNS", + NumPlayers = "NUM_PLAYERS", + StartTime = "START_TIME", } export type GameWhereInput = { - creator?: InputMaybe; - creatorGT?: InputMaybe; - creatorGTE?: InputMaybe; - creatorLT?: InputMaybe; - creatorLTE?: InputMaybe; - creatorNEQ?: InputMaybe; - game_id?: InputMaybe; - game_idGT?: InputMaybe; - game_idGTE?: InputMaybe; - game_idLT?: InputMaybe; - game_idLTE?: InputMaybe; - game_idNEQ?: InputMaybe; - is_finished?: InputMaybe; - is_finishedGT?: InputMaybe; - is_finishedGTE?: InputMaybe; - is_finishedLT?: InputMaybe; - is_finishedLTE?: InputMaybe; - is_finishedNEQ?: InputMaybe; - max_players?: InputMaybe; - max_playersGT?: InputMaybe; - max_playersGTE?: InputMaybe; - max_playersLT?: InputMaybe; - max_playersLTE?: InputMaybe; - max_playersNEQ?: InputMaybe; - max_turns?: InputMaybe; - max_turnsGT?: InputMaybe; - max_turnsGTE?: InputMaybe; - max_turnsLT?: InputMaybe; - max_turnsLTE?: InputMaybe; - max_turnsNEQ?: InputMaybe; - num_players?: InputMaybe; - num_playersGT?: InputMaybe; - num_playersGTE?: InputMaybe; - num_playersLT?: InputMaybe; - num_playersLTE?: InputMaybe; - num_playersNEQ?: InputMaybe; - start_time?: InputMaybe; - start_timeGT?: InputMaybe; - start_timeGTE?: InputMaybe; - start_timeLT?: InputMaybe; - start_timeLTE?: InputMaybe; - start_timeNEQ?: InputMaybe; + creator?: InputMaybe; + creatorGT?: InputMaybe; + creatorGTE?: InputMaybe; + creatorLT?: InputMaybe; + creatorLTE?: InputMaybe; + creatorNEQ?: InputMaybe; + game_id?: InputMaybe; + game_idGT?: InputMaybe; + game_idGTE?: InputMaybe; + game_idLT?: InputMaybe; + game_idLTE?: InputMaybe; + game_idNEQ?: InputMaybe; + is_finished?: InputMaybe; + is_finishedGT?: InputMaybe; + is_finishedGTE?: InputMaybe; + is_finishedLT?: InputMaybe; + is_finishedLTE?: InputMaybe; + is_finishedNEQ?: InputMaybe; + max_players?: InputMaybe; + max_playersGT?: InputMaybe; + max_playersGTE?: InputMaybe; + max_playersLT?: InputMaybe; + max_playersLTE?: InputMaybe; + max_playersNEQ?: InputMaybe; + max_turns?: InputMaybe; + max_turnsGT?: InputMaybe; + max_turnsGTE?: InputMaybe; + max_turnsLT?: InputMaybe; + max_turnsLTE?: InputMaybe; + max_turnsNEQ?: InputMaybe; + num_players?: InputMaybe; + num_playersGT?: InputMaybe; + num_playersGTE?: InputMaybe; + num_playersLT?: InputMaybe; + num_playersLTE?: InputMaybe; + num_playersNEQ?: InputMaybe; + start_time?: InputMaybe; + start_timeGT?: InputMaybe; + start_timeGTE?: InputMaybe; + start_timeLT?: InputMaybe; + start_timeLTE?: InputMaybe; + start_timeNEQ?: InputMaybe; }; export type Market = { - __typename?: 'Market'; - cash?: Maybe; - drug_id?: Maybe; + __typename?: "Market"; + cash?: Maybe; + drug_id?: Maybe; entity?: Maybe; - game_id?: Maybe; - location_id?: Maybe; - quantity?: Maybe; + game_id?: Maybe; + location_id?: Maybe; + quantity?: Maybe; }; export type MarketConnection = { - __typename?: 'MarketConnection'; + __typename?: "MarketConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type MarketEdge = { - __typename?: 'MarketEdge'; - cursor: Scalars['Cursor']; + __typename?: "MarketEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; @@ -269,63 +281,63 @@ export type MarketOrder = { }; export enum MarketOrderOrderField { - Cash = 'CASH', - DrugId = 'DRUG_ID', - GameId = 'GAME_ID', - LocationId = 'LOCATION_ID', - Quantity = 'QUANTITY' + Cash = "CASH", + DrugId = "DRUG_ID", + GameId = "GAME_ID", + LocationId = "LOCATION_ID", + Quantity = "QUANTITY", } export type MarketWhereInput = { - cash?: InputMaybe; - cashGT?: InputMaybe; - cashGTE?: InputMaybe; - cashLT?: InputMaybe; - cashLTE?: InputMaybe; - cashNEQ?: InputMaybe; - drug_id?: InputMaybe; - drug_idGT?: InputMaybe; - drug_idGTE?: InputMaybe; - drug_idLT?: InputMaybe; - drug_idLTE?: InputMaybe; - drug_idNEQ?: InputMaybe; - game_id?: InputMaybe; - game_idGT?: InputMaybe; - game_idGTE?: InputMaybe; - game_idLT?: InputMaybe; - game_idLTE?: InputMaybe; - game_idNEQ?: InputMaybe; - location_id?: InputMaybe; - location_idGT?: InputMaybe; - location_idGTE?: InputMaybe; - location_idLT?: InputMaybe; - location_idLTE?: InputMaybe; - location_idNEQ?: InputMaybe; - quantity?: InputMaybe; - quantityGT?: InputMaybe; - quantityGTE?: InputMaybe; - quantityLT?: InputMaybe; - quantityLTE?: InputMaybe; - quantityNEQ?: InputMaybe; + cash?: InputMaybe; + cashGT?: InputMaybe; + cashGTE?: InputMaybe; + cashLT?: InputMaybe; + cashLTE?: InputMaybe; + cashNEQ?: InputMaybe; + drug_id?: InputMaybe; + drug_idGT?: InputMaybe; + drug_idGTE?: InputMaybe; + drug_idLT?: InputMaybe; + drug_idLTE?: InputMaybe; + drug_idNEQ?: InputMaybe; + game_id?: InputMaybe; + game_idGT?: InputMaybe; + game_idGTE?: InputMaybe; + game_idLT?: InputMaybe; + game_idLTE?: InputMaybe; + game_idNEQ?: InputMaybe; + location_id?: InputMaybe; + location_idGT?: InputMaybe; + location_idGTE?: InputMaybe; + location_idLT?: InputMaybe; + location_idLTE?: InputMaybe; + location_idNEQ?: InputMaybe; + quantity?: InputMaybe; + quantityGT?: InputMaybe; + quantityGTE?: InputMaybe; + quantityLT?: InputMaybe; + quantityLTE?: InputMaybe; + quantityNEQ?: InputMaybe; }; export type Name = { - __typename?: 'Name'; + __typename?: "Name"; entity?: Maybe; - game_id?: Maybe; - player_id?: Maybe; - short_string?: Maybe; + game_id?: Maybe; + player_id?: Maybe; + short_string?: Maybe; }; export type NameConnection = { - __typename?: 'NameConnection'; + __typename?: "NameConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type NameEdge = { - __typename?: 'NameEdge'; - cursor: Scalars['Cursor']; + __typename?: "NameEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; @@ -335,57 +347,57 @@ export type NameOrder = { }; export enum NameOrderOrderField { - GameId = 'GAME_ID', - PlayerId = 'PLAYER_ID', - ShortString = 'SHORT_STRING' + GameId = "GAME_ID", + PlayerId = "PLAYER_ID", + ShortString = "SHORT_STRING", } export type NameWhereInput = { - game_id?: InputMaybe; - game_idGT?: InputMaybe; - game_idGTE?: InputMaybe; - game_idLT?: InputMaybe; - game_idLTE?: InputMaybe; - game_idNEQ?: InputMaybe; - player_id?: InputMaybe; - player_idGT?: InputMaybe; - player_idGTE?: InputMaybe; - player_idLT?: InputMaybe; - player_idLTE?: InputMaybe; - player_idNEQ?: InputMaybe; - short_string?: InputMaybe; - short_stringGT?: InputMaybe; - short_stringGTE?: InputMaybe; - short_stringLT?: InputMaybe; - short_stringLTE?: InputMaybe; - short_stringNEQ?: InputMaybe; + game_id?: InputMaybe; + game_idGT?: InputMaybe; + game_idGTE?: InputMaybe; + game_idLT?: InputMaybe; + game_idLTE?: InputMaybe; + game_idNEQ?: InputMaybe; + player_id?: InputMaybe; + player_idGT?: InputMaybe; + player_idGTE?: InputMaybe; + player_idLT?: InputMaybe; + player_idLTE?: InputMaybe; + player_idNEQ?: InputMaybe; + short_string?: InputMaybe; + short_stringGT?: InputMaybe; + short_stringGTE?: InputMaybe; + short_stringLT?: InputMaybe; + short_stringLTE?: InputMaybe; + short_stringNEQ?: InputMaybe; }; export type Player = { - __typename?: 'Player'; - bag_limit?: Maybe; - cash?: Maybe; - drug_count?: Maybe; + __typename?: "Player"; + bag_limit?: Maybe; + cash?: Maybe; + drug_count?: Maybe; entity?: Maybe; - game_id?: Maybe; - health?: Maybe; - location_id?: Maybe; - player_id?: Maybe; - run_attempts?: Maybe; - status?: Maybe; - turns_remaining?: Maybe; - turns_remaining_on_death?: Maybe; + game_id?: Maybe; + health?: Maybe; + location_id?: Maybe; + player_id?: Maybe; + run_attempts?: Maybe; + status?: Maybe; + turns_remaining?: Maybe; + turns_remaining_on_death?: Maybe; }; export type PlayerConnection = { - __typename?: 'PlayerConnection'; + __typename?: "PlayerConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type PlayerEdge = { - __typename?: 'PlayerEdge'; - cursor: Scalars['Cursor']; + __typename?: "PlayerEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; @@ -395,90 +407,90 @@ export type PlayerOrder = { }; export enum PlayerOrderOrderField { - BagLimit = 'BAG_LIMIT', - Cash = 'CASH', - DrugCount = 'DRUG_COUNT', - GameId = 'GAME_ID', - Health = 'HEALTH', - LocationId = 'LOCATION_ID', - PlayerId = 'PLAYER_ID', - RunAttempts = 'RUN_ATTEMPTS', - Status = 'STATUS', - TurnsRemaining = 'TURNS_REMAINING', - TurnsRemainingOnDeath = 'TURNS_REMAINING_ON_DEATH' + BagLimit = "BAG_LIMIT", + Cash = "CASH", + DrugCount = "DRUG_COUNT", + GameId = "GAME_ID", + Health = "HEALTH", + LocationId = "LOCATION_ID", + PlayerId = "PLAYER_ID", + RunAttempts = "RUN_ATTEMPTS", + Status = "STATUS", + TurnsRemaining = "TURNS_REMAINING", + TurnsRemainingOnDeath = "TURNS_REMAINING_ON_DEATH", } export type PlayerWhereInput = { - bag_limit?: InputMaybe; - bag_limitGT?: InputMaybe; - bag_limitGTE?: InputMaybe; - bag_limitLT?: InputMaybe; - bag_limitLTE?: InputMaybe; - bag_limitNEQ?: InputMaybe; - cash?: InputMaybe; - cashGT?: InputMaybe; - cashGTE?: InputMaybe; - cashLT?: InputMaybe; - cashLTE?: InputMaybe; - cashNEQ?: InputMaybe; - drug_count?: InputMaybe; - drug_countGT?: InputMaybe; - drug_countGTE?: InputMaybe; - drug_countLT?: InputMaybe; - drug_countLTE?: InputMaybe; - drug_countNEQ?: InputMaybe; - game_id?: InputMaybe; - game_idGT?: InputMaybe; - game_idGTE?: InputMaybe; - game_idLT?: InputMaybe; - game_idLTE?: InputMaybe; - game_idNEQ?: InputMaybe; - health?: InputMaybe; - healthGT?: InputMaybe; - healthGTE?: InputMaybe; - healthLT?: InputMaybe; - healthLTE?: InputMaybe; - healthNEQ?: InputMaybe; - location_id?: InputMaybe; - location_idGT?: InputMaybe; - location_idGTE?: InputMaybe; - location_idLT?: InputMaybe; - location_idLTE?: InputMaybe; - location_idNEQ?: InputMaybe; - player_id?: InputMaybe; - player_idGT?: InputMaybe; - player_idGTE?: InputMaybe; - player_idLT?: InputMaybe; - player_idLTE?: InputMaybe; - player_idNEQ?: InputMaybe; - run_attempts?: InputMaybe; - run_attemptsGT?: InputMaybe; - run_attemptsGTE?: InputMaybe; - run_attemptsLT?: InputMaybe; - run_attemptsLTE?: InputMaybe; - run_attemptsNEQ?: InputMaybe; - status?: InputMaybe; - statusGT?: InputMaybe; - statusGTE?: InputMaybe; - statusLT?: InputMaybe; - statusLTE?: InputMaybe; - statusNEQ?: InputMaybe; - turns_remaining?: InputMaybe; - turns_remainingGT?: InputMaybe; - turns_remainingGTE?: InputMaybe; - turns_remainingLT?: InputMaybe; - turns_remainingLTE?: InputMaybe; - turns_remainingNEQ?: InputMaybe; - turns_remaining_on_death?: InputMaybe; - turns_remaining_on_deathGT?: InputMaybe; - turns_remaining_on_deathGTE?: InputMaybe; - turns_remaining_on_deathLT?: InputMaybe; - turns_remaining_on_deathLTE?: InputMaybe; - turns_remaining_on_deathNEQ?: InputMaybe; + bag_limit?: InputMaybe; + bag_limitGT?: InputMaybe; + bag_limitGTE?: InputMaybe; + bag_limitLT?: InputMaybe; + bag_limitLTE?: InputMaybe; + bag_limitNEQ?: InputMaybe; + cash?: InputMaybe; + cashGT?: InputMaybe; + cashGTE?: InputMaybe; + cashLT?: InputMaybe; + cashLTE?: InputMaybe; + cashNEQ?: InputMaybe; + drug_count?: InputMaybe; + drug_countGT?: InputMaybe; + drug_countGTE?: InputMaybe; + drug_countLT?: InputMaybe; + drug_countLTE?: InputMaybe; + drug_countNEQ?: InputMaybe; + game_id?: InputMaybe; + game_idGT?: InputMaybe; + game_idGTE?: InputMaybe; + game_idLT?: InputMaybe; + game_idLTE?: InputMaybe; + game_idNEQ?: InputMaybe; + health?: InputMaybe; + healthGT?: InputMaybe; + healthGTE?: InputMaybe; + healthLT?: InputMaybe; + healthLTE?: InputMaybe; + healthNEQ?: InputMaybe; + location_id?: InputMaybe; + location_idGT?: InputMaybe; + location_idGTE?: InputMaybe; + location_idLT?: InputMaybe; + location_idLTE?: InputMaybe; + location_idNEQ?: InputMaybe; + player_id?: InputMaybe; + player_idGT?: InputMaybe; + player_idGTE?: InputMaybe; + player_idLT?: InputMaybe; + player_idLTE?: InputMaybe; + player_idNEQ?: InputMaybe; + run_attempts?: InputMaybe; + run_attemptsGT?: InputMaybe; + run_attemptsGTE?: InputMaybe; + run_attemptsLT?: InputMaybe; + run_attemptsLTE?: InputMaybe; + run_attemptsNEQ?: InputMaybe; + status?: InputMaybe; + statusGT?: InputMaybe; + statusGTE?: InputMaybe; + statusLT?: InputMaybe; + statusLTE?: InputMaybe; + statusNEQ?: InputMaybe; + turns_remaining?: InputMaybe; + turns_remainingGT?: InputMaybe; + turns_remainingGTE?: InputMaybe; + turns_remainingLT?: InputMaybe; + turns_remainingLTE?: InputMaybe; + turns_remainingNEQ?: InputMaybe; + turns_remaining_on_death?: InputMaybe; + turns_remaining_on_deathGT?: InputMaybe; + turns_remaining_on_deathGTE?: InputMaybe; + turns_remaining_on_deathLT?: InputMaybe; + turns_remaining_on_deathLTE?: InputMaybe; + turns_remaining_on_deathNEQ?: InputMaybe; }; export type Query = { - __typename?: 'Query'; + __typename?: "Query"; component: Component; components?: Maybe; drugComponents?: Maybe; @@ -497,118 +509,106 @@ export type Query = { systems?: Maybe; }; - export type QueryComponentArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - export type QueryDrugComponentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; order?: InputMaybe; where?: InputMaybe; }; - export type QueryEntitiesArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - keys?: InputMaybe>>; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + keys?: InputMaybe>>; + last?: InputMaybe; }; - export type QueryEntityArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - export type QueryEventArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - export type QueryGameComponentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; order?: InputMaybe; where?: InputMaybe; }; - export type QueryMarketComponentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; order?: InputMaybe; where?: InputMaybe; }; - export type QueryNameComponentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; order?: InputMaybe; where?: InputMaybe; }; - export type QueryPlayerComponentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; order?: InputMaybe; where?: InputMaybe; }; - export type QueryRisksComponentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; order?: InputMaybe; where?: InputMaybe; }; - export type QuerySystemArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - export type QuerySystemCallArgs = { - id: Scalars['Int']; + id: Scalars["Int"]; }; export type Risks = { - __typename?: 'Risks'; - capture?: Maybe; + __typename?: "Risks"; + capture?: Maybe; entity?: Maybe; - game_id?: Maybe; - location_id?: Maybe; - travel?: Maybe; + game_id?: Maybe; + location_id?: Maybe; + travel?: Maybe; }; export type RisksConnection = { - __typename?: 'RisksConnection'; + __typename?: "RisksConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type RisksEdge = { - __typename?: 'RisksEdge'; - cursor: Scalars['Cursor']; + __typename?: "RisksEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; @@ -618,132 +618,264 @@ export type RisksOrder = { }; export enum RisksOrderOrderField { - Capture = 'CAPTURE', - GameId = 'GAME_ID', - LocationId = 'LOCATION_ID', - Travel = 'TRAVEL' + Capture = "CAPTURE", + GameId = "GAME_ID", + LocationId = "LOCATION_ID", + Travel = "TRAVEL", } export type RisksWhereInput = { - capture?: InputMaybe; - captureGT?: InputMaybe; - captureGTE?: InputMaybe; - captureLT?: InputMaybe; - captureLTE?: InputMaybe; - captureNEQ?: InputMaybe; - game_id?: InputMaybe; - game_idGT?: InputMaybe; - game_idGTE?: InputMaybe; - game_idLT?: InputMaybe; - game_idLTE?: InputMaybe; - game_idNEQ?: InputMaybe; - location_id?: InputMaybe; - location_idGT?: InputMaybe; - location_idGTE?: InputMaybe; - location_idLT?: InputMaybe; - location_idLTE?: InputMaybe; - location_idNEQ?: InputMaybe; - travel?: InputMaybe; - travelGT?: InputMaybe; - travelGTE?: InputMaybe; - travelLT?: InputMaybe; - travelLTE?: InputMaybe; - travelNEQ?: InputMaybe; + capture?: InputMaybe; + captureGT?: InputMaybe; + captureGTE?: InputMaybe; + captureLT?: InputMaybe; + captureLTE?: InputMaybe; + captureNEQ?: InputMaybe; + game_id?: InputMaybe; + game_idGT?: InputMaybe; + game_idGTE?: InputMaybe; + game_idLT?: InputMaybe; + game_idLTE?: InputMaybe; + game_idNEQ?: InputMaybe; + location_id?: InputMaybe; + location_idGT?: InputMaybe; + location_idGTE?: InputMaybe; + location_idLT?: InputMaybe; + location_idLTE?: InputMaybe; + location_idNEQ?: InputMaybe; + travel?: InputMaybe; + travelGT?: InputMaybe; + travelGTE?: InputMaybe; + travelLT?: InputMaybe; + travelLTE?: InputMaybe; + travelNEQ?: InputMaybe; }; export type Subscription = { - __typename?: 'Subscription'; + __typename?: "Subscription"; componentRegistered: Component; entityUpdated: Entity; }; export type System = { - __typename?: 'System'; - classHash?: Maybe; - createdAt?: Maybe; - id?: Maybe; - name?: Maybe; + __typename?: "System"; + classHash?: Maybe; + createdAt?: Maybe; + id?: Maybe; + name?: Maybe; systemCalls: Array; - transactionHash?: Maybe; + transactionHash?: Maybe; }; export type SystemCall = { - __typename?: 'SystemCall'; - createdAt?: Maybe; - data?: Maybe; - id?: Maybe; + __typename?: "SystemCall"; + createdAt?: Maybe; + data?: Maybe; + id?: Maybe; system: System; - systemId?: Maybe; - transactionHash?: Maybe; + systemId?: Maybe; + transactionHash?: Maybe; }; export type SystemCallConnection = { - __typename?: 'SystemCallConnection'; + __typename?: "SystemCallConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type SystemCallEdge = { - __typename?: 'SystemCallEdge'; - cursor: Scalars['Cursor']; + __typename?: "SystemCallEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; export type SystemConnection = { - __typename?: 'SystemConnection'; + __typename?: "SystemConnection"; edges?: Maybe>>; - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; export type SystemEdge = { - __typename?: 'SystemEdge'; - cursor: Scalars['Cursor']; + __typename?: "SystemEdge"; + cursor: Scalars["Cursor"]; node?: Maybe; }; -export type AvailableGamesQueryVariables = Exact<{ [key: string]: never; }>; - - -export type AvailableGamesQuery = { __typename?: 'Query', gameComponents?: { __typename?: 'GameConnection', totalCount: number, edges?: Array<{ __typename?: 'GameEdge', cursor: any, node?: { __typename?: 'Game', creator?: any | null, num_players?: any | null, max_players?: any | null, max_turns?: any | null, start_time?: any | null } | null } | null> | null } | null }; +export type AvailableGamesQueryVariables = Exact<{ [key: string]: never }>; + +export type AvailableGamesQuery = { + __typename?: "Query"; + gameComponents?: { + __typename?: "GameConnection"; + totalCount: number; + edges?: Array<{ + __typename?: "GameEdge"; + cursor: any; + node?: { + __typename?: "Game"; + creator?: any | null; + num_players?: any | null; + max_players?: any | null; + max_turns?: any | null; + start_time?: any | null; + } | null; + } | null> | null; + } | null; +}; export type GlobalScoresQueryVariables = Exact<{ - limit?: InputMaybe; - cursor?: InputMaybe; + limit?: InputMaybe; + cursor?: InputMaybe; }>; - -export type GlobalScoresQuery = { __typename?: 'Query', playerComponents?: { __typename?: 'PlayerConnection', totalCount: number, edges?: Array<{ __typename?: 'PlayerEdge', cursor: any, node?: { __typename?: 'Player', cash?: any | null, health?: any | null, entity?: { __typename?: 'Entity', keys?: Array | null, components?: Array<{ __typename: 'Drug' } | { __typename: 'Game' } | { __typename: 'Market' } | { __typename: 'Name', short_string?: any | null } | { __typename: 'Player' } | { __typename: 'Risks' } | null> | null } | null } | null } | null> | null } | null }; +export type GlobalScoresQuery = { + __typename?: "Query"; + playerComponents?: { + __typename?: "PlayerConnection"; + totalCount: number; + edges?: Array<{ + __typename?: "PlayerEdge"; + cursor: any; + node?: { + __typename?: "Player"; + cash?: any | null; + health?: any | null; + entity?: { + __typename?: "Entity"; + keys?: Array | null; + components?: Array< + | { __typename: "Drug" } + | { __typename: "Game" } + | { __typename: "Market" } + | { __typename: "Name"; short_string?: any | null } + | { __typename: "Player" } + | { __typename: "Risks" } + | null + > | null; + } | null; + } | null; + } | null> | null; + } | null; +}; export type MarketPricesQueryVariables = Exact<{ - gameId?: InputMaybe; + gameId?: InputMaybe; }>; - -export type MarketPricesQuery = { __typename?: 'Query', marketComponents?: { __typename?: 'MarketConnection', edges?: Array<{ __typename?: 'MarketEdge', node?: { __typename?: 'Market', drug_id?: any | null, location_id?: any | null, quantity?: any | null, cash?: any | null } | null } | null> | null } | null }; +export type MarketPricesQuery = { + __typename?: "Query"; + marketComponents?: { + __typename?: "MarketConnection"; + edges?: Array<{ + __typename?: "MarketEdge"; + node?: { + __typename?: "Market"; + drug_id?: any | null; + location_id?: any | null; + quantity?: any | null; + cash?: any | null; + } | null; + } | null> | null; + } | null; +}; export type GameEntityQueryVariables = Exact<{ - id: Scalars['ID']; + id: Scalars["ID"]; }>; - -export type GameEntityQuery = { __typename?: 'Query', entity: { __typename?: 'Entity', components?: Array<{ __typename: 'Drug' } | { __typename: 'Game', creator?: any | null, is_finished?: any | null, max_players?: any | null, max_turns?: any | null, num_players?: any | null, start_time?: any | null } | { __typename: 'Market' } | { __typename: 'Name' } | { __typename: 'Player' } | { __typename: 'Risks' } | null> | null } }; +export type GameEntityQuery = { + __typename?: "Query"; + entity: { + __typename?: "Entity"; + components?: Array< + | { __typename: "Drug" } + | { + __typename: "Game"; + creator?: any | null; + is_finished?: any | null; + max_players?: any | null; + max_turns?: any | null; + num_players?: any | null; + start_time?: any | null; + } + | { __typename: "Market" } + | { __typename: "Name" } + | { __typename: "Player" } + | { __typename: "Risks" } + | null + > | null; + }; +}; export type PlayerEntityQueryVariables = Exact<{ - gameId: Scalars['String']; - playerId: Scalars['String']; + gameId: Scalars["String"]; + playerId: Scalars["String"]; }>; - -export type PlayerEntityQuery = { __typename?: 'Query', entities?: { __typename?: 'EntityConnection', totalCount: number, edges?: Array<{ __typename?: 'EntityEdge', cursor: any, node?: { __typename?: 'Entity', keys?: Array | null, components?: Array<{ __typename: 'Drug', drug_id?: any | null, quantity?: any | null } | { __typename: 'Game' } | { __typename: 'Market' } | { __typename: 'Name' } | { __typename: 'Player', cash?: any | null, status?: any | null, health?: any | null, drug_count?: any | null, bag_limit?: any | null, location_id?: any | null, turns_remaining?: any | null, turns_remaining_on_death?: any | null } | { __typename: 'Risks' } | null> | null } | null } | null> | null } | null }; +export type PlayerEntityQuery = { + __typename?: "Query"; + entities?: { + __typename?: "EntityConnection"; + totalCount: number; + edges?: Array<{ + __typename?: "EntityEdge"; + cursor: any; + node?: { + __typename?: "Entity"; + keys?: Array | null; + components?: Array< + | { __typename: "Drug"; drug_id?: any | null; quantity?: any | null } + | { __typename: "Game" } + | { __typename: "Market" } + | { __typename: "Name" } + | { + __typename: "Player"; + cash?: any | null; + status?: any | null; + health?: any | null; + drug_count?: any | null; + bag_limit?: any | null; + location_id?: any | null; + turns_remaining?: any | null; + turns_remaining_on_death?: any | null; + } + | { __typename: "Risks" } + | null + > | null; + } | null; + } | null> | null; + } | null; +}; export type LocationEntitiesQueryVariables = Exact<{ - gameId: Scalars['String']; - locationId: Scalars['String']; + gameId: Scalars["String"]; + locationId: Scalars["String"]; }>; - -export type LocationEntitiesQuery = { __typename?: 'Query', entities?: { __typename?: 'EntityConnection', totalCount: number, edges?: Array<{ __typename?: 'EntityEdge', cursor: any, node?: { __typename?: 'Entity', keys?: Array | null, components?: Array<{ __typename: 'Drug' } | { __typename: 'Game' } | { __typename: 'Market', cash?: any | null, quantity?: any | null } | { __typename: 'Name' } | { __typename: 'Player' } | { __typename: 'Risks', travel?: any | null } | null> | null } | null } | null> | null } | null }; - +export type LocationEntitiesQuery = { + __typename?: "Query"; + entities?: { + __typename?: "EntityConnection"; + totalCount: number; + edges?: Array<{ + __typename?: "EntityEdge"; + cursor: any; + node?: { + __typename?: "Entity"; + keys?: Array | null; + components?: Array< + | { __typename: "Drug" } + | { __typename: "Game" } + | { __typename: "Market"; cash?: any | null; quantity?: any | null } + | { __typename: "Name" } + | { __typename: "Player" } + | { __typename: "Risks"; travel?: any | null } + | null + > | null; + } | null; + } | null> | null; + } | null; +}; export const AvailableGamesDocument = ` query AvailableGames { @@ -763,39 +895,49 @@ export const AvailableGamesDocument = ` } `; export const useAvailableGamesQuery = < - TData = AvailableGamesQuery, - TError = unknown - >( - variables?: AvailableGamesQueryVariables, - options?: UseQueryOptions - ) => - useQuery( - variables === undefined ? ['AvailableGames'] : ['AvailableGames', variables], - useFetchData(AvailableGamesDocument).bind(null, variables), - options - ); - -useAvailableGamesQuery.getKey = (variables?: AvailableGamesQueryVariables) => variables === undefined ? ['AvailableGames'] : ['AvailableGames', variables]; -; - + TData = AvailableGamesQuery, + TError = unknown, +>( + variables?: AvailableGamesQueryVariables, + options?: UseQueryOptions, +) => + useQuery( + variables === undefined + ? ["AvailableGames"] + : ["AvailableGames", variables], + useFetchData( + AvailableGamesDocument, + ).bind(null, variables), + options, + ); + +useAvailableGamesQuery.getKey = (variables?: AvailableGamesQueryVariables) => + variables === undefined ? ["AvailableGames"] : ["AvailableGames", variables]; export const useInfiniteAvailableGamesQuery = < - TData = AvailableGamesQuery, - TError = unknown - >( - variables?: AvailableGamesQueryVariables, - options?: UseInfiniteQueryOptions - ) =>{ - const query = useFetchData(AvailableGamesDocument) - return useInfiniteQuery( - variables === undefined ? ['AvailableGames.infinite'] : ['AvailableGames.infinite', variables], - (metaData) => query({...variables, ...(metaData.pageParam ?? {})}), - options - )}; - - -useInfiniteAvailableGamesQuery.getKey = (variables?: AvailableGamesQueryVariables) => variables === undefined ? ['AvailableGames.infinite'] : ['AvailableGames.infinite', variables]; -; + TData = AvailableGamesQuery, + TError = unknown, +>( + variables?: AvailableGamesQueryVariables, + options?: UseInfiniteQueryOptions, +) => { + const query = useFetchData( + AvailableGamesDocument, + ); + return useInfiniteQuery( + variables === undefined + ? ["AvailableGames.infinite"] + : ["AvailableGames.infinite", variables], + (metaData) => query({ ...variables, ...(metaData.pageParam ?? {}) }), + options, + ); +}; +useInfiniteAvailableGamesQuery.getKey = ( + variables?: AvailableGamesQueryVariables, +) => + variables === undefined + ? ["AvailableGames.infinite"] + : ["AvailableGames.infinite", variables]; export const GlobalScoresDocument = ` query GlobalScores($limit: Int, $cursor: Cursor) { playerComponents(first: $limit, after: $cursor, where: {turns_remaining: 0}) { @@ -820,39 +962,47 @@ export const GlobalScoresDocument = ` } `; export const useGlobalScoresQuery = < - TData = GlobalScoresQuery, - TError = unknown - >( - variables?: GlobalScoresQueryVariables, - options?: UseQueryOptions - ) => - useQuery( - variables === undefined ? ['GlobalScores'] : ['GlobalScores', variables], - useFetchData(GlobalScoresDocument).bind(null, variables), - options - ); - -useGlobalScoresQuery.getKey = (variables?: GlobalScoresQueryVariables) => variables === undefined ? ['GlobalScores'] : ['GlobalScores', variables]; -; - + TData = GlobalScoresQuery, + TError = unknown, +>( + variables?: GlobalScoresQueryVariables, + options?: UseQueryOptions, +) => + useQuery( + variables === undefined ? ["GlobalScores"] : ["GlobalScores", variables], + useFetchData( + GlobalScoresDocument, + ).bind(null, variables), + options, + ); + +useGlobalScoresQuery.getKey = (variables?: GlobalScoresQueryVariables) => + variables === undefined ? ["GlobalScores"] : ["GlobalScores", variables]; export const useInfiniteGlobalScoresQuery = < - TData = GlobalScoresQuery, - TError = unknown - >( - variables?: GlobalScoresQueryVariables, - options?: UseInfiniteQueryOptions - ) =>{ - const query = useFetchData(GlobalScoresDocument) - return useInfiniteQuery( - variables === undefined ? ['GlobalScores.infinite'] : ['GlobalScores.infinite', variables], - (metaData) => query({...variables, ...(metaData.pageParam ?? {})}), - options - )}; - - -useInfiniteGlobalScoresQuery.getKey = (variables?: GlobalScoresQueryVariables) => variables === undefined ? ['GlobalScores.infinite'] : ['GlobalScores.infinite', variables]; -; + TData = GlobalScoresQuery, + TError = unknown, +>( + variables?: GlobalScoresQueryVariables, + options?: UseInfiniteQueryOptions, +) => { + const query = useFetchData( + GlobalScoresDocument, + ); + return useInfiniteQuery( + variables === undefined + ? ["GlobalScores.infinite"] + : ["GlobalScores.infinite", variables], + (metaData) => query({ ...variables, ...(metaData.pageParam ?? {}) }), + options, + ); +}; +useInfiniteGlobalScoresQuery.getKey = ( + variables?: GlobalScoresQueryVariables, +) => + variables === undefined + ? ["GlobalScores.infinite"] + : ["GlobalScores.infinite", variables]; export const MarketPricesDocument = ` query MarketPrices($gameId: Int) { marketComponents(first: 36, where: {game_id: $gameId}) { @@ -868,39 +1018,47 @@ export const MarketPricesDocument = ` } `; export const useMarketPricesQuery = < - TData = MarketPricesQuery, - TError = unknown - >( - variables?: MarketPricesQueryVariables, - options?: UseQueryOptions - ) => - useQuery( - variables === undefined ? ['MarketPrices'] : ['MarketPrices', variables], - useFetchData(MarketPricesDocument).bind(null, variables), - options - ); - -useMarketPricesQuery.getKey = (variables?: MarketPricesQueryVariables) => variables === undefined ? ['MarketPrices'] : ['MarketPrices', variables]; -; - + TData = MarketPricesQuery, + TError = unknown, +>( + variables?: MarketPricesQueryVariables, + options?: UseQueryOptions, +) => + useQuery( + variables === undefined ? ["MarketPrices"] : ["MarketPrices", variables], + useFetchData( + MarketPricesDocument, + ).bind(null, variables), + options, + ); + +useMarketPricesQuery.getKey = (variables?: MarketPricesQueryVariables) => + variables === undefined ? ["MarketPrices"] : ["MarketPrices", variables]; export const useInfiniteMarketPricesQuery = < - TData = MarketPricesQuery, - TError = unknown - >( - variables?: MarketPricesQueryVariables, - options?: UseInfiniteQueryOptions - ) =>{ - const query = useFetchData(MarketPricesDocument) - return useInfiniteQuery( - variables === undefined ? ['MarketPrices.infinite'] : ['MarketPrices.infinite', variables], - (metaData) => query({...variables, ...(metaData.pageParam ?? {})}), - options - )}; - - -useInfiniteMarketPricesQuery.getKey = (variables?: MarketPricesQueryVariables) => variables === undefined ? ['MarketPrices.infinite'] : ['MarketPrices.infinite', variables]; -; + TData = MarketPricesQuery, + TError = unknown, +>( + variables?: MarketPricesQueryVariables, + options?: UseInfiniteQueryOptions, +) => { + const query = useFetchData( + MarketPricesDocument, + ); + return useInfiniteQuery( + variables === undefined + ? ["MarketPrices.infinite"] + : ["MarketPrices.infinite", variables], + (metaData) => query({ ...variables, ...(metaData.pageParam ?? {}) }), + options, + ); +}; +useInfiniteMarketPricesQuery.getKey = ( + variables?: MarketPricesQueryVariables, +) => + variables === undefined + ? ["MarketPrices.infinite"] + : ["MarketPrices.infinite", variables]; export const GameEntityDocument = ` query GameEntity($id: ID!) { entity(id: $id) { @@ -918,40 +1076,43 @@ export const GameEntityDocument = ` } } `; -export const useGameEntityQuery = < - TData = GameEntityQuery, - TError = unknown - >( - variables: GameEntityQueryVariables, - options?: UseQueryOptions - ) => - useQuery( - ['GameEntity', variables], - useFetchData(GameEntityDocument).bind(null, variables), - options - ); - -useGameEntityQuery.getKey = (variables: GameEntityQueryVariables) => ['GameEntity', variables]; -; - +export const useGameEntityQuery = ( + variables: GameEntityQueryVariables, + options?: UseQueryOptions, +) => + useQuery( + ["GameEntity", variables], + useFetchData( + GameEntityDocument, + ).bind(null, variables), + options, + ); + +useGameEntityQuery.getKey = (variables: GameEntityQueryVariables) => [ + "GameEntity", + variables, +]; export const useInfiniteGameEntityQuery = < - TData = GameEntityQuery, - TError = unknown - >( - variables: GameEntityQueryVariables, - options?: UseInfiniteQueryOptions - ) =>{ - const query = useFetchData(GameEntityDocument) - return useInfiniteQuery( - ['GameEntity.infinite', variables], - (metaData) => query({...variables, ...(metaData.pageParam ?? {})}), - options - )}; - - -useInfiniteGameEntityQuery.getKey = (variables: GameEntityQueryVariables) => ['GameEntity.infinite', variables]; -; + TData = GameEntityQuery, + TError = unknown, +>( + variables: GameEntityQueryVariables, + options?: UseInfiniteQueryOptions, +) => { + const query = useFetchData( + GameEntityDocument, + ); + return useInfiniteQuery( + ["GameEntity.infinite", variables], + (metaData) => query({ ...variables, ...(metaData.pageParam ?? {}) }), + options, + ); +}; +useInfiniteGameEntityQuery.getKey = (variables: GameEntityQueryVariables) => [ + "GameEntity.infinite", + variables, +]; export const PlayerEntityDocument = ` query PlayerEntity($gameId: String!, $playerId: String!) { entities(keys: [$gameId, $playerId]) { @@ -983,39 +1144,44 @@ export const PlayerEntityDocument = ` } `; export const usePlayerEntityQuery = < - TData = PlayerEntityQuery, - TError = unknown - >( - variables: PlayerEntityQueryVariables, - options?: UseQueryOptions - ) => - useQuery( - ['PlayerEntity', variables], - useFetchData(PlayerEntityDocument).bind(null, variables), - options - ); - -usePlayerEntityQuery.getKey = (variables: PlayerEntityQueryVariables) => ['PlayerEntity', variables]; -; - + TData = PlayerEntityQuery, + TError = unknown, +>( + variables: PlayerEntityQueryVariables, + options?: UseQueryOptions, +) => + useQuery( + ["PlayerEntity", variables], + useFetchData( + PlayerEntityDocument, + ).bind(null, variables), + options, + ); + +usePlayerEntityQuery.getKey = (variables: PlayerEntityQueryVariables) => [ + "PlayerEntity", + variables, +]; export const useInfinitePlayerEntityQuery = < - TData = PlayerEntityQuery, - TError = unknown - >( - variables: PlayerEntityQueryVariables, - options?: UseInfiniteQueryOptions - ) =>{ - const query = useFetchData(PlayerEntityDocument) - return useInfiniteQuery( - ['PlayerEntity.infinite', variables], - (metaData) => query({...variables, ...(metaData.pageParam ?? {})}), - options - )}; - - -useInfinitePlayerEntityQuery.getKey = (variables: PlayerEntityQueryVariables) => ['PlayerEntity.infinite', variables]; -; + TData = PlayerEntityQuery, + TError = unknown, +>( + variables: PlayerEntityQueryVariables, + options?: UseInfiniteQueryOptions, +) => { + const query = useFetchData( + PlayerEntityDocument, + ); + return useInfiniteQuery( + ["PlayerEntity.infinite", variables], + (metaData) => query({ ...variables, ...(metaData.pageParam ?? {}) }), + options, + ); +}; +useInfinitePlayerEntityQuery.getKey = ( + variables: PlayerEntityQueryVariables, +) => ["PlayerEntity.infinite", variables]; export const LocationEntitiesDocument = ` query LocationEntities($gameId: String!, $locationId: String!) { entities(keys: [$gameId, $locationId]) { @@ -1040,35 +1206,41 @@ export const LocationEntitiesDocument = ` } `; export const useLocationEntitiesQuery = < - TData = LocationEntitiesQuery, - TError = unknown - >( - variables: LocationEntitiesQueryVariables, - options?: UseQueryOptions - ) => - useQuery( - ['LocationEntities', variables], - useFetchData(LocationEntitiesDocument).bind(null, variables), - options - ); - -useLocationEntitiesQuery.getKey = (variables: LocationEntitiesQueryVariables) => ['LocationEntities', variables]; -; - + TData = LocationEntitiesQuery, + TError = unknown, +>( + variables: LocationEntitiesQueryVariables, + options?: UseQueryOptions, +) => + useQuery( + ["LocationEntities", variables], + useFetchData( + LocationEntitiesDocument, + ).bind(null, variables), + options, + ); + +useLocationEntitiesQuery.getKey = ( + variables: LocationEntitiesQueryVariables, +) => ["LocationEntities", variables]; export const useInfiniteLocationEntitiesQuery = < - TData = LocationEntitiesQuery, - TError = unknown - >( - variables: LocationEntitiesQueryVariables, - options?: UseInfiniteQueryOptions - ) =>{ - const query = useFetchData(LocationEntitiesDocument) - return useInfiniteQuery( - ['LocationEntities.infinite', variables], - (metaData) => query({...variables, ...(metaData.pageParam ?? {})}), - options - )}; - - -useInfiniteLocationEntitiesQuery.getKey = (variables: LocationEntitiesQueryVariables) => ['LocationEntities.infinite', variables]; -; + TData = LocationEntitiesQuery, + TError = unknown, +>( + variables: LocationEntitiesQueryVariables, + options?: UseInfiniteQueryOptions, +) => { + const query = useFetchData< + LocationEntitiesQuery, + LocationEntitiesQueryVariables + >(LocationEntitiesDocument); + return useInfiniteQuery( + ["LocationEntities.infinite", variables], + (metaData) => query({ ...variables, ...(metaData.pageParam ?? {}) }), + options, + ); +}; + +useInfiniteLocationEntitiesQuery.getKey = ( + variables: LocationEntitiesQueryVariables, +) => ["LocationEntities.infinite", variables]; diff --git a/web/src/generated/introspection.ts b/web/src/generated/introspection.ts index 5cd553c8b..69f089f8e 100644 --- a/web/src/generated/introspection.ts +++ b/web/src/generated/introspection.ts @@ -1,20 +1,11 @@ - - export interface PossibleTypesResultData { - possibleTypes: { - [key: string]: string[] - } - } - const result: PossibleTypesResultData = { - "possibleTypes": { - "ComponentUnion": [ - "Drug", - "Game", - "Market", - "Name", - "Player", - "Risks" - ] - } +export interface PossibleTypesResultData { + possibleTypes: { + [key: string]: string[]; + }; +} +const result: PossibleTypesResultData = { + possibleTypes: { + ComponentUnion: ["Drug", "Game", "Market", "Name", "Player", "Risks"], + }, }; - export default result; - \ No newline at end of file +export default result; diff --git a/web/src/graphql/components.graphql b/web/src/graphql/components.graphql index 88d854fe0..5fc019723 100644 --- a/web/src/graphql/components.graphql +++ b/web/src/graphql/components.graphql @@ -19,8 +19,8 @@ query GlobalScores($limit: Int, $cursor: Cursor) { first: $limit after: $cursor where: { turns_remaining: 0 } - # order: { direction: DESC, field: CASH } - ) { + ) # order: { direction: DESC, field: CASH } + { totalCount edges { node { diff --git a/web/src/hooks/media.tsx b/web/src/hooks/media.tsx index 91719ee07..a3a97f5d8 100644 --- a/web/src/hooks/media.tsx +++ b/web/src/hooks/media.tsx @@ -53,7 +53,6 @@ export const initMediaStore = async () => { ...state, isInitialized: true, })); - }; export const play = () => { diff --git a/web/src/pages/[gameId]/end.tsx b/web/src/pages/[gameId]/end.tsx index 6e1aba385..79b906f25 100644 --- a/web/src/pages/[gameId]/end.tsx +++ b/web/src/pages/[gameId]/end.tsx @@ -186,24 +186,20 @@ export default function End() { Max 31 characters -