L
Size: a a a
L
L
А
L
А
L
L
L
𝘂
S
L
L
L
А
L
TP
TP
const authorModel = new Schema({
name: String
})
const Authors = mongoose.model('Author', authorModel, 'authors')
const AuthorType = new GraphQLObjectType({
name: 'Author',
fields: {
id: { type: GraphQLID },
name: { type: GraphQLString },
books: {
type: new GraphQLList(BookType),
resolve(parent) {
return Authors.find({ authorId: parent.id })
}
}
}
})
TP
TP