Skip to content

Instantly share code, notes, and snippets.

@unicodeveloper
Last active September 5, 2018 15:44
Show Gist options
  • Save unicodeveloper/2d3fffc3ca2770b47c561f5ace9f504b to your computer and use it in GitHub Desktop.
Save unicodeveloper/2d3fffc3ca2770b47c561f5ace9f504b to your computer and use it in GitHub Desktop.
const resolvers = {
Query: {
car: (root, { plateNumber }, { dataSources }) => dataSources.mvrpAPI.getACar(plateNumber),
cars: (root, args, { dataSources }) => dataSources.mvrpAPI.getAllCars(),
},
Car: {
vehicleStatus: ({ status }) => status,
yearOfManufacture: ({ productionYear }) => productionYear,
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment