@gbl-uzh/platform 0.2.11 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/index.d.ts +11 -9
  2. package/dist/nexus.d.ts +4 -24
  3. package/dist/nexus.js +74 -104
  4. package/dist/ops/FGameData.graphql +7 -0
  5. package/dist/ops/FLearningElementData.graphql +10 -0
  6. package/dist/ops/FPeriodData.graphql +14 -0
  7. package/dist/ops/FPlayerActionData.graphql +9 -0
  8. package/dist/ops/FPlayerData.graphql +36 -0
  9. package/dist/ops/FResultData.graphql +17 -0
  10. package/dist/ops/FSegmentData.graphql +15 -0
  11. package/dist/ops/MActivateNextPeriod.graphql +11 -0
  12. package/dist/ops/MActivateNextSegment.graphql +14 -0
  13. package/dist/ops/MAddGamePeriod.graphql +7 -0
  14. package/dist/ops/MAddPeriodSegment.graphql +19 -0
  15. package/dist/ops/MAttemptLearningElement.graphql +18 -0
  16. package/dist/ops/MCreateGame.graphql +7 -0
  17. package/dist/ops/MLoginAsTeam.graphql +7 -0
  18. package/dist/ops/MMarkStoryElement.graphql +6 -0
  19. package/dist/ops/MPerformAction.graphql +7 -0
  20. package/dist/ops/MSaveConsolidationDecision.graphql +8 -0
  21. package/dist/ops/MUpdatePlayerData.graphql +12 -0
  22. package/dist/ops/MUpdateReadyState.graphql +6 -0
  23. package/dist/ops/QGame.graphql +37 -0
  24. package/dist/ops/QGames.graphql +7 -0
  25. package/dist/ops/QLearningElement.graphql +19 -0
  26. package/dist/ops/QLearningElements.graphql +7 -0
  27. package/dist/ops/QPastResults.graphql +40 -0
  28. package/dist/ops/QResult.graphql +53 -0
  29. package/dist/ops/QResults.graphql +12 -0
  30. package/dist/ops/QSelf.graphql +7 -0
  31. package/dist/ops/SGlobalEvents.graphql +5 -0
  32. package/dist/ops/SUserEvents.graphql +5 -0
  33. package/dist/schema.prisma +1 -1
  34. package/package.json +11 -9
  35. package/dist/generated/ops.d.ts +0 -1555
  36. package/dist/generated/ops.js +0 -168
package/dist/index.d.ts CHANGED
@@ -3,9 +3,6 @@ import { PrismaClient } from '@prisma/client';
3
3
  import { NextPageContext } from 'next';
4
4
  import * as yup from 'yup';
5
5
  import yup__default from 'yup';
6
- import { PlayerDecisionType } from './generated/ops.js';
7
- import 'graphql';
8
- import '@graphql-typed-document-node/core';
9
6
 
10
7
  declare enum UserRole {
11
8
  PLAYER = "PLAYER",
@@ -16,17 +13,17 @@ declare enum LearningElementState {
16
13
  ATTEMPTED = "ATTEMPTED",
17
14
  SOLVED = "SOLVED"
18
15
  }
19
- declare type Notification<NotificationType> = {
16
+ type Notification<NotificationType> = {
20
17
  type: NotificationType;
21
18
  sub?: string;
22
19
  facts?: any;
23
20
  };
24
- declare type Event<EventType> = {
21
+ type Event<EventType> = {
25
22
  type: EventType;
26
23
  sub?: string;
27
24
  facts?: any;
28
25
  };
29
- declare type Output<OutputType, NotificationType, EventType> = {
26
+ type Output<OutputType, NotificationType, EventType> = {
30
27
  type: OutputType;
31
28
  extras?: any;
32
29
  result: any;
@@ -35,7 +32,7 @@ declare type Output<OutputType, NotificationType, EventType> = {
35
32
  actions?: any[];
36
33
  isDirty: boolean;
37
34
  };
38
- declare type Action<ActionType, PayloadType, PrismaType> = {
35
+ type Action<ActionType, PayloadType, PrismaType> = {
39
36
  type: ActionType;
40
37
  payload: PayloadType;
41
38
  ctx?: CtxWithPrisma<PrismaType>;
@@ -130,7 +127,7 @@ declare namespace EventService {
130
127
  };
131
128
  }
132
129
 
133
- declare type Context$1 = CtxWithPrisma<PrismaClient>;
130
+ type Context$1 = CtxWithPrisma<PrismaClient>;
134
131
  interface CreateGameArgs {
135
132
  name: string;
136
133
  playerCount: number;
@@ -288,7 +285,12 @@ declare namespace GameService {
288
285
  };
289
286
  }
290
287
 
291
- declare type Context = CtxWithPrisma<PrismaClient>;
288
+ declare enum PlayerDecisionType {
289
+ Consolidation = "CONSOLIDATION",
290
+ Preparation = "PREPARATION"
291
+ }
292
+
293
+ type Context = CtxWithPrisma<PrismaClient>;
292
294
  interface PerformActionArgs<ActionTypes> {
293
295
  gameId: number;
294
296
  periodIx: number;
package/dist/nexus.d.ts CHANGED
@@ -1,26 +1,4 @@
1
1
  import * as nexus_dist_core from 'nexus/dist/core';
2
- import * as yup from 'yup';
3
-
4
- declare const PeriodFactsSchema: yup.ObjectSchema<{
5
- stockTrend: number;
6
- stockVariance: number;
7
- stockGap: number;
8
- }, yup.AnyObject, {
9
- stockTrend: undefined;
10
- stockVariance: undefined;
11
- stockGap: undefined;
12
- }, "">;
13
- interface PeriodFacts extends yup.InferType<typeof PeriodFactsSchema> {
14
- }
15
- declare const PeriodFactsInput: nexus_dist_core.NexusInputObjectTypeDef<"PeriodFactsInput">;
16
- declare const PeriodSegmentFactsSchema: yup.ObjectSchema<{
17
- stockForecast: number | undefined;
18
- }, yup.AnyObject, {
19
- stockForecast: undefined;
20
- }, "">;
21
- interface PeriodSegmentFacts extends yup.InferType<typeof PeriodSegmentFactsSchema> {
22
- }
23
- declare const PeriodSegmentFactsInput: nexus_dist_core.NexusInputObjectTypeDef<"PeriodSegmentFactsInput">;
24
2
 
25
3
  declare const GameStatus: nexus_dist_core.NexusEnumTypeDef<"GameStatus">;
26
4
  declare const Game: nexus_dist_core.NexusObjectTypeDef<"Game">;
@@ -34,9 +12,11 @@ declare const LearningElement: nexus_dist_core.NexusObjectTypeDef<"LearningEleme
34
12
 
35
13
  interface GenerateBaseMutationsArgs {
36
14
  reducers?: any;
15
+ schemas?: any;
16
+ inputTypes?: any;
37
17
  roleAssigner?: (ix: number) => void;
38
18
  }
39
- declare function generateBaseMutations({ reducers, roleAssigner, }?: GenerateBaseMutationsArgs): nexus_dist_core.NexusObjectTypeDef<"Mutation">;
19
+ declare function generateBaseMutations<PeriodFacts, PeriodSegmentFacts>({ reducers, roleAssigner, schemas, inputTypes }?: GenerateBaseMutationsArgs): nexus_dist_core.NexusObjectTypeDef<"Mutation">;
40
20
  declare const Mutation: nexus_dist_core.NexusObjectTypeDef<"Mutation">;
41
21
 
42
22
  declare const PlayerDecisionType: nexus_dist_core.NexusEnumTypeDef<"PlayerDecisionType">;
@@ -59,4 +39,4 @@ declare const DateScalar: nexus_dist_core.AllNexusOutputTypeDefs;
59
39
  declare const UserRole: nexus_dist_core.NexusEnumTypeDef<"UserRole">;
60
40
  declare const Event: nexus_dist_core.NexusObjectTypeDef<"Event">;
61
41
 
62
- export { DateScalar, Event, Game, GameStatus, JsonScalar, LearningAnswerOption, LearningElement, LearningElementAttempt, LearningElementState, Mutation, Period, PeriodFacts, PeriodFactsInput, PeriodFactsSchema, PeriodSegment, PeriodSegmentFacts, PeriodSegmentFactsInput, PeriodSegmentFactsSchema, Player, PlayerAction, PlayerDecision, PlayerDecisionType, PlayerLevel, PlayerResult, PlayerResultType, PlayerState, Query, Subscription, UserRole, generateBaseMutations, generateBaseQueries, generateBaseSubscriptions };
42
+ export { DateScalar, Event, Game, GameStatus, JsonScalar, LearningAnswerOption, LearningElement, LearningElementAttempt, LearningElementState, Mutation, Period, PeriodSegment, Player, PlayerAction, PlayerDecision, PlayerDecisionType, PlayerLevel, PlayerResult, PlayerResultType, PlayerState, Query, Subscription, UserRole, generateBaseMutations, generateBaseQueries, generateBaseSubscriptions };
package/dist/nexus.js CHANGED
@@ -37,11 +37,7 @@ __export(nexus_exports, {
37
37
  LearningElementState: () => LearningElementState,
38
38
  Mutation: () => Mutation,
39
39
  Period: () => Period,
40
- PeriodFactsInput: () => PeriodFactsInput,
41
- PeriodFactsSchema: () => PeriodFactsSchema,
42
40
  PeriodSegment: () => PeriodSegment,
43
- PeriodSegmentFactsInput: () => PeriodSegmentFactsInput,
44
- PeriodSegmentFactsSchema: () => PeriodSegmentFactsSchema,
45
41
  Player: () => Player,
46
42
  PlayerAction: () => PlayerAction,
47
43
  PlayerDecision: () => PlayerDecision,
@@ -60,53 +56,27 @@ __export(nexus_exports, {
60
56
  module.exports = __toCommonJS(nexus_exports);
61
57
  var DB5 = __toESM(require("@prisma/client"));
62
58
  var import_graphql_scalars = require("graphql-scalars");
63
- var import_nexus11 = require("nexus");
64
-
65
- // ../../apps/demo-game/src/graphql/types/Period.ts
66
- var import_nexus = require("nexus");
67
- var yup = __toESM(require("yup"));
68
- var PeriodFactsSchema = yup.object({
69
- stockTrend: yup.number().required(),
70
- stockVariance: yup.number().required(),
71
- stockGap: yup.number().required()
72
- });
73
- var PeriodFactsInput = (0, import_nexus.inputObjectType)({
74
- name: "PeriodFactsInput",
75
- definition(t) {
76
- t.nonNull.float("stockTrend");
77
- t.nonNull.float("stockVariance");
78
- t.nonNull.float("stockGap");
79
- }
80
- });
81
- var PeriodSegmentFactsSchema = yup.object({
82
- stockForecast: yup.number()
83
- });
84
- var PeriodSegmentFactsInput = (0, import_nexus.inputObjectType)({
85
- name: "PeriodSegmentFactsInput",
86
- definition(t) {
87
- t.float("stockForecast");
88
- }
89
- });
59
+ var import_nexus10 = require("nexus");
90
60
 
91
61
  // src/types/Game.ts
92
62
  var DB4 = __toESM(require("@prisma/client"));
93
- var import_nexus6 = require("nexus");
63
+ var import_nexus5 = require("nexus");
94
64
 
95
65
  // src/types/LearningElement.ts
96
- var import_nexus5 = require("nexus");
66
+ var import_nexus4 = require("nexus");
97
67
 
98
68
  // src/types/Player.ts
99
69
  var DB3 = __toESM(require("@prisma/client"));
100
- var import_nexus4 = require("nexus");
70
+ var import_nexus3 = require("nexus");
101
71
 
102
72
  // src/types/Achievement.ts
103
73
  var DB = __toESM(require("@prisma/client"));
104
- var import_nexus2 = require("nexus");
105
- var AchievementFrequency2 = (0, import_nexus2.enumType)({
74
+ var import_nexus = require("nexus");
75
+ var AchievementFrequency2 = (0, import_nexus.enumType)({
106
76
  name: "AchievementFrequency",
107
77
  members: Object.values(DB.AchievementFrequency)
108
78
  });
109
- var Achievement = (0, import_nexus2.objectType)({
79
+ var Achievement = (0, import_nexus.objectType)({
110
80
  name: "Achievement",
111
81
  definition(t) {
112
82
  t.nonNull.id("id");
@@ -121,7 +91,7 @@ var Achievement = (0, import_nexus2.objectType)({
121
91
  });
122
92
  }
123
93
  });
124
- var AchievementInstance = (0, import_nexus2.objectType)({
94
+ var AchievementInstance = (0, import_nexus.objectType)({
125
95
  name: "AchievementInstance",
126
96
  definition(t) {
127
97
  t.nonNull.int("id");
@@ -134,12 +104,12 @@ var AchievementInstance = (0, import_nexus2.objectType)({
134
104
 
135
105
  // src/types/StoryElement.ts
136
106
  var DB2 = __toESM(require("@prisma/client"));
137
- var import_nexus3 = require("nexus");
138
- var StoryElementType2 = (0, import_nexus3.enumType)({
107
+ var import_nexus2 = require("nexus");
108
+ var StoryElementType2 = (0, import_nexus2.enumType)({
139
109
  name: "StoryElementType",
140
110
  members: Object.values(DB2.StoryElementType)
141
111
  });
142
- var StoryElement = (0, import_nexus3.objectType)({
112
+ var StoryElement = (0, import_nexus2.objectType)({
143
113
  name: "StoryElement",
144
114
  definition(t) {
145
115
  t.nonNull.id("id");
@@ -156,15 +126,15 @@ var StoryElement = (0, import_nexus3.objectType)({
156
126
  });
157
127
 
158
128
  // src/types/Player.ts
159
- var PlayerDecisionType2 = (0, import_nexus4.enumType)({
129
+ var PlayerDecisionType2 = (0, import_nexus3.enumType)({
160
130
  name: "PlayerDecisionType",
161
131
  members: Object.values(DB3.PlayerDecisionType)
162
132
  });
163
- var PlayerResultType2 = (0, import_nexus4.enumType)({
133
+ var PlayerResultType2 = (0, import_nexus3.enumType)({
164
134
  name: "PlayerResultType",
165
135
  members: Object.values(DB3.PlayerResultType)
166
136
  });
167
- var PlayerLevel = (0, import_nexus4.objectType)({
137
+ var PlayerLevel = (0, import_nexus3.objectType)({
168
138
  name: "PlayerLevel",
169
139
  definition(t) {
170
140
  t.nonNull.id("id");
@@ -173,7 +143,7 @@ var PlayerLevel = (0, import_nexus4.objectType)({
173
143
  t.nonNull.int("requiredXP");
174
144
  }
175
145
  });
176
- var PlayerState = (0, import_nexus4.objectType)({
146
+ var PlayerState = (0, import_nexus3.objectType)({
177
147
  name: "PlayerState",
178
148
  definition(t) {
179
149
  t.field("playerResult", {
@@ -190,7 +160,7 @@ var PlayerState = (0, import_nexus4.objectType)({
190
160
  });
191
161
  }
192
162
  });
193
- var Player = (0, import_nexus4.objectType)({
163
+ var Player = (0, import_nexus3.objectType)({
194
164
  name: "Player",
195
165
  definition(t) {
196
166
  t.nonNull.id("id");
@@ -226,7 +196,7 @@ var Player = (0, import_nexus4.objectType)({
226
196
  t.nonNull.list.nonNull.int("visitedStoryElementIds");
227
197
  }
228
198
  });
229
- var PlayerResult = (0, import_nexus4.objectType)({
199
+ var PlayerResult = (0, import_nexus3.objectType)({
230
200
  name: "PlayerResult",
231
201
  definition(t) {
232
202
  t.nonNull.id("id");
@@ -247,7 +217,7 @@ var PlayerResult = (0, import_nexus4.objectType)({
247
217
  });
248
218
  }
249
219
  });
250
- var PlayerAction = (0, import_nexus4.objectType)({
220
+ var PlayerAction = (0, import_nexus3.objectType)({
251
221
  name: "PlayerAction",
252
222
  definition(t) {
253
223
  t.nonNull.id("id");
@@ -268,7 +238,7 @@ var PlayerAction = (0, import_nexus4.objectType)({
268
238
  t.int("segmentIx");
269
239
  }
270
240
  });
271
- var PlayerDecision = (0, import_nexus4.objectType)({
241
+ var PlayerDecision = (0, import_nexus3.objectType)({
272
242
  name: "PlayerDecision",
273
243
  definition(t) {
274
244
  t.nonNull.id("id");
@@ -289,7 +259,7 @@ var PlayerDecision = (0, import_nexus4.objectType)({
289
259
  });
290
260
 
291
261
  // src/types/LearningElement.ts
292
- var LearningAnswerOption = (0, import_nexus5.objectType)({
262
+ var LearningAnswerOption = (0, import_nexus4.objectType)({
293
263
  name: "LearningAnswerOption",
294
264
  definition(t) {
295
265
  t.nonNull.id("id");
@@ -297,7 +267,7 @@ var LearningAnswerOption = (0, import_nexus5.objectType)({
297
267
  t.nonNull.boolean("correct");
298
268
  }
299
269
  });
300
- var LearningElementState = (0, import_nexus5.objectType)({
270
+ var LearningElementState = (0, import_nexus4.objectType)({
301
271
  name: "LearningElementState",
302
272
  definition(t) {
303
273
  t.id("id");
@@ -308,7 +278,7 @@ var LearningElementState = (0, import_nexus5.objectType)({
308
278
  t.string("solution");
309
279
  }
310
280
  });
311
- var LearningElementAttempt = (0, import_nexus5.objectType)({
281
+ var LearningElementAttempt = (0, import_nexus4.objectType)({
312
282
  name: "LearningElementAttempt",
313
283
  definition(t) {
314
284
  t.id("id");
@@ -322,7 +292,7 @@ var LearningElementAttempt = (0, import_nexus5.objectType)({
322
292
  });
323
293
  }
324
294
  });
325
- var LearningElement = (0, import_nexus5.objectType)({
295
+ var LearningElement = (0, import_nexus4.objectType)({
326
296
  name: "LearningElement",
327
297
  definition(t) {
328
298
  t.nonNull.id("id");
@@ -340,11 +310,11 @@ var LearningElement = (0, import_nexus5.objectType)({
340
310
  });
341
311
 
342
312
  // src/types/Game.ts
343
- var GameStatus2 = (0, import_nexus6.enumType)({
313
+ var GameStatus2 = (0, import_nexus5.enumType)({
344
314
  name: "GameStatus",
345
315
  members: Object.values(DB4.GameStatus)
346
316
  });
347
- var Game = (0, import_nexus6.objectType)({
317
+ var Game = (0, import_nexus5.objectType)({
348
318
  name: "Game",
349
319
  definition(t) {
350
320
  t.nonNull.id("id");
@@ -364,7 +334,7 @@ var Game = (0, import_nexus6.objectType)({
364
334
  });
365
335
  }
366
336
  });
367
- var Period = (0, import_nexus6.objectType)({
337
+ var Period = (0, import_nexus5.objectType)({
368
338
  name: "Period",
369
339
  definition(t) {
370
340
  t.nonNull.id("id");
@@ -387,7 +357,7 @@ var Period = (0, import_nexus6.objectType)({
387
357
  });
388
358
  }
389
359
  });
390
- var PeriodSegment = (0, import_nexus6.objectType)({
360
+ var PeriodSegment = (0, import_nexus5.objectType)({
391
361
  name: "PeriodSegment",
392
362
  definition(t) {
393
363
  t.nonNull.id("id");
@@ -412,7 +382,7 @@ var PeriodSegment = (0, import_nexus6.objectType)({
412
382
  });
413
383
 
414
384
  // src/types/Mutation.ts
415
- var import_nexus7 = require("nexus");
385
+ var import_nexus6 = require("nexus");
416
386
 
417
387
  // src/generated/ops.ts
418
388
  var 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" } }] } }] };
@@ -525,7 +495,7 @@ var nanoid = (size = 21) => {
525
495
 
526
496
  // src/services/GameService.ts
527
497
  var import_ramda = require("ramda");
528
- var yup2 = __toESM(require("yup"));
498
+ var yup = __toESM(require("yup"));
529
499
 
530
500
  // src/lib/pubsub.ts
531
501
  var import_graphql_yoga = require("graphql-yoga");
@@ -1314,8 +1284,8 @@ async function activateNextSegment({ gameId }, ctx, { reducers }) {
1314
1284
  return null;
1315
1285
  }
1316
1286
  }
1317
- var PlayerFactsSchema = yup2.object({
1318
- location: yup2.string().default("Zurich")
1287
+ var PlayerFactsSchema = yup.object({
1288
+ location: yup.string().default("Zurich")
1319
1289
  });
1320
1290
  async function updatePlayerData({ name, avatar, color, facts }, ctx) {
1321
1291
  if ((0, import_ramda.none)(Boolean, [name, avatar, color, facts])) {
@@ -2216,17 +2186,21 @@ async function updateReadyState(args, ctx) {
2216
2186
 
2217
2187
  // src/types/Mutation.ts
2218
2188
  var defaultReducers = {};
2189
+ var defaultSchemas = {};
2190
+ var defaultInputTypes = {};
2219
2191
  function generateBaseMutations({
2220
2192
  reducers = defaultReducers,
2221
- roleAssigner = () => "UNSET"
2193
+ roleAssigner = () => "UNSET",
2194
+ schemas = defaultSchemas,
2195
+ inputTypes = defaultInputTypes
2222
2196
  } = {}) {
2223
- return (0, import_nexus7.objectType)({
2197
+ return (0, import_nexus6.objectType)({
2224
2198
  name: "Mutation",
2225
2199
  definition(t) {
2226
2200
  t.field("updateReadyState", {
2227
2201
  type: Player,
2228
2202
  args: {
2229
- isReady: (0, import_nexus7.nonNull)((0, import_nexus7.booleanArg)())
2203
+ isReady: (0, import_nexus6.nonNull)((0, import_nexus6.booleanArg)())
2230
2204
  },
2231
2205
  async resolve(_, args, ctx) {
2232
2206
  return updateReadyState(args, ctx);
@@ -2235,7 +2209,7 @@ function generateBaseMutations({
2235
2209
  t.field("loginAsTeam", {
2236
2210
  type: Player,
2237
2211
  args: {
2238
- token: (0, import_nexus7.nonNull)((0, import_nexus7.stringArg)())
2212
+ token: (0, import_nexus6.nonNull)((0, import_nexus6.stringArg)())
2239
2213
  },
2240
2214
  async resolve(_, args, ctx) {
2241
2215
  return loginAsTeam(args, ctx);
@@ -2244,8 +2218,8 @@ function generateBaseMutations({
2244
2218
  t.field("createGame", {
2245
2219
  type: Game,
2246
2220
  args: {
2247
- name: (0, import_nexus7.nonNull)((0, import_nexus7.stringArg)()),
2248
- playerCount: (0, import_nexus7.nonNull)((0, import_nexus7.intArg)())
2221
+ name: (0, import_nexus6.nonNull)((0, import_nexus6.stringArg)()),
2222
+ playerCount: (0, import_nexus6.nonNull)((0, import_nexus6.intArg)())
2249
2223
  },
2250
2224
  async resolve(_, args, ctx) {
2251
2225
  return createGame(args, ctx, {
@@ -2256,14 +2230,14 @@ function generateBaseMutations({
2256
2230
  t.field("addGamePeriod", {
2257
2231
  type: Period,
2258
2232
  args: {
2259
- gameId: (0, import_nexus7.nonNull)((0, import_nexus7.intArg)()),
2260
- facts: (0, import_nexus7.arg)({
2261
- type: (0, import_nexus7.nonNull)(PeriodFactsInput)
2233
+ gameId: (0, import_nexus6.nonNull)((0, import_nexus6.intArg)()),
2234
+ facts: (0, import_nexus6.arg)({
2235
+ type: (0, import_nexus6.nonNull)(inputTypes.PeriodFactsInput)
2262
2236
  })
2263
2237
  },
2264
2238
  async resolve(_, args, ctx) {
2265
2239
  return addGamePeriod(args, ctx, {
2266
- schema: PeriodFactsSchema,
2240
+ schema: schemas.PeriodFactsSchema,
2267
2241
  reducers
2268
2242
  });
2269
2243
  }
@@ -2271,17 +2245,17 @@ function generateBaseMutations({
2271
2245
  t.field("addPeriodSegment", {
2272
2246
  type: PeriodSegment,
2273
2247
  args: {
2274
- gameId: (0, import_nexus7.nonNull)((0, import_nexus7.intArg)()),
2275
- periodIx: (0, import_nexus7.nonNull)((0, import_nexus7.intArg)()),
2276
- facts: (0, import_nexus7.arg)({
2277
- type: (0, import_nexus7.nonNull)(PeriodSegmentFactsInput)
2248
+ gameId: (0, import_nexus6.nonNull)((0, import_nexus6.intArg)()),
2249
+ periodIx: (0, import_nexus6.nonNull)((0, import_nexus6.intArg)()),
2250
+ facts: (0, import_nexus6.arg)({
2251
+ type: (0, import_nexus6.nonNull)(inputTypes.PeriodSegmentFactsInput)
2278
2252
  }),
2279
- storyElements: (0, import_nexus7.list)((0, import_nexus7.stringArg)()),
2280
- learningElements: (0, import_nexus7.list)((0, import_nexus7.stringArg)())
2253
+ storyElements: (0, import_nexus6.list)((0, import_nexus6.stringArg)()),
2254
+ learningElements: (0, import_nexus6.list)((0, import_nexus6.stringArg)())
2281
2255
  },
2282
2256
  async resolve(_, args, ctx) {
2283
2257
  return addPeriodSegment(args, ctx, {
2284
- schema: PeriodSegmentFactsSchema,
2258
+ schema: schemas.PeriodSegmentFactsSchema,
2285
2259
  reducers
2286
2260
  });
2287
2261
  }
@@ -2289,7 +2263,7 @@ function generateBaseMutations({
2289
2263
  t.field("activateNextPeriod", {
2290
2264
  type: Game,
2291
2265
  args: {
2292
- gameId: (0, import_nexus7.nonNull)((0, import_nexus7.intArg)())
2266
+ gameId: (0, import_nexus6.nonNull)((0, import_nexus6.intArg)())
2293
2267
  },
2294
2268
  async resolve(_, args, ctx) {
2295
2269
  const results = await activateNextPeriod(args, ctx, {
@@ -2303,7 +2277,7 @@ function generateBaseMutations({
2303
2277
  t.field("activateNextSegment", {
2304
2278
  type: Game,
2305
2279
  args: {
2306
- gameId: (0, import_nexus7.nonNull)((0, import_nexus7.intArg)())
2280
+ gameId: (0, import_nexus6.nonNull)((0, import_nexus6.intArg)())
2307
2281
  },
2308
2282
  async resolve(_, args, ctx) {
2309
2283
  const results = await activateNextSegment(args, ctx, {
@@ -2317,8 +2291,8 @@ function generateBaseMutations({
2317
2291
  t.field("performAction", {
2318
2292
  type: PlayerResult,
2319
2293
  args: {
2320
- type: (0, import_nexus7.nonNull)((0, import_nexus7.stringArg)()),
2321
- payload: (0, import_nexus7.nonNull)((0, import_nexus7.stringArg)())
2294
+ type: (0, import_nexus6.nonNull)((0, import_nexus6.stringArg)()),
2295
+ payload: (0, import_nexus6.nonNull)((0, import_nexus6.stringArg)())
2322
2296
  },
2323
2297
  async resolve(_, args, ctx) {
2324
2298
  const currentGame = await getGameFromContext(ctx);
@@ -2343,8 +2317,8 @@ function generateBaseMutations({
2343
2317
  t.field("attemptLearningElement", {
2344
2318
  type: LearningElementAttempt,
2345
2319
  args: {
2346
- elementId: (0, import_nexus7.nonNull)((0, import_nexus7.idArg)()),
2347
- selection: (0, import_nexus7.nonNull)((0, import_nexus7.stringArg)())
2320
+ elementId: (0, import_nexus6.nonNull)((0, import_nexus6.idArg)()),
2321
+ selection: (0, import_nexus6.nonNull)((0, import_nexus6.stringArg)())
2348
2322
  },
2349
2323
  async resolve(_, args, ctx) {
2350
2324
  return attemptLearningElement(args, ctx);
@@ -2353,7 +2327,7 @@ function generateBaseMutations({
2353
2327
  t.field("markStoryElement", {
2354
2328
  type: Player,
2355
2329
  args: {
2356
- elementId: (0, import_nexus7.nonNull)((0, import_nexus7.idArg)())
2330
+ elementId: (0, import_nexus6.nonNull)((0, import_nexus6.idArg)())
2357
2331
  },
2358
2332
  async resolve(_, args, ctx) {
2359
2333
  return markStoryElement(args, ctx);
@@ -2362,10 +2336,10 @@ function generateBaseMutations({
2362
2336
  t.field("updatePlayerData", {
2363
2337
  type: Player,
2364
2338
  args: {
2365
- name: (0, import_nexus7.stringArg)(),
2366
- avatar: (0, import_nexus7.stringArg)(),
2367
- color: (0, import_nexus7.stringArg)(),
2368
- facts: (0, import_nexus7.stringArg)()
2339
+ name: (0, import_nexus6.stringArg)(),
2340
+ avatar: (0, import_nexus6.stringArg)(),
2341
+ color: (0, import_nexus6.stringArg)(),
2342
+ facts: (0, import_nexus6.stringArg)()
2369
2343
  },
2370
2344
  async resolve(_, args, ctx) {
2371
2345
  const facts = args.facts ? JSON.parse(args.facts) : {};
@@ -2375,7 +2349,7 @@ function generateBaseMutations({
2375
2349
  t.field("saveConsolidationDecision", {
2376
2350
  type: PlayerDecision,
2377
2351
  args: {
2378
- payload: (0, import_nexus7.nonNull)((0, import_nexus7.stringArg)())
2352
+ payload: (0, import_nexus6.nonNull)((0, import_nexus6.stringArg)())
2379
2353
  },
2380
2354
  async resolve(_, args, ctx) {
2381
2355
  const facts = JSON.parse(args.payload);
@@ -2394,9 +2368,9 @@ function generateBaseMutations({
2394
2368
  var Mutation = generateBaseMutations();
2395
2369
 
2396
2370
  // src/types/Query.ts
2397
- var import_nexus8 = require("nexus");
2371
+ var import_nexus7 = require("nexus");
2398
2372
  function generateBaseQueries() {
2399
- return (0, import_nexus8.objectType)({
2373
+ return (0, import_nexus7.objectType)({
2400
2374
  name: "Query",
2401
2375
  definition(t) {
2402
2376
  t.list.nonNull.field("games", {
@@ -2408,7 +2382,7 @@ function generateBaseQueries() {
2408
2382
  t.field("game", {
2409
2383
  type: Game,
2410
2384
  args: {
2411
- id: (0, import_nexus8.intArg)()
2385
+ id: (0, import_nexus7.intArg)()
2412
2386
  },
2413
2387
  async resolve(_, args, ctx) {
2414
2388
  return getGame(args, ctx);
@@ -2438,7 +2412,7 @@ function generateBaseQueries() {
2438
2412
  t.field("learningElement", {
2439
2413
  type: LearningElementState,
2440
2414
  args: {
2441
- id: (0, import_nexus8.nonNull)((0, import_nexus8.idArg)())
2415
+ id: (0, import_nexus7.nonNull)((0, import_nexus7.idArg)())
2442
2416
  },
2443
2417
  async resolve(_, args, ctx) {
2444
2418
  return getLearningElement(args, ctx);
@@ -2462,9 +2436,9 @@ function generateBaseQueries() {
2462
2436
  var Query = generateBaseQueries();
2463
2437
 
2464
2438
  // src/types/Subscription.ts
2465
- var import_nexus9 = require("nexus");
2439
+ var import_nexus8 = require("nexus");
2466
2440
  function generateBaseSubscriptions() {
2467
- return (0, import_nexus9.subscriptionType)({
2441
+ return (0, import_nexus8.subscriptionType)({
2468
2442
  definition(t) {
2469
2443
  t.list.nonNull.field("eventsGlobal", {
2470
2444
  type: Event,
@@ -2490,13 +2464,13 @@ function generateBaseSubscriptions() {
2490
2464
  var Subscription = generateBaseSubscriptions();
2491
2465
 
2492
2466
  // src/nexus.ts
2493
- var JsonScalar = (0, import_nexus11.asNexusMethod)(import_graphql_scalars.JSONObjectResolver, "json");
2494
- var DateScalar = (0, import_nexus11.asNexusMethod)(import_graphql_scalars.DateTimeResolver, "date");
2495
- var UserRole3 = (0, import_nexus11.enumType)({
2467
+ var JsonScalar = (0, import_nexus10.asNexusMethod)(import_graphql_scalars.JSONObjectResolver, "json");
2468
+ var DateScalar = (0, import_nexus10.asNexusMethod)(import_graphql_scalars.DateTimeResolver, "date");
2469
+ var UserRole3 = (0, import_nexus10.enumType)({
2496
2470
  name: "UserRole",
2497
2471
  members: Object.values(DB5.UserRole)
2498
2472
  });
2499
- var Event = (0, import_nexus11.objectType)({
2473
+ var Event = (0, import_nexus10.objectType)({
2500
2474
  name: "Event",
2501
2475
  definition(t) {
2502
2476
  t.string("type");
@@ -2515,11 +2489,7 @@ var Event = (0, import_nexus11.objectType)({
2515
2489
  LearningElementState,
2516
2490
  Mutation,
2517
2491
  Period,
2518
- PeriodFactsInput,
2519
- PeriodFactsSchema,
2520
2492
  PeriodSegment,
2521
- PeriodSegmentFactsInput,
2522
- PeriodSegmentFactsSchema,
2523
2493
  Player,
2524
2494
  PlayerAction,
2525
2495
  PlayerDecision,
@@ -0,0 +1,7 @@
1
+ fragment GameData on Game {
2
+ id
3
+
4
+ status
5
+ name
6
+ activePeriodIx
7
+ }
@@ -0,0 +1,10 @@
1
+ fragment LearningElementData on LearningElement {
2
+ id
3
+
4
+ title
5
+ question
6
+ reward
7
+ motivation
8
+
9
+ feedback
10
+ }
@@ -0,0 +1,14 @@
1
+ #import "./FSegmentData.graphql"
2
+
3
+ fragment PeriodData on Period {
4
+ id
5
+
6
+ index
7
+ activeSegmentIx
8
+
9
+ facts
10
+
11
+ segments {
12
+ ...SegmentData
13
+ }
14
+ }
@@ -0,0 +1,9 @@
1
+ fragment PlayerActionData on PlayerAction {
2
+ id
3
+
4
+ periodIx
5
+ segmentIx
6
+
7
+ type
8
+ facts
9
+ }
@@ -0,0 +1,36 @@
1
+ fragment PlayerData on Player {
2
+ id
3
+
4
+ isReady
5
+
6
+ role
7
+
8
+ name
9
+ avatar
10
+ location
11
+ color
12
+
13
+ facts
14
+
15
+ experience
16
+ experienceToNext
17
+
18
+ achievementKeys
19
+ achievements {
20
+ id
21
+ count
22
+
23
+ achievement {
24
+ id
25
+ name
26
+ description
27
+ image
28
+ reward
29
+ }
30
+ }
31
+
32
+ level {
33
+ id
34
+ index
35
+ }
36
+ }