I am using MongoDB, graphql-yoga and Prisma. I am unable to query nested fields which are null



I have datamodel which is as follows:

type Category {
 id: ID! @id
 name: String!
 description: String
 parentId: Category @relation(link: INLINE)

I have Categories and Sub-Categories, Sub-Categories level are not defined so I am creating categories and sub-categories from same model. Fields which does not have parentId is main Category. I want to query in Categories to find which all data has parentId as null, so that I can rendet this to UI as main category.


This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.