feat(server): all-author and all-books roots

This commit is contained in:
Joshua Seigler 2020-01-29 00:00:17 -05:00
parent 4dd04ff725
commit c44f536788

View file

@ -71,6 +71,18 @@ const RootQuery = new GraphQLObjectType({
resolve (parent, args) {
return _.find(authors, { id: args.id });
}
},
books: {
type: new GraphQLList(BookType),
resolve (parent, args) {
return books;
}
},
authors: {
type: new GraphQLList(AuthorType),
resolve (parent, args) {
return authors;
}
}
}
});