Nested Mongoose queries data not showing on GraphQL query Nested Mongoose queries data not showing on GraphQL query mongoose mongoose

Nested Mongoose queries data not showing on GraphQL query


You shouldn't use the populate on the Parent model. You should instead define how to query the nested model in the EntradaInventario resolvers.

Inventory should look something like this:

Inventory : {    articulo: async (parent, args, { }) => {      return await Articulo.findOne({        _id: parent.idArticulo,      });    },  }

Here is a repo that does just that and is a good example https://github.com/the-road-to-graphql/fullstack-apollo-express-mongodb-boilerplate