Alosies
04/15/2020, 5:15 PMimport { prisma } from '../../../../prisma-client'
realTimeQuizInstance: {
subscribe: async (parent, args, ctx, info) => {
return prisma.$subscribe.realTimeQuizInstance({}, info)
},
resolve (payload, args, ctx, info) {
return payload;
}
}
My subscription
subscription RTQInstanceSubscription($where: RealTimeQuizInstanceSubscriptionWhereInput) {
realTimeQuizInstance(where: $where) {
mutation
node {
id
currentQuestionIndex
quizAttempts(orderBy: score_DESC, first: 10){
score
user{
fullName
picture_large
customPictureUrl
}
}
}
}
}
The result
{
"data": {
"realTimeQuizInstance": {
"mutation": "UPDATED",
"node": {
"id": "xxxxxxx",
"currentQuestionIndex": 4,
"quizAttempts": null
}
}
}
}
I'm getting null for quizAttempts . How do I get the nested fields? I have been searching and trying to resolve this for more than a day now. Any help is highly appreciated.