Created
March 1, 2020 19:14
-
-
Save fernandodof/35e1a93e945bf081ff974dc1771901fa 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
// Omitted query resolver | |
const User = { | |
followers: (user) => { | |
const followersIds = db.users.get(user.id).followers; | |
const followers = []; | |
for (id of followersIds) { | |
followers.push(db.users.get(id)); | |
} | |
return followers; | |
} | |
} | |
module.exports = { Query, User }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment