diff --git a/apps/demo-game/next.config.js b/apps/demo-game/next.config.js index d9b273ca..33dea30c 100644 --- a/apps/demo-game/next.config.js +++ b/apps/demo-game/next.config.js @@ -9,7 +9,7 @@ const nextConfig = { eslint: { ignoreDuringBuilds: true, }, - // transpilePackages: ['@gbl-uzh/ui'], + transpilePackages: ['@gbl-uzh/ui'], } module.exports = nextConfig diff --git a/apps/demo-game/package.json b/apps/demo-game/package.json index 45ac3327..8d2ae38f 100644 --- a/apps/demo-game/package.json +++ b/apps/demo-game/package.json @@ -5,17 +5,17 @@ "license": "AGPL-3.0", "dependencies": { "@apollo/client": "3.11.1", - "@fortawesome/fontawesome-svg-core": "6.4.2", - "@fortawesome/free-regular-svg-icons": "6.4.2", - "@fortawesome/free-solid-svg-icons": "6.4.2", - "@fortawesome/react-fontawesome": "0.2.0", + "@fortawesome/fontawesome-svg-core": "6.6.0", + "@fortawesome/free-regular-svg-icons": "6.6.0", + "@fortawesome/free-solid-svg-icons": "6.6.0", + "@fortawesome/react-fontawesome": "0.2.2", "@gbl-uzh/platform": "workspace:*", "@gbl-uzh/ui": "workspace:*", "@next-auth/prisma-adapter": "1.0.7", "@prisma/client": "5.17.0", - "@uzh-bf/design-system": "2.13.3", + "@uzh-bf/design-system": "3.0.0-alpha.13", "date-fns": "2.30.0", - "formik": "2.4.3", + "formik": "2.4.6", "graphql": "16.9.0", "graphql-sse": "2.2.3", "graphql-yoga": "4.0.4", @@ -29,14 +29,18 @@ "nookies": "2.5.2", "prisma": "5.17.0", "ramda": "0.29.0", - "react": "18.2.0", + "react": "18.3.1", "react-dice-complete": "2.2.0", - "react-dom": "18.2.0", + "react-dom": "18.3.1", "react-i18next": "12.3.1", "recharts": "2.8.0", - "tailwind-merge": "1.14.0", + "tailwind-merge": "2.4.0", "ts-pattern": "5.0.5", - "yup": "1.2.0" + "yup": "1.2.0", + "class-variance-authority": "0.7.0", + "clsx": "2.1.1", + "dayjs": "1.11.12", + "lucide-react": "0.424.0" }, "devDependencies": { "@graphql-codegen/cli": "5.0.0", @@ -56,14 +60,17 @@ "eslint-config-next": "14.2.5", "jest": "29.6.4", "npm-run-all": "4.1.5", - "postcss": "8.4.39", + "postcss": "8.4.41", "prettier": "2.8.8", "prettier-plugin-organize-imports": "3.2.3", "prettier-plugin-tailwindcss": "0.4.1", - "tailwindcss": "3.4.4", + "tailwindcss": "3.4.7", "ts-jest": "29.1.1", "tsx": "4.11.2", - "typescript": "5.5.4" + "typescript": "5.5.4", + "postcss-import": "16.1.0", + "tailwindcss-animate": "^1.0.7", + "tailwindcss-radix": "^3.0.0" }, "scripts": { "build": "run-s prisma:copy prisma:generate build:nexus build:graphql build:next", diff --git a/apps/demo-game/prisma/schema.prisma b/apps/demo-game/prisma/schema.prisma index dd94a521..2cd66a7c 100644 --- a/apps/demo-game/prisma/schema.prisma +++ b/apps/demo-game/prisma/schema.prisma @@ -183,9 +183,6 @@ model Player { number Int @default(-1) name String @default("Anonymous") - avatar String @default("") - location String @default("") - color String @default("White") isReady Boolean @default(false) experience Int @default(0) diff --git a/apps/demo-game/public/avatars/avatar_placeholder.png b/apps/demo-game/public/avatars/avatar_placeholder.png new file mode 100644 index 00000000..3ea42b34 Binary files /dev/null and b/apps/demo-game/public/avatars/avatar_placeholder.png differ diff --git a/apps/demo-game/public/locations/AG.svg b/apps/demo-game/public/locations/AG.svg new file mode 100644 index 00000000..409a5fa9 --- /dev/null +++ b/apps/demo-game/public/locations/AG.svg @@ -0,0 +1,15 @@ + + +Wappen Aargau + + + + + + + + + + + + diff --git a/apps/demo-game/public/locations/AI.svg b/apps/demo-game/public/locations/AI.svg new file mode 100644 index 00000000..c13d2c79 --- /dev/null +++ b/apps/demo-game/public/locations/AI.svg @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/demo-game/public/locations/BE.svg b/apps/demo-game/public/locations/BE.svg new file mode 100644 index 00000000..0bd16447 --- /dev/null +++ b/apps/demo-game/public/locations/BE.svg @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/demo-game/public/locations/FR.svg b/apps/demo-game/public/locations/FR.svg new file mode 100644 index 00000000..888aae70 --- /dev/null +++ b/apps/demo-game/public/locations/FR.svg @@ -0,0 +1,4 @@ + + + + diff --git a/apps/demo-game/public/locations/GR.svg b/apps/demo-game/public/locations/GR.svg new file mode 100644 index 00000000..957574f8 --- /dev/null +++ b/apps/demo-game/public/locations/GR.svg @@ -0,0 +1,152 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/apps/demo-game/public/locations/JU.svg b/apps/demo-game/public/locations/JU.svg new file mode 100644 index 00000000..7b9e814c --- /dev/null +++ b/apps/demo-game/public/locations/JU.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/demo-game/public/locations/TI.svg b/apps/demo-game/public/locations/TI.svg new file mode 100644 index 00000000..1aad7519 --- /dev/null +++ b/apps/demo-game/public/locations/TI.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/demo-game/public/locations/ZH.svg b/apps/demo-game/public/locations/ZH.svg new file mode 100644 index 00000000..bd85f645 --- /dev/null +++ b/apps/demo-game/public/locations/ZH.svg @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/apps/demo-game/src/components/Dice.tsx b/apps/demo-game/src/components/Dice.tsx deleted file mode 100644 index acfd6a88..00000000 --- a/apps/demo-game/src/components/Dice.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { useEffect, useRef } from 'react' -import ReactDice from 'react-dice-complete' - -import 'react-dice-complete/dist/react-dice-complete.css' - -function Dice({ dice1, dice2 }) { - const dice = useRef() - - useEffect(() => { - if (dice?.current) { - dice.current.rollAll([dice1, dice2]) - } - }, [dice, dice1, dice2]) - - return ( -
- null} - /> -
- ) -} - -export default Dice diff --git a/apps/demo-game/src/components/PlayerCompact.tsx b/apps/demo-game/src/components/PlayerCompact.tsx index 9d346ec2..bdaf4d12 100644 --- a/apps/demo-game/src/components/PlayerCompact.tsx +++ b/apps/demo-game/src/components/PlayerCompact.tsx @@ -5,26 +5,34 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import Link from 'next/link' +// TODO(JJ): +// Move this to ui package when checking with RS, also about Link in ui function PlayerCompact({ player }: { player: Player }) { return ( -
- -
- {player.isReady ? ( - - ) : ( - - )} +
+
+
{player.name}
+ +
+
+
+
{player.role}
+ + Login + +
+
+ {player.isReady ? ( + + ) : ( + + )} +
-
{player.role}
-
{player.name}
- - Login -
) } diff --git a/apps/demo-game/src/components/PlayerData.tsx b/apps/demo-game/src/components/PlayerData.tsx index 098e4ed9..7bc4a82e 100644 --- a/apps/demo-game/src/components/PlayerData.tsx +++ b/apps/demo-game/src/components/PlayerData.tsx @@ -1,5 +1,5 @@ import { useRouter } from 'next/router' -import { Achievement, Player } from 'src/graphql/generated/ops' +import { Player } from 'src/graphql/generated/ops' function Achievement({ name, diff --git a/apps/demo-game/src/components/TransactionsDisplay.tsx b/apps/demo-game/src/components/TransactionsDisplay.tsx new file mode 100644 index 00000000..4f1ffbe2 --- /dev/null +++ b/apps/demo-game/src/components/TransactionsDisplay.tsx @@ -0,0 +1,202 @@ +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, + ScrollArea, + Separator, +} from '@uzh-bf/design-system/dist/future' +import { twMerge } from 'tailwind-merge' + +interface TransactionProps { + periodIx: number + segmentIx: number + type: string + facts: { decision: boolean } +} + +interface TransactionsDisplayProps { + transactions: TransactionProps[] +} + +function TransactionLayout({ + title, + actionTitle, + activeTitle, + icon, + children, + separator = true, +}: { + title?: string + actionTitle?: string + activeTitle?: string + icon?: React.ReactNode + children?: React.ReactNode + separator?: boolean +}) { + return ( +
+
+ {title &&
{title}
} +
+ {actionTitle &&
{actionTitle}
} + {activeTitle &&
{activeTitle}
} + {icon} +
+
+ {separator && } + {children} +
+ ) +} + +function OnOffIcon({ on = false }: { on?: boolean }) { + return ( +
+ ) +} + +function TransactionDisplay({ + transaction, +}: { + transaction: TransactionProps +}) { + return ( +
+ } + /> +
+ ) +} + +function TransactionsDisplay({ transactions }: TransactionsDisplayProps) { + return ( + <> + + + Transaction history + + Here is an overview of all the transactions that have been made. + + + + + + {transactions + .slice(0) + .reverse() + .map((transaction) => { + const key = `transaction-${transaction.periodIx}-${transaction.segmentIx}` + return ( + + ) + })} + + + + + + ) +} + +function TransactionsDisplayCompact({ + transactions, +}: TransactionsDisplayProps) { + const transactionsReduced = transactions.reduce((acc, transaction) => { + const key = `transaction-${transaction.periodIx}-${transaction.segmentIx}` + + if (!acc.hasOwnProperty(key)) { + acc[key] = { + periodIx: transaction.periodIx, + segmentIx: transaction.segmentIx, + transactions: { + [transaction.type]: transaction.facts.decision, + }, + } + } else { + acc[key].transactions[transaction.type] = transaction.facts.decision + } + + return acc + }, {}) + return ( + <> + + + Final decision history + + Here is an overview of the final decisions per segment that have + been made. + + + + + +
+ {Object.keys(transactionsReduced) + .sort() + .reverse() + .map((key) => { + const transaction = transactionsReduced[key] + return ( +
+
+

+
P {transaction.periodIx}
+
S {transaction.segmentIx}
+

+ +
+ {Object.keys(transaction.transactions) + .sort() + .map((type) => { + return ( +
+
+ {type.substring('DECIDE_'.length)} +
+ +
+ ) + })} +
+
+ +
+ ) + })} +
+
+
+
+
+ + ) +} + +export { TransactionDisplay, TransactionsDisplay, TransactionsDisplayCompact } diff --git a/apps/demo-game/src/globals.css b/apps/demo-game/src/globals.css index 96f7ffcd..e43487db 100644 --- a/apps/demo-game/src/globals.css +++ b/apps/demo-game/src/globals.css @@ -1,7 +1,7 @@ @import 'tailwindcss/src/css/preflight.css'; @import 'tailwindcss/base'; -@import '@uzh-bf/design-system/dist/index.esm.css'; +@import '@uzh-bf/design-system/dist/style.css'; @import '@gbl-uzh/ui/dist/style.css'; @import 'tailwindcss/components'; diff --git a/apps/demo-game/src/graphql/generated/nexus-typegen.ts b/apps/demo-game/src/graphql/generated/nexus-typegen.ts index ed210e02..3271dccf 100644 --- a/apps/demo-game/src/graphql/generated/nexus-typegen.ts +++ b/apps/demo-game/src/graphql/generated/nexus-typegen.ts @@ -94,9 +94,11 @@ export interface NexusGenObjects { Game: { // root type activePeriod?: NexusGenRootTypes['Period'] | null; // Period activePeriodIx?: number | null; // Int + activeSegmentIx?: number | null; // Int id: string; // ID! name: string; // String! periods: NexusGenRootTypes['Period'][]; // [Period!]! + playerCount?: number | null; // Int players: NexusGenRootTypes['Player'][]; // [Player!]! status: NexusGenEnums['GameStatus']; // GameStatus! } @@ -136,6 +138,7 @@ export interface NexusGenObjects { id: string; // ID! index: number; // Int! results: NexusGenRootTypes['PlayerResult'][]; // [PlayerResult!]! + segmentCount?: number | null; // Int segments: NexusGenRootTypes['PeriodSegment'][]; // [PeriodSegment!]! } PeriodSegment: { // root type @@ -153,8 +156,6 @@ export interface NexusGenObjects { achievementIds: string[]; // [String!]! achievementKeys: string[]; // [String!]! achievements: NexusGenRootTypes['AchievementInstance'][]; // [AchievementInstance!]! - avatar: string; // String! - color: string; // String! completedLearningElementIds: string[]; // [String!]! completedLearningElements: NexusGenRootTypes['LearningElement'][]; // [LearningElement!]! experience: number; // Int! @@ -164,7 +165,6 @@ export interface NexusGenObjects { isReady: boolean; // Boolean! level: NexusGenRootTypes['PlayerLevel']; // PlayerLevel! levelIx: number; // Int! - location: string; // String! name: string; // String! number: number; // Int! role?: string | null; // String @@ -253,9 +253,11 @@ export interface NexusGenFieldTypes { Game: { // field return type activePeriod: NexusGenRootTypes['Period'] | null; // Period activePeriodIx: number | null; // Int + activeSegmentIx: number | null; // Int id: string; // ID! name: string; // String! periods: NexusGenRootTypes['Period'][]; // [Period!]! + playerCount: number | null; // Int players: NexusGenRootTypes['Player'][]; // [Player!]! status: NexusGenEnums['GameStatus']; // GameStatus! } @@ -310,6 +312,7 @@ export interface NexusGenFieldTypes { id: string; // ID! index: number; // Int! results: NexusGenRootTypes['PlayerResult'][]; // [PlayerResult!]! + segmentCount: number | null; // Int segments: NexusGenRootTypes['PeriodSegment'][]; // [PeriodSegment!]! } PeriodSegment: { // field return type @@ -327,8 +330,6 @@ export interface NexusGenFieldTypes { achievementIds: string[]; // [String!]! achievementKeys: string[]; // [String!]! achievements: NexusGenRootTypes['AchievementInstance'][]; // [AchievementInstance!]! - avatar: string; // String! - color: string; // String! completedLearningElementIds: string[]; // [String!]! completedLearningElements: NexusGenRootTypes['LearningElement'][]; // [LearningElement!]! experience: number; // Int! @@ -338,7 +339,6 @@ export interface NexusGenFieldTypes { isReady: boolean; // Boolean! level: NexusGenRootTypes['PlayerLevel']; // PlayerLevel! levelIx: number; // Int! - location: string; // String! name: string; // String! number: number; // Int! role: string | null; // String @@ -429,9 +429,11 @@ export interface NexusGenFieldTypeNames { Game: { // field return type name activePeriod: 'Period' activePeriodIx: 'Int' + activeSegmentIx: 'Int' id: 'ID' name: 'String' periods: 'Period' + playerCount: 'Int' players: 'Player' status: 'GameStatus' } @@ -486,6 +488,7 @@ export interface NexusGenFieldTypeNames { id: 'ID' index: 'Int' results: 'PlayerResult' + segmentCount: 'Int' segments: 'PeriodSegment' } PeriodSegment: { // field return type name @@ -503,8 +506,6 @@ export interface NexusGenFieldTypeNames { achievementIds: 'String' achievementKeys: 'String' achievements: 'AchievementInstance' - avatar: 'String' - color: 'String' completedLearningElementIds: 'String' completedLearningElements: 'LearningElement' experience: 'Int' @@ -514,7 +515,6 @@ export interface NexusGenFieldTypeNames { isReady: 'Boolean' level: 'PlayerLevel' levelIx: 'Int' - location: 'String' name: 'String' number: 'Int' role: 'String' @@ -630,8 +630,6 @@ export interface NexusGenArgTypes { payload: string; // String! } updatePlayerData: { // args - avatar?: string | null; // String - color?: string | null; // String facts?: string | null; // String name?: string | null; // String } diff --git a/apps/demo-game/src/graphql/generated/ops.ts b/apps/demo-game/src/graphql/generated/ops.ts index 8df63bd6..774f62d5 100644 --- a/apps/demo-game/src/graphql/generated/ops.ts +++ b/apps/demo-game/src/graphql/generated/ops.ts @@ -52,9 +52,11 @@ export type Game = { __typename?: 'Game'; activePeriod?: Maybe; activePeriodIx?: Maybe; + activeSegmentIx?: Maybe; id: Scalars['ID']['output']; name: Scalars['String']['output']; periods: Array; + playerCount?: Maybe; players: Array; status: GameStatus; }; @@ -188,8 +190,6 @@ export type MutationSaveConsolidationDecisionArgs = { export type MutationUpdatePlayerDataArgs = { - avatar?: InputMaybe; - color?: InputMaybe; facts?: InputMaybe; name?: InputMaybe; }; @@ -208,6 +208,7 @@ export type Period = { id: Scalars['ID']['output']; index: Scalars['Int']['output']; results: Array; + segmentCount?: Maybe; segments: Array; }; @@ -249,8 +250,6 @@ export type Player = { achievementIds: Array; achievementKeys: Array; achievements: Array; - avatar: Scalars['String']['output']; - color: Scalars['String']['output']; completedLearningElementIds: Array; completedLearningElements: Array; experience: Scalars['Int']['output']; @@ -260,7 +259,6 @@ export type Player = { isReady: Scalars['Boolean']['output']; level: PlayerLevel; levelIx: Scalars['Int']['output']; - location: Scalars['String']['output']; name: Scalars['String']['output']; number: Scalars['Int']['output']; role?: Maybe; @@ -378,7 +376,7 @@ export enum UserRole { Master = 'MASTER' } -export type GameDataFragment = { __typename?: 'Game', id: string, status: GameStatus, name: string, activePeriodIx?: number | null }; +export type GameDataFragment = { __typename?: 'Game', id: string, status: GameStatus, name: string, activePeriodIx?: number | null, activeSegmentIx?: number | null, playerCount?: number | null }; export type LearningElementDataFragment = { __typename?: 'LearningElement', id: string, title: string, question: string, reward?: any | null, motivation?: string | null, feedback?: string | null }; @@ -386,7 +384,7 @@ export type PeriodDataFragment = { __typename?: 'Period', id: string, index: num export type PlayerActionDataFragment = { __typename?: 'PlayerAction', id: string, periodIx: number, segmentIx?: number | null, type: string, facts?: any | null }; -export type PlayerDataFragment = { __typename?: 'Player', id: string, isReady: boolean, role?: string | null, name: string, avatar: string, location: string, color: string, facts: any, experience: number, experienceToNext: number, achievementKeys: Array, achievements: Array<{ __typename?: 'AchievementInstance', id: number, count: number, achievement: { __typename?: 'Achievement', id: string, name: string, description: string, image?: string | null, reward?: any | null } }>, level: { __typename?: 'PlayerLevel', id: string, index: number } }; +export type PlayerDataFragment = { __typename?: 'Player', id: string, isReady: boolean, role?: string | null, name: string, facts: any, experience: number, experienceToNext: number, achievementKeys: Array, achievements: Array<{ __typename?: 'AchievementInstance', id: number, count: number, achievement: { __typename?: 'Achievement', id: string, name: string, description: string, image?: string | null, reward?: any | null } }>, level: { __typename?: 'PlayerLevel', id: string, index: number } }; export type ResultDataFragment = { __typename?: 'PlayerResult', id: string, type?: PlayerResultType | null, facts?: any | null, period: { __typename?: 'Period', id: string, index: number }, segment?: { __typename?: 'PeriodSegment', id: string, index: number } | null }; @@ -397,14 +395,14 @@ export type ActivateNextPeriodMutationVariables = Exact<{ }>; -export type ActivateNextPeriodMutation = { __typename?: 'Mutation', activateNextPeriod?: { __typename?: 'Game', id: string, status: GameStatus, name: string, activePeriodIx?: number | null, periods: Array<{ __typename?: 'Period', id: string, index: number, activeSegmentIx?: number | null, facts: any, segments: Array<{ __typename?: 'PeriodSegment', id: string, index: number, facts: any }> }> } | null }; +export type ActivateNextPeriodMutation = { __typename?: 'Mutation', activateNextPeriod?: { __typename?: 'Game', id: string, status: GameStatus, name: string, activePeriodIx?: number | null, activeSegmentIx?: number | null, playerCount?: number | null, periods: Array<{ __typename?: 'Period', id: string, index: number, activeSegmentIx?: number | null, facts: any, segments: Array<{ __typename?: 'PeriodSegment', id: string, index: number, facts: any }> }> } | null }; export type ActivateNextSegmentMutationVariables = Exact<{ gameId: Scalars['Int']['input']; }>; -export type ActivateNextSegmentMutation = { __typename?: 'Mutation', activateNextSegment?: { __typename?: 'Game', id: string, status: GameStatus, name: string, activePeriodIx?: number | null, periods: Array<{ __typename?: 'Period', id: string, index: number, activeSegmentIx?: number | null, facts: any, segments: Array<{ __typename?: 'PeriodSegment', id: string, index: number, facts: any }> }>, players: Array<{ __typename?: 'Player', id: string, isReady: boolean, role?: string | null, name: string, avatar: string, location: string, color: string, facts: any, experience: number, experienceToNext: number }> } | null }; +export type ActivateNextSegmentMutation = { __typename?: 'Mutation', activateNextSegment?: { __typename?: 'Game', id: string, status: GameStatus, name: string, activePeriodIx?: number | null, activeSegmentIx?: number | null, playerCount?: number | null, periods: Array<{ __typename?: 'Period', id: string, index: number, activeSegmentIx?: number | null, facts: any, segments: Array<{ __typename?: 'PeriodSegment', id: string, index: number, facts: any }> }>, players: Array<{ __typename?: 'Player', id: string, isReady: boolean, role?: string | null, name: string, facts: any, experience: number, experienceToNext: number }> } | null }; export type AddCountdownMutationVariables = Exact<{ gameId: Scalars['Int']['input']; @@ -447,14 +445,14 @@ export type CreateGameMutationVariables = Exact<{ }>; -export type CreateGameMutation = { __typename?: 'Mutation', createGame?: { __typename?: 'Game', id: string, status: GameStatus, name: string, activePeriodIx?: number | null } | null }; +export type CreateGameMutation = { __typename?: 'Mutation', createGame?: { __typename?: 'Game', id: string, status: GameStatus, name: string, activePeriodIx?: number | null, activeSegmentIx?: number | null, playerCount?: number | null } | null }; export type LoginAsTeamMutationVariables = Exact<{ token: Scalars['String']['input']; }>; -export type LoginAsTeamMutation = { __typename?: 'Mutation', loginAsTeam?: { __typename?: 'Player', id: string, isReady: boolean, role?: string | null, name: string, avatar: string, location: string, color: string, facts: any, experience: number, experienceToNext: number, achievementKeys: Array, achievements: Array<{ __typename?: 'AchievementInstance', id: number, count: number, achievement: { __typename?: 'Achievement', id: string, name: string, description: string, image?: string | null, reward?: any | null } }>, level: { __typename?: 'PlayerLevel', id: string, index: number } } | null }; +export type LoginAsTeamMutation = { __typename?: 'Mutation', loginAsTeam?: { __typename?: 'Player', id: string, isReady: boolean, role?: string | null, name: string, facts: any, experience: number, experienceToNext: number, achievementKeys: Array, achievements: Array<{ __typename?: 'AchievementInstance', id: number, count: number, achievement: { __typename?: 'Achievement', id: string, name: string, description: string, image?: string | null, reward?: any | null } }>, level: { __typename?: 'PlayerLevel', id: string, index: number } } | null }; export type LogoutAsTeamMutationVariables = Exact<{ [key: string]: never; }>; @@ -485,13 +483,11 @@ export type SaveConsolidationDecisionMutation = { __typename?: 'Mutation', saveC export type UpdatePlayerDataMutationVariables = Exact<{ name?: InputMaybe; - avatar?: InputMaybe; - color?: InputMaybe; facts?: InputMaybe; }>; -export type UpdatePlayerDataMutation = { __typename?: 'Mutation', updatePlayerData?: { __typename?: 'Player', id: string, isReady: boolean, role?: string | null, name: string, avatar: string, location: string, color: string, facts: any, experience: number, experienceToNext: number, achievementKeys: Array, achievements: Array<{ __typename?: 'AchievementInstance', id: number, count: number, achievement: { __typename?: 'Achievement', id: string, name: string, description: string, image?: string | null, reward?: any | null } }>, level: { __typename?: 'PlayerLevel', id: string, index: number } } | null }; +export type UpdatePlayerDataMutation = { __typename?: 'Mutation', updatePlayerData?: { __typename?: 'Player', id: string, isReady: boolean, role?: string | null, name: string, facts: any, experience: number, experienceToNext: number, achievementKeys: Array, achievements: Array<{ __typename?: 'AchievementInstance', id: number, count: number, achievement: { __typename?: 'Achievement', id: string, name: string, description: string, image?: string | null, reward?: any | null } }>, level: { __typename?: 'PlayerLevel', id: string, index: number } } | null }; export type UpdateReadyStateMutationVariables = Exact<{ isReady: Scalars['Boolean']['input']; @@ -505,12 +501,12 @@ export type GameQueryVariables = Exact<{ }>; -export type GameQuery = { __typename?: 'Query', game?: { __typename?: 'Game', id: string, status: GameStatus, name: string, activePeriodIx?: number | null, activePeriod?: { __typename?: 'Period', id: string, activeSegmentIx?: number | null, activeSegment?: { __typename?: 'PeriodSegment', id: string, countdownExpiresAt?: any | null } | null, segments: Array<{ __typename?: 'PeriodSegment', id: string }> } | null, periods: Array<{ __typename?: 'Period', id: string, index: number, activeSegmentIx?: number | null, facts: any, segments: Array<{ __typename?: 'PeriodSegment', id: string, index: number, countdownExpiresAt?: any | null, facts: any, learningElements: Array<{ __typename?: 'LearningElement', id: string, title: string }>, storyElements: Array<{ __typename?: 'StoryElement', id: string, title: string }> }> }>, players: Array<{ __typename?: 'Player', id: string, isReady: boolean, role?: string | null, number: number, name: string, avatar: string, location: string, color: string, facts: any, experience: number, experienceToNext: number, token: string }> } | null }; +export type GameQuery = { __typename?: 'Query', game?: { __typename?: 'Game', id: string, status: GameStatus, name: string, activePeriodIx?: number | null, activeSegmentIx?: number | null, playerCount?: number | null, activePeriod?: { __typename?: 'Period', id: string, activeSegmentIx?: number | null, activeSegment?: { __typename?: 'PeriodSegment', id: string, countdownExpiresAt?: any | null } | null, segments: Array<{ __typename?: 'PeriodSegment', id: string }> } | null, periods: Array<{ __typename?: 'Period', id: string, index: number, activeSegmentIx?: number | null, facts: any, segments: Array<{ __typename?: 'PeriodSegment', id: string, index: number, countdownExpiresAt?: any | null, facts: any, learningElements: Array<{ __typename?: 'LearningElement', id: string, title: string }>, storyElements: Array<{ __typename?: 'StoryElement', id: string, title: string }> }> }>, players: Array<{ __typename?: 'Player', id: string, isReady: boolean, role?: string | null, number: number, name: string, facts: any, experience: number, experienceToNext: number, token: string }> } | null }; export type GamesQueryVariables = Exact<{ [key: string]: never; }>; -export type GamesQuery = { __typename?: 'Query', games?: Array<{ __typename?: 'Game', id: string, status: GameStatus, name: string, activePeriodIx?: number | null }> | null }; +export type GamesQuery = { __typename?: 'Query', games?: Array<{ __typename?: 'Game', id: string, status: GameStatus, name: string, activePeriodIx?: number | null, activeSegmentIx?: number | null, playerCount?: number | null }> | null }; export type LearningElementQueryVariables = Exact<{ id: Scalars['ID']['input']; @@ -527,12 +523,12 @@ export type LearningElementsQuery = { __typename?: 'Query', learningElements?: A export type PastResultsQueryVariables = Exact<{ [key: string]: never; }>; -export type PastResultsQuery = { __typename?: 'Query', result?: { __typename?: 'PlayerState', currentGame?: { __typename?: 'Game', id: string, status: GameStatus } | null } | null, pastResults?: Array<{ __typename?: 'PlayerResult', id: string, type?: PlayerResultType | null, facts?: any | null, player: { __typename?: 'Player', id: string, role?: string | null, name: string, avatar: string, location: string, color: string, facts: any, experience: number, experienceToNext: number, completedLearningElementIds: Array, visitedStoryElementIds: Array, level: { __typename?: 'PlayerLevel', id: string, index: number } }, period: { __typename?: 'Period', id: string, index: number, facts: any }, segment?: { __typename?: 'PeriodSegment', id: string, index: number, facts: any } | null }> | null }; +export type PastResultsQuery = { __typename?: 'Query', result?: { __typename?: 'PlayerState', currentGame?: { __typename?: 'Game', id: string, status: GameStatus } | null } | null, pastResults?: Array<{ __typename?: 'PlayerResult', id: string, type?: PlayerResultType | null, facts?: any | null, player: { __typename?: 'Player', id: string, role?: string | null, name: string, facts: any, experience: number, experienceToNext: number, completedLearningElementIds: Array, visitedStoryElementIds: Array, level: { __typename?: 'PlayerLevel', id: string, index: number } }, period: { __typename?: 'Period', id: string, index: number, facts: any }, segment?: { __typename?: 'PeriodSegment', id: string, index: number, facts: any } | null }> | null }; export type ResultQueryVariables = Exact<{ [key: string]: never; }>; -export type ResultQuery = { __typename?: 'Query', result?: { __typename?: 'PlayerState', playerResult?: { __typename?: 'PlayerResult', id: string, type?: PlayerResultType | null, facts?: any | null, player: { __typename?: 'Player', id: string, completedLearningElementIds: Array, visitedStoryElementIds: Array }, period: { __typename?: 'Period', id: string, index: number }, segment?: { __typename?: 'PeriodSegment', id: string, index: number } | null } | null, previousResults?: Array<{ __typename?: 'PlayerResult', id: string, type?: PlayerResultType | null, facts?: any | null, period: { __typename?: 'Period', id: string, index: number }, segment?: { __typename?: 'PeriodSegment', id: string, index: number } | null }> | null, currentGame?: { __typename?: 'Game', id: string, status: GameStatus, periods: Array<{ __typename?: 'Period', id: string, index: number, activeSegmentIx?: number | null, facts: any, segments: Array<{ __typename?: 'PeriodSegment', id: string, index: number, countdownExpiresAt?: any | null, facts: any, learningElements: Array<{ __typename?: 'LearningElement', id: string, title: string }>, storyElements: Array<{ __typename?: 'StoryElement', id: string, title: string }> }> }>, activePeriod?: { __typename?: 'Period', id: string, index: number, activeSegmentIx?: number | null, facts: any, activeSegment?: { __typename?: 'PeriodSegment', id: string, index: number, facts: any, countdownExpiresAt?: any | null, learningElements: Array<{ __typename?: 'LearningElement', id: string, title: string }>, storyElements: Array<{ __typename?: 'StoryElement', id: string, type: StoryElementType, title: string, content?: string | null, contentRole?: any | null }> } | null, segments: Array<{ __typename?: 'PeriodSegment', id: string, index: number, countdownExpiresAt?: any | null, facts: any, learningElements: Array<{ __typename?: 'LearningElement', id: string, title: string }>, storyElements: Array<{ __typename?: 'StoryElement', id: string, title: string }> }> } | null } | null, transactions?: Array<{ __typename?: 'PlayerAction', id: string, periodIx: number, segmentIx?: number | null, type: string, facts?: any | null }> | null } | null, self?: { __typename?: 'Player', id: string, isReady: boolean, role?: string | null, name: string, avatar: string, location: string, color: string, facts: any, experience: number, experienceToNext: number, achievementKeys: Array, achievements: Array<{ __typename?: 'AchievementInstance', id: number, count: number, achievement: { __typename?: 'Achievement', id: string, name: string, description: string, image?: string | null, reward?: any | null } }>, level: { __typename?: 'PlayerLevel', id: string, index: number } } | null }; +export type ResultQuery = { __typename?: 'Query', result?: { __typename?: 'PlayerState', playerResult?: { __typename?: 'PlayerResult', id: string, type?: PlayerResultType | null, facts?: any | null, player: { __typename?: 'Player', id: string, completedLearningElementIds: Array, visitedStoryElementIds: Array }, period: { __typename?: 'Period', id: string, index: number }, segment?: { __typename?: 'PeriodSegment', id: string, index: number } | null } | null, previousResults?: Array<{ __typename?: 'PlayerResult', id: string, type?: PlayerResultType | null, facts?: any | null, period: { __typename?: 'Period', id: string, index: number }, segment?: { __typename?: 'PeriodSegment', id: string, index: number } | null }> | null, currentGame?: { __typename?: 'Game', id: string, status: GameStatus, periods: Array<{ __typename?: 'Period', segmentCount?: number | null, id: string, index: number, activeSegmentIx?: number | null, facts: any, segments: Array<{ __typename?: 'PeriodSegment', id: string, index: number, countdownExpiresAt?: any | null, facts: any, learningElements: Array<{ __typename?: 'LearningElement', id: string, title: string }>, storyElements: Array<{ __typename?: 'StoryElement', id: string, title: string }> }> }>, activePeriod?: { __typename?: 'Period', id: string, index: number, activeSegmentIx?: number | null, facts: any, activeSegment?: { __typename?: 'PeriodSegment', id: string, index: number, facts: any, countdownExpiresAt?: any | null, learningElements: Array<{ __typename?: 'LearningElement', id: string, title: string }>, storyElements: Array<{ __typename?: 'StoryElement', id: string, type: StoryElementType, title: string, content?: string | null, contentRole?: any | null }> } | null, segments: Array<{ __typename?: 'PeriodSegment', id: string, index: number, countdownExpiresAt?: any | null, facts: any, learningElements: Array<{ __typename?: 'LearningElement', id: string, title: string }>, storyElements: Array<{ __typename?: 'StoryElement', id: string, title: string }> }> } | null } | null, transactions?: Array<{ __typename?: 'PlayerAction', id: string, periodIx: number, segmentIx?: number | null, type: string, facts?: any | null }> | null } | null, self?: { __typename?: 'Player', id: string, isReady: boolean, role?: string | null, name: string, facts: any, experience: number, experienceToNext: number, achievementKeys: Array, achievements: Array<{ __typename?: 'AchievementInstance', id: number, count: number, achievement: { __typename?: 'Achievement', id: string, name: string, description: string, image?: string | null, reward?: any | null } }>, level: { __typename?: 'PlayerLevel', id: string, index: number } } | null }; export type ResultsQueryVariables = Exact<{ [key: string]: never; }>; @@ -542,7 +538,7 @@ export type ResultsQuery = { __typename?: 'Query', results?: Array<{ __typename? export type SelfQueryVariables = Exact<{ [key: string]: never; }>; -export type SelfQuery = { __typename?: 'Query', self?: { __typename?: 'Player', id: string, isReady: boolean, role?: string | null, name: string, avatar: string, location: string, color: string, facts: any, experience: number, experienceToNext: number, achievementKeys: Array, achievements: Array<{ __typename?: 'AchievementInstance', id: number, count: number, achievement: { __typename?: 'Achievement', id: string, name: string, description: string, image?: string | null, reward?: any | null } }>, level: { __typename?: 'PlayerLevel', id: string, index: number } } | null }; +export type SelfQuery = { __typename?: 'Query', self?: { __typename?: 'Player', id: string, isReady: boolean, role?: string | null, name: string, facts: any, experience: number, experienceToNext: number, achievementKeys: Array, achievements: Array<{ __typename?: 'AchievementInstance', id: number, count: number, achievement: { __typename?: 'Achievement', id: string, name: string, description: string, image?: string | null, reward?: any | null } }>, level: { __typename?: 'PlayerLevel', id: string, index: number } } | null }; export type GlobalEventsSubscriptionVariables = Exact<{ [key: string]: never; }>; @@ -726,9 +722,11 @@ export type EventResolvers = { activePeriod?: Resolver, ParentType, ContextType>; activePeriodIx?: Resolver, ParentType, ContextType>; + activeSegmentIx?: Resolver, ParentType, ContextType>; id?: Resolver; name?: Resolver; periods?: Resolver, ParentType, ContextType>; + playerCount?: Resolver, ParentType, ContextType>; players?: Resolver, ParentType, ContextType>; status?: Resolver; __isTypeOf?: IsTypeOfResolverFn; @@ -798,6 +796,7 @@ export type PeriodResolvers; index?: Resolver; results?: Resolver, ParentType, ContextType>; + segmentCount?: Resolver, ParentType, ContextType>; segments?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; @@ -819,8 +818,6 @@ export type PlayerResolvers, ParentType, ContextType>; achievementKeys?: Resolver, ParentType, ContextType>; achievements?: Resolver, ParentType, ContextType>; - avatar?: Resolver; - color?: Resolver; completedLearningElementIds?: Resolver, ParentType, ContextType>; completedLearningElements?: Resolver, ParentType, ContextType>; experience?: Resolver; @@ -830,7 +827,6 @@ export type PlayerResolvers; level?: Resolver; levelIx?: Resolver; - location?: Resolver; name?: Resolver; number?: Resolver; role?: Resolver, ParentType, ContextType>; @@ -941,35 +937,35 @@ export type Resolvers = { }; -export const GameDataFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GameData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Game"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriodIx"}}]}}]} as unknown as DocumentNode; +export const GameDataFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GameData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Game"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriodIx"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"playerCount"}}]}}]} as unknown as DocumentNode; export const LearningElementDataFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LearningElementData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LearningElement"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"question"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}},{"kind":"Field","name":{"kind":"Name","value":"motivation"}},{"kind":"Field","name":{"kind":"Name","value":"feedback"}}]}}]} as unknown as DocumentNode; export const SegmentDataFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SegmentData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PeriodSegment"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"countdownExpiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"learningElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"storyElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]} as unknown as DocumentNode; export const PeriodDataFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PeriodData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Period"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"segments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SegmentData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SegmentData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PeriodSegment"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"countdownExpiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"learningElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"storyElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]} as unknown as DocumentNode; export const PlayerActionDataFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerActionData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PlayerAction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"periodIx"}},{"kind":"Field","name":{"kind":"Name","value":"segmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}}]}}]} as unknown as DocumentNode; -export const PlayerDataFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Player"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"achievementKeys"}},{"kind":"Field","name":{"kind":"Name","value":"achievements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"achievement"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"level"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; +export const PlayerDataFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Player"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"achievementKeys"}},{"kind":"Field","name":{"kind":"Name","value":"achievements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"achievement"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"level"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; export const ResultDataFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ResultData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PlayerResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"period"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"segment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; -export const ActivateNextPeriodDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ActivateNextPeriod"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activateNextPeriod"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gameId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GameData"}},{"kind":"Field","name":{"kind":"Name","value":"periods"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"segments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GameData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Game"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriodIx"}}]}}]} as unknown as DocumentNode; -export const ActivateNextSegmentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ActivateNextSegment"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activateNextSegment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gameId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GameData"}},{"kind":"Field","name":{"kind":"Name","value":"periods"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"segments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"players"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GameData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Game"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriodIx"}}]}}]} as unknown as DocumentNode; +export const ActivateNextPeriodDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ActivateNextPeriod"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activateNextPeriod"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gameId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GameData"}},{"kind":"Field","name":{"kind":"Name","value":"periods"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"segments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GameData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Game"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriodIx"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"playerCount"}}]}}]} as unknown as DocumentNode; +export const ActivateNextSegmentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ActivateNextSegment"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activateNextSegment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gameId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GameData"}},{"kind":"Field","name":{"kind":"Name","value":"periods"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"segments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"players"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GameData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Game"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriodIx"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"playerCount"}}]}}]} as unknown as DocumentNode; export const AddCountdownDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AddCountdown"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"seconds"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"addCountdown"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gameId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}}},{"kind":"Argument","name":{"kind":"Name","value":"seconds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"seconds"}}}]}]}}]} as unknown as DocumentNode; export const AddGamePeriodDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AddGamePeriod"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"facts"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"PeriodFactsInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"addGamePeriod"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gameId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}}},{"kind":"Argument","name":{"kind":"Name","value":"facts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"facts"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PeriodData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SegmentData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PeriodSegment"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"countdownExpiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"learningElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"storyElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PeriodData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Period"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"segments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SegmentData"}}]}}]}}]} as unknown as DocumentNode; export const AddPeriodSegmentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AddPeriodSegment"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"periodIx"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"facts"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"PeriodSegmentFactsInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"storyElements"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"learningElements"}},"type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"addPeriodSegment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"gameId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"gameId"}}},{"kind":"Argument","name":{"kind":"Name","value":"periodIx"},"value":{"kind":"Variable","name":{"kind":"Name","value":"periodIx"}}},{"kind":"Argument","name":{"kind":"Name","value":"facts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"facts"}}},{"kind":"Argument","name":{"kind":"Name","value":"storyElements"},"value":{"kind":"Variable","name":{"kind":"Name","value":"storyElements"}}},{"kind":"Argument","name":{"kind":"Name","value":"learningElements"},"value":{"kind":"Variable","name":{"kind":"Name","value":"learningElements"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SegmentData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SegmentData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PeriodSegment"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"countdownExpiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"learningElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"storyElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}}]} as unknown as DocumentNode; export const AttemptLearningElementDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AttemptLearningElement"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"elementId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"selection"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attemptLearningElement"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"elementId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"elementId"}}},{"kind":"Argument","name":{"kind":"Name","value":"selection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"selection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"pointsAchieved"}},{"kind":"Field","name":{"kind":"Name","value":"pointsMax"}},{"kind":"Field","name":{"kind":"Name","value":"element"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"feedback"}}]}},{"kind":"Field","name":{"kind":"Name","value":"player"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"completedLearningElementIds"}}]}}]}}]}}]} as unknown as DocumentNode; -export const CreateGameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateGame"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"playerCount"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createGame"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"playerCount"},"value":{"kind":"Variable","name":{"kind":"Name","value":"playerCount"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GameData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GameData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Game"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriodIx"}}]}}]} as unknown as DocumentNode; -export const LoginAsTeamDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"LoginAsTeam"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"token"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"loginAsTeam"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"token"},"value":{"kind":"Variable","name":{"kind":"Name","value":"token"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PlayerData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Player"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"achievementKeys"}},{"kind":"Field","name":{"kind":"Name","value":"achievements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"achievement"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"level"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; +export const CreateGameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateGame"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"playerCount"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createGame"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"playerCount"},"value":{"kind":"Variable","name":{"kind":"Name","value":"playerCount"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GameData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GameData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Game"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriodIx"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"playerCount"}}]}}]} as unknown as DocumentNode; +export const LoginAsTeamDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"LoginAsTeam"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"token"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"loginAsTeam"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"token"},"value":{"kind":"Variable","name":{"kind":"Name","value":"token"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PlayerData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Player"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"achievementKeys"}},{"kind":"Field","name":{"kind":"Name","value":"achievements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"achievement"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"level"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; export const LogoutAsTeamDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"LogoutAsTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"logoutAsTeam"}}]}}]} as unknown as DocumentNode; export const MarkStoryElementDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"MarkStoryElement"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"elementId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"markStoryElement"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"elementId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"elementId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"visitedStoryElementIds"}}]}}]}}]} as unknown as DocumentNode; export const PerformActionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"PerformAction"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"type"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"payload"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"performAction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"type"},"value":{"kind":"Variable","name":{"kind":"Name","value":"type"}}},{"kind":"Argument","name":{"kind":"Name","value":"payload"},"value":{"kind":"Variable","name":{"kind":"Name","value":"payload"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ResultData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ResultData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PlayerResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"period"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"segment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; export const SaveConsolidationDecisionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SaveConsolidationDecision"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"payload"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"saveConsolidationDecision"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"payload"},"value":{"kind":"Variable","name":{"kind":"Name","value":"payload"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}}]}}]}}]} as unknown as DocumentNode; -export const UpdatePlayerDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdatePlayerData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"avatar"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"color"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"facts"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updatePlayerData"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"avatar"},"value":{"kind":"Variable","name":{"kind":"Name","value":"avatar"}}},{"kind":"Argument","name":{"kind":"Name","value":"color"},"value":{"kind":"Variable","name":{"kind":"Name","value":"color"}}},{"kind":"Argument","name":{"kind":"Name","value":"facts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"facts"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PlayerData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Player"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"achievementKeys"}},{"kind":"Field","name":{"kind":"Name","value":"achievements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"achievement"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"level"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; +export const UpdatePlayerDataDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdatePlayerData"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"facts"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updatePlayerData"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"facts"},"value":{"kind":"Variable","name":{"kind":"Name","value":"facts"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PlayerData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Player"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"achievementKeys"}},{"kind":"Field","name":{"kind":"Name","value":"achievements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"achievement"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"level"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; export const UpdateReadyStateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateReadyState"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"isReady"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateReadyState"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"isReady"},"value":{"kind":"Variable","name":{"kind":"Name","value":"isReady"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}}]}}]}}]} as unknown as DocumentNode; -export const GameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Game"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"game"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GameData"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriod"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"countdownExpiresAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"segments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"periods"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PeriodData"}}]}},{"kind":"Field","name":{"kind":"Name","value":"players"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"number"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"token"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SegmentData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PeriodSegment"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"countdownExpiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"learningElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"storyElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GameData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Game"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriodIx"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PeriodData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Period"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"segments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SegmentData"}}]}}]}}]} as unknown as DocumentNode; -export const GamesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Games"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"games"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GameData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GameData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Game"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriodIx"}}]}}]} as unknown as DocumentNode; +export const GameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Game"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"game"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GameData"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriod"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"countdownExpiresAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"segments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"periods"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PeriodData"}}]}},{"kind":"Field","name":{"kind":"Name","value":"players"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"number"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"token"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SegmentData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PeriodSegment"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"countdownExpiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"learningElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"storyElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GameData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Game"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriodIx"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"playerCount"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PeriodData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Period"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"segments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SegmentData"}}]}}]}}]} as unknown as DocumentNode; +export const GamesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Games"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"games"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GameData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GameData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Game"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"activePeriodIx"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"playerCount"}}]}}]} as unknown as DocumentNode; export const LearningElementDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"LearningElement"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"learningElement"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"element"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"LearningElementData"}},{"kind":"Field","name":{"kind":"Name","value":"options"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"content"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"solution"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LearningElementData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LearningElement"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"question"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}},{"kind":"Field","name":{"kind":"Name","value":"motivation"}},{"kind":"Field","name":{"kind":"Name","value":"feedback"}}]}}]} as unknown as DocumentNode; export const LearningElementsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"LearningElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"learningElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"LearningElementData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LearningElementData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LearningElement"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"question"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}},{"kind":"Field","name":{"kind":"Name","value":"motivation"}},{"kind":"Field","name":{"kind":"Name","value":"feedback"}}]}}]} as unknown as DocumentNode; -export const PastResultsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PastResults"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"result"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentGame"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pastResults"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ResultData"}},{"kind":"Field","name":{"kind":"Name","value":"player"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"level"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"completedLearningElementIds"}},{"kind":"Field","name":{"kind":"Name","value":"visitedStoryElementIds"}}]}},{"kind":"Field","name":{"kind":"Name","value":"period"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}}]}},{"kind":"Field","name":{"kind":"Name","value":"segment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ResultData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PlayerResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"period"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"segment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; -export const ResultDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Result"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"result"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"playerResult"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ResultData"}},{"kind":"Field","name":{"kind":"Name","value":"player"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"completedLearningElementIds"}},{"kind":"Field","name":{"kind":"Name","value":"visitedStoryElementIds"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"previousResults"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ResultData"}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentGame"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"periods"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PeriodData"}}]}},{"kind":"Field","name":{"kind":"Name","value":"activePeriod"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PeriodData"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"countdownExpiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"learningElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"storyElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"contentRole"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"transactions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PlayerActionData"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"self"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PlayerData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SegmentData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PeriodSegment"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"countdownExpiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"learningElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"storyElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ResultData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PlayerResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"period"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"segment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PeriodData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Period"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"segments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SegmentData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerActionData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PlayerAction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"periodIx"}},{"kind":"Field","name":{"kind":"Name","value":"segmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Player"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"achievementKeys"}},{"kind":"Field","name":{"kind":"Name","value":"achievements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"achievement"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"level"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; +export const PastResultsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PastResults"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"result"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentGame"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pastResults"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ResultData"}},{"kind":"Field","name":{"kind":"Name","value":"player"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"level"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"completedLearningElementIds"}},{"kind":"Field","name":{"kind":"Name","value":"visitedStoryElementIds"}}]}},{"kind":"Field","name":{"kind":"Name","value":"period"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}}]}},{"kind":"Field","name":{"kind":"Name","value":"segment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ResultData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PlayerResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"period"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"segment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; +export const ResultDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Result"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"result"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"playerResult"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ResultData"}},{"kind":"Field","name":{"kind":"Name","value":"player"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"completedLearningElementIds"}},{"kind":"Field","name":{"kind":"Name","value":"visitedStoryElementIds"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"previousResults"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ResultData"}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentGame"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"periods"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PeriodData"}},{"kind":"Field","name":{"kind":"Name","value":"segmentCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"activePeriod"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PeriodData"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"countdownExpiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"learningElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"storyElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"contentRole"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"transactions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PlayerActionData"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"self"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PlayerData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SegmentData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PeriodSegment"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"countdownExpiresAt"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"learningElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"storyElements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ResultData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PlayerResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"period"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"segment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PeriodData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Period"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}},{"kind":"Field","name":{"kind":"Name","value":"activeSegmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"segments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SegmentData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerActionData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PlayerAction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"periodIx"}},{"kind":"Field","name":{"kind":"Name","value":"segmentIx"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Player"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"achievementKeys"}},{"kind":"Field","name":{"kind":"Name","value":"achievements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"achievement"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"level"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; export const ResultsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ResultData"}},{"kind":"Field","name":{"kind":"Name","value":"player"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ResultData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PlayerResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"period"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}},{"kind":"Field","name":{"kind":"Name","value":"segment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; -export const SelfDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Self"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"self"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PlayerData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Player"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"location"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"achievementKeys"}},{"kind":"Field","name":{"kind":"Name","value":"achievements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"achievement"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"level"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; +export const SelfDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Self"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"self"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PlayerData"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PlayerData"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Player"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isReady"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"facts"}},{"kind":"Field","name":{"kind":"Name","value":"experience"}},{"kind":"Field","name":{"kind":"Name","value":"experienceToNext"}},{"kind":"Field","name":{"kind":"Name","value":"achievementKeys"}},{"kind":"Field","name":{"kind":"Name","value":"achievements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"achievement"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"image"}},{"kind":"Field","name":{"kind":"Name","value":"reward"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"level"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"index"}}]}}]}}]} as unknown as DocumentNode; export const GlobalEventsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"GlobalEvents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"eventsGlobal"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]} as unknown as DocumentNode; export const UserEventsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"UserEvents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"eventsUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]} as unknown as DocumentNode; diff --git a/apps/demo-game/src/graphql/generated/schema.graphql b/apps/demo-game/src/graphql/generated/schema.graphql index 5ac27598..55a95e38 100644 --- a/apps/demo-game/src/graphql/generated/schema.graphql +++ b/apps/demo-game/src/graphql/generated/schema.graphql @@ -34,9 +34,11 @@ type Event { type Game { activePeriod: Period activePeriodIx: Int + activeSegmentIx: Int id: ID! name: String! periods: [Period!]! + playerCount: Int players: [Player!]! status: GameStatus! } @@ -100,7 +102,7 @@ type Mutation { markStoryElement(elementId: ID!): Player performAction(payload: String!, type: String!): PlayerResult saveConsolidationDecision(payload: String!): PlayerDecision - updatePlayerData(avatar: String, color: String, facts: String, name: String): Player + updatePlayerData(facts: String, name: String): Player updateReadyState(isReady: Boolean!): Player } @@ -112,6 +114,7 @@ type Period { id: ID! index: Int! results: [PlayerResult!]! + segmentCount: Int segments: [PeriodSegment!]! } @@ -151,8 +154,6 @@ type Player { achievementIds: [String!]! achievementKeys: [String!]! achievements: [AchievementInstance!]! - avatar: String! - color: String! completedLearningElementIds: [String!]! completedLearningElements: [LearningElement!]! experience: Int! @@ -162,7 +163,6 @@ type Player { isReady: Boolean! level: PlayerLevel! levelIx: Int! - location: String! name: String! number: Int! role: String diff --git a/apps/demo-game/src/graphql/generated/schema.json b/apps/demo-game/src/graphql/generated/schema.json index 53d44626..85e76819 100644 --- a/apps/demo-game/src/graphql/generated/schema.json +++ b/apps/demo-game/src/graphql/generated/schema.json @@ -281,6 +281,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "activeSegmentIx", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": null, @@ -337,6 +349,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "playerCount", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "players", "description": null, @@ -1267,30 +1291,6 @@ "name": "updatePlayerData", "description": null, "args": [ - { - "name": "avatar", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "color", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "facts", "description": null, @@ -1485,6 +1485,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "segmentCount", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "segments", "description": null, @@ -1945,38 +1957,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "avatar", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "color", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "completedLearningElementIds", "description": null, @@ -2137,22 +2117,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "location", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "name", "description": null, diff --git a/apps/demo-game/src/graphql/index.ts b/apps/demo-game/src/graphql/index.ts index 2f68238f..8fa31eeb 100644 --- a/apps/demo-game/src/graphql/index.ts +++ b/apps/demo-game/src/graphql/index.ts @@ -10,16 +10,23 @@ import { PeriodFactsSchema, PeriodSegmentFactsInput, PeriodSegmentFactsSchema, + PlayerFacts, + PlayerFactsSchema, } from '../types' export * from '@gbl-uzh/platform/dist/nexus' export * from '../types' export const Query = generateBaseQueries() -export const Mutation = generateBaseMutations({ +export const Mutation = generateBaseMutations< + PeriodFacts, + PeriodSegmentFacts, + PlayerFacts +>({ services, schemas: { PeriodFactsSchema, PeriodSegmentFactsSchema, + PlayerFactsSchema, }, inputTypes: { PeriodFactsInput, diff --git a/apps/demo-game/src/lib/constants.ts b/apps/demo-game/src/lib/constants.ts new file mode 100644 index 00000000..9d8e1f2e --- /dev/null +++ b/apps/demo-game/src/lib/constants.ts @@ -0,0 +1,11 @@ +export const LOCATIONS = { + Trader: ['AG', 'AI', 'BE', 'FR', 'GR', 'JU', 'TI', 'ZH'], +} + +export const COLORS = { + Red: 'bg-orange-200', + Green: 'bg-lime-200', + Yellow: 'bg-yellow-200', + Blue: 'bg-blue-200', + White: 'bg-white', +} diff --git a/apps/demo-game/src/pages/admin/games.tsx b/apps/demo-game/src/pages/admin/games.tsx index 606d13c5..34f14075 100644 --- a/apps/demo-game/src/pages/admin/games.tsx +++ b/apps/demo-game/src/pages/admin/games.tsx @@ -62,14 +62,13 @@ function Games() { Logout )} - { - await createGame({ variables }) + await createGame({ variables, refetchQueries: [GamesDocument] }) resetForm() }} > @@ -93,15 +92,37 @@ function Games() { )} - -
- {data.games.map((game) => ( -
- - {game?.name} {game?.activePeriodIx} +
+ {[...data.games].map((game, index, array) => { + return ( + + -
- ))} + ) + })}
) diff --git a/apps/demo-game/src/pages/admin/games/[id].tsx b/apps/demo-game/src/pages/admin/games/[id].tsx index 43bda738..a683ee0c 100644 --- a/apps/demo-game/src/pages/admin/games/[id].tsx +++ b/apps/demo-game/src/pages/admin/games/[id].tsx @@ -39,7 +39,7 @@ function ManageGame() { const [isPeriodModalOpen, setIsPeriodModalOpen] = useState(false) const [isSegmentModalOpen, setIsSegmentModalOpen] = useState(false) - const { data, error, loading, refetch } = useQuery(GameDocument, { + const { data, error, loading } = useQuery(GameDocument, { variables: { id: Number(router.query.id) }, pollInterval: 15000, skip: !router.query.id, @@ -73,18 +73,48 @@ function ManageGame() { } ) + const nextPeriod = () => + activateNextPeriod({ + variables: { + gameId: Number(router.query.id), + }, + refetchQueries: [GameDocument], + }) + + const nextSegment = () => + activateNextSegment({ + variables: { + gameId: Number(router.query.id), + }, + refetchQueries: [GameDocument], + }) + const getButton = useCallback(() => { + const game = data.game + const activePeriod = game?.activePeriod + const segments = activePeriod?.segments + const activeSegmentIx = activePeriod?.activeSegmentIx + const isScheduled = game.status === GameStatus.Scheduled const isResultState = game.status === GameStatus.Results - if (!activePeriod || isScheduled || isResultState) { + + if (!activePeriod) { + return + } + if (isResultState) { return } + if (isScheduled) { + return + } const atLastSegment = activeSegmentIx >= segments.length - 1 if (!atLastSegment) { + const isPaused = game.status === GameStatus.Paused + const isPrepared = game.status === GameStatus.Preparation return ( ) } @@ -97,7 +127,7 @@ function ManageGame() { if (game.status === GameStatus.Consolidation) { return ( ) } @@ -112,10 +142,10 @@ function ManageGame() { return ( ) - }, [data?.game?.status]) + }, [data?.game]) if (loading || !data?.game) { return
loading...
@@ -125,39 +155,14 @@ function ManageGame() { return
{error.message}
} - const game = data.game - const activePeriod = game?.activePeriod - const segments = activePeriod?.segments - const activeSegmentIx = activePeriod?.activeSegmentIx - - const nextPeriod = () => - activateNextPeriod({ - variables: { - gameId: Number(router.query.id), - }, - refetchQueries: [GameDocument], - }) - - const nextSegment = () => - activateNextSegment({ - variables: { - gameId: Number(router.query.id), - }, - refetchQueries: [GameDocument], - }) - - // TODO(JJ): Since it is not refreshing nicely after a new status update of - // period or one of the segments, I am wondering if we should precompute - // the periodsSorted.map and their segments into new arrays -> check with RS - // -> appearantly the pollIntervall can increase the refresh rate - // there is also refetching which refreshes in response to a user action + const game: Game = data.game return (
- {data.game.periods.map((period, ix) => { - const periodStatus = computePeriodStatus(data.game as Game, ix) + {game.periods.map((period, ix) => { + const periodStatus = computePeriodStatus(game, ix) const labels = [ period.facts.spotTradingEnabled && 'S', @@ -216,7 +221,7 @@ function ManageGame() {
{period.segments.map((segment, ix) => { const segmentStatus = computeSegmentStatus( - data.game as Game, + game, period as Period, ix ) @@ -263,86 +268,85 @@ function ManageGame() {
) })} - {!isPeriodCompleted && - (data.game as Game).periods.length - 1 === ix && ( - { - await addPeriodSegment({ - variables: { - gameId: Number(router.query.id), - periodIx: variables.periodIx, - facts: {}, - storyElements: variables.storyElements - ? variables.storyElements.split(',') - : [], - learningElements: variables.learningElements - ? variables.learningElements.split(',') - : [], - }, - }) - resetForm() - }} - > - {(newSegmentForm) => ( - setIsSegmentModalOpen(false)} - trigger={ - - } - title="Add Segment" - onSecondaryAction={ - - } - onPrimaryAction={ - - } - > - - - - )} - - )} + {!isPeriodCompleted && game.periods.length - 1 === ix && ( + { + await addPeriodSegment({ + variables: { + gameId: Number(router.query.id), + periodIx: variables.periodIx, + facts: {}, + storyElements: variables.storyElements + ? variables.storyElements.split(',') + : [], + learningElements: variables.learningElements + ? variables.learningElements.split(',') + : [], + }, + }) + resetForm() + }} + > + {(newSegmentForm) => ( + setIsSegmentModalOpen(false)} + trigger={ + + } + title="Add Segment" + onSecondaryAction={ + + } + onPrimaryAction={ + + } + > + + + + )} + + )}
{ await newPeriodForm.setFieldValue( 'newPeriodIx', - (data.game as Game).periods.length + game.periods.length ) newPeriodForm.handleSubmit() setIsPeriodModalOpen(false) @@ -429,10 +433,10 @@ function ManageGame() {
Players
-
- {data.game.players.map((player, ix) => ( +
+ {game.players.map((player, ix) => (
- +
))}
diff --git a/apps/demo-game/src/pages/index.tsx b/apps/demo-game/src/pages/index.tsx index 4a815289..ddb85229 100644 --- a/apps/demo-game/src/pages/index.tsx +++ b/apps/demo-game/src/pages/index.tsx @@ -1,10 +1,203 @@ -import { Button } from '@gbl-uzh/ui' +// import { useQuery } from '@apollo/client' +import { faStar } from '@fortawesome/free-solid-svg-icons' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { + Layout, + ProbabilityChart, + StorageOverview, + Timeline, + TimelineAdmin, + TimelineEntry, + TradingForm, +} from '@gbl-uzh/ui' +// import { ResultDocument } from 'src/graphql/generated/ops' + +import { useRouter } from 'next/router' export default function Home() { + // const { data, loading, error } = useQuery(ResultDocument, { + // fetchPolicy: 'cache-first', + // }) + + // if (loading) return
Loading...
+ // if (error) return
Error {error.message}
+ // console.log(data) + + const router = useRouter() + const tabs = [ + { name: 'Welcome', href: '/play/welcome' }, + { name: 'Cockpit', href: '/play/cockpit' }, + ] + const playerInfo = { + name: 'playerName', + color: 'Red', + location: 'ZH', + level: 1, + xp: 20, + xpMax: 50, + achievements: [], + imgPathAvatar: '/avatars/avatar_placeholder.png', + imgPathLocation: '/locations/ZH.svg', + onClick: () => { + router.replace('/play/welcome') + }, + } + const storageInfo = { + storageTotal: 3, + storageUsed: 1, + icon: , + // icon: , + } return ( -
- hello world -