Skip to content

Instantly share code, notes, and snippets.

@mr-pascal
Created December 31, 2020 12:48
Show Gist options
  • Save mr-pascal/db09bea3a61d15cb74182f068030210e to your computer and use it in GitHub Desktop.
Save mr-pascal/db09bea3a61d15cb74182f068030210e to your computer and use it in GitHub Desktop.
// src/index.ts
const resolvers = {
Query: {
/**
* Simple resolver to add two numbers
* @param {object} _
* @param {number} x First number
* @param {number} y Second number
*/
add: async (_: unknown, {x, y}: { x: number, y: number }): Promise<number> => x + y,
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment