Skip to content

Instantly share code, notes, and snippets.

@zapkub
Last active March 28, 2017 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zapkub/d6081b71f699a7d6de70a5fceb59957e to your computer and use it in GitHub Desktop.
Save zapkub/d6081b71f699a7d6de70a5fceb59957e to your computer and use it in GitHub Desktop.
new Resolver({
resolve: async () => {
return new Promise((rs, rj) => {
Model.find({ _id }, function(err, result){
rs(result);
});
})
}
// or use await
resolve: async () => {
const result = await Model.find({ _id });
return result;
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment