DEV Community

loading...

Discussion on: Three in one (code first) : NestJs & GraphQl & Mongoose

Collapse
radovansurlak profile image
Radovan Surlak

Right, I was looking into that as well.

The issue for me was that if we use
populate: false, the resolver would be returning an array of IDs, which GraphQL would complain about, since it's not of type Hobby.

I have personally used an approach where I specify extra GraphQL field populatedHobbies of type [Hobby] and keep hobbies endpoint, which would return [ID]

Thread Thread
lotfi profile image
Lotfi Author

Good idea !

Forem Open with the Forem app