From c44f53678830feff47ba843ede932fc576f3189d Mon Sep 17 00:00:00 2001 From: Joshua Seigler Date: Wed, 29 Jan 2020 00:00:17 -0500 Subject: [PATCH] feat(server): all-author and all-books roots --- server/schema/schema.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/schema/schema.js b/server/schema/schema.js index 2f5bb7a..9d4d7d2 100644 --- a/server/schema/schema.js +++ b/server/schema/schema.js @@ -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; + } } } });