Hello. I'm trying to set up a subscription, but I ...
# orm-help
a
Hello. I'm trying to set up a subscription, but I only get the scalar fields and not the nested fields. I'm using prisma-client. My resolver
Copy code
import { 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
Copy code
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
Copy code
{
  "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.