Created
August 11, 2019 08:50
-
-
Save bartcis/2016b375df299d9bcdc7f490f098d232 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
| const api = require('./server/api'); | |
| const typeDefs = require('./server/schema'); | |
| const resolvers = { | |
| Query: { | |
| countries: () => api.countries, | |
| country: (obj, args) => { | |
| for (const record of api.countries) { | |
| if (record.id === args.id) { | |
| return record; | |
| } | |
| } | |
| }, | |
| }, | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment