Last active
May 15, 2018 06:19
-
-
Save JakeDawkins/71733cc525399c2275e324b0d4d3d317 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // src/server.js | |
| context: ({ req }) => { | |
| // pass the request information through to the model | |
| return { | |
| user, | |
| models: { | |
| User: generateUserModel({ req }), | |
| ... | |
| } | |
| }; | |
| }, |
This file contains hidden or 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
| // src/models/user.js | |
| export const generateUserModel = ({ req }) => ({ | |
| getAll: () => { | |
| return fetch('http://myurl.com/users', { headers: req.headers }); | |
| }, | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment