Skip to content

Commit 1545ced

Browse files
committed
fix bug of role being null
fixing userRole for demo game
1 parent fc9ca34 commit 1545ced

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

apps/demo-game/src/graphql/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { UserRole } from '@gbl-uzh/platform'
12
import {
23
generateBaseMutations,
34
generateBaseQueries,
@@ -11,13 +12,13 @@ import {
1112
PeriodSegmentFactsInput,
1213
PeriodSegmentFactsSchema,
1314
} from './types'
14-
1515
export * from '@gbl-uzh/platform/dist/nexus'
1616
export * from './types'
1717

1818
export const Query = generateBaseQueries()
1919
export const Mutation = generateBaseMutations<PeriodFacts, PeriodSegmentFacts>({
20-
roleAssigner: (ix) => null,
20+
// TODO(JJ): Double-check with RS
21+
roleAssigner: (ix) => UserRole.PLAYER,
2122
reducers,
2223
schemas: {
2324
PeriodFactsSchema,

packages/platform/src/types/Mutation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ interface GenerateBaseMutationsArgs {
2525
reducers?: any
2626
schemas?: any
2727
inputTypes?: any
28+
// TODO(JJ): is returning void right here? It should return a UserRole, no?
2829
roleAssigner?: (ix: number) => void
2930
}
3031

3132
export function generateBaseMutations<PeriodFacts, PeriodSegmentFacts>({
3233
reducers = defaultReducers,
34+
// TODO(JJ): What Is Unset? Why string?
3335
roleAssigner = () => 'UNSET',
3436
schemas = defaultSchemas,
3537
inputTypes = defaultInputTypes,

0 commit comments

Comments
 (0)