Skip to content

Instantly share code, notes, and snippets.

@bartcis
Created August 11, 2019 08:50
Show Gist options
  • Select an option

  • Save bartcis/2016b375df299d9bcdc7f490f098d232 to your computer and use it in GitHub Desktop.

Select an option

Save bartcis/2016b375df299d9bcdc7f490f098d232 to your computer and use it in GitHub Desktop.
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