Schema Generator cannot determine GraphQL output type for custom object within DTO Schema Generator cannot determine GraphQL output type for custom object within DTO express express

Schema Generator cannot determine GraphQL output type for custom object within DTO


Had similar issue migrating from express to nestjs.

After reading the docs realised that problem isn't the nested objects, but wrong imports.

You should use @nestjs/graphql imports instead of type-graphql.

E.G.

// changes thisimport { Field, ID, ObjectType } from 'type-graphql'// toimport { Field, ID, ObjectType } from '@nestjs/graphql'

Same applies to any other import from type-graphql