Created
April 1, 2016 16:49
-
-
Save helfer/7dd129cae97e4daa3d325134027bea3b 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
// resolve functions | |
{ | |
Query: { | |
person: (obj, { id }) => loaders.user.byId(id) | |
} | |
} | |
// loaders | |
{ | |
user: { | |
byId(id){ | |
return rp(`https://some-backend.com/person/${id}`) | |
.then( res => JSON.parse(res) ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment