mirror of
https://github.com/seigler/graphql-playground
synced 2025-07-27 01:26:10 +00:00
feat(server): all-author and all-books roots
This commit is contained in:
parent
4dd04ff725
commit
c44f536788
1 changed files with 12 additions and 0 deletions
|
@ -71,6 +71,18 @@ const RootQuery = new GraphQLObjectType({
|
||||||
resolve (parent, args) {
|
resolve (parent, args) {
|
||||||
return _.find(authors, { id: args.id });
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue