Last active
January 14, 2020 21:12
-
-
Save helfer/c5750955cb0c37f3f79dd2ab2d4dcc6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const resolvers = { | |
Query: { | |
author(root, args){ | |
return { id: 1, firstName: 'Hello', lastName: 'World' }; | |
}, | |
}, | |
Author: { | |
posts(author){ | |
return [ | |
{ id: 1, title: 'A post', text: 'Some text', views: 2}, | |
{ id: 2, title: 'Another post', text: 'Some other text', views: 200} | |
]; | |
}, | |
}, | |
Post: { | |
author(post){ | |
return { id: 1, firstName: 'Hello', lastName: 'World' }; | |
}, | |
}, | |
}; | |
export default resolvers; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment