Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. const typeDefs = gql`
  2. type User {
  3. name: String
  4. }
  5. type Book {
  6. title: String
  7. author: User
  8. }
  9. # ...
  10. `;
  11.  
  12. const resolvers = {
  13. Book: {
  14. author: (book) => { /* find user by book.authorId */ }
  15. }
  16. /* ... */
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement