Answer the question
In order to leave comments, you need to log in
How to make a layered Graphql model?
Dear colleagues!
I am studying graphql and here is such a question, I have already learned how to do operations with simple collections, but how to get data from a multilevel collection, now I have such a document in mongodb:
how do I write a model, something like this does not work)
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const componentNavbarSchema = new Schema({
name: String,
menu_items: {
id: String,
name: String,
child: String
}
});
module.exports = mongoose.model('componentNavbar', componentsNavbarSchema);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question