diff --git a/src/Quiz/quiz.schema.ts b/src/Quiz/quiz.schema.ts index 70a7ef5..d69d440 100644 --- a/src/Quiz/quiz.schema.ts +++ b/src/Quiz/quiz.schema.ts @@ -155,10 +155,6 @@ export class QuizSchema extends PothosSchema { type: 'String', required: false, }), - amount: t.arg({ - type: 'Int', - required: false, - }), }, resolve: async (query, _root, args, ctx, _info) => { if (ctx.isSubscription) { @@ -186,9 +182,9 @@ export class QuizSchema extends PothosSchema { centerMentorId: centerMentor.mentorId, }, }) - // get amount of quizzes using args.amount and random index based on random + // get amount of quizzes using nrOfQuestions and random index based on random const randomIndex = Math.floor(random * quizzes.length) - return quizzes.slice(randomIndex, randomIndex + (args.amount ?? 1)) + return quizzes.slice(randomIndex, randomIndex + (quizzes[0].nrOfQuestions ?? 1)) } // use case 2: Customer