NestJS, MongoDB, Mongoose, GraphQL - Repeating myself describing a User or any model NestJS, MongoDB, Mongoose, GraphQL - Repeating myself describing a User or any model mongoose mongoose

NestJS, MongoDB, Mongoose, GraphQL - Repeating myself describing a User or any model


I stumbeld over your question having similar issues setting up some nest.js/graphQL/mongoose kind of API. Coming from a laravel/REST/SQL background I was very annoyed with the redundancy and have no idea of how to build up some kind of generic CRUD standard, where adding new resources would be easy and fast e.g. using a node script to create the boilerplate code etc.So one could focus on implementing the "new" functionalities instead of writing tons of code for always the same stuff.

I took a look into your GitHub project and it seems to me you already have optimized this in a way (e.g. user.schema is both for mongoose and graphql)? I started using the code first approach concerning graphQL but I think you are following the schema first approach there?Would be very interested in exchanging some thoughts about that topic as there is not much to be found here or somewhere else concerning nest.js!