Skip to content

Commit 152c5b6

Browse files
committed
Added list queries for books and authors
1 parent 0d1c5f1 commit 152c5b6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

schema/schema.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ const RootQuery = new GraphQLObjectType({
8787
// For now return from dummy data
8888
return _.find(authors, { id: args.id });
8989
}
90+
},
91+
books: {
92+
type: new GraphQLList(BookType),
93+
resolve(parent, args) {
94+
return books;
95+
}
96+
},
97+
authors: {
98+
type: new GraphQLList(AuthorType),
99+
resolve(parent, args) {
100+
return authors;
101+
}
90102
}
91103
}
92104
});

0 commit comments

Comments
 (0)