From cd6035c6e49aeb1fb53d3d20746f0f7cc2f6a437 Mon Sep 17 00:00:00 2001 From: Quang Vo Date: Sun, 19 Nov 2023 09:49:38 +0700 Subject: [PATCH] feat: add snippets for graphql + typescript --- package.json | 4 ++++ snippets/typescript.snippets.json | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 snippets/typescript.snippets.json diff --git a/package.json b/package.json index c7c858f..51e090a 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,10 @@ { "language": "python", "path": "snippets/python.snippets.json" + }, + { + "language": "typescript", + "path": "snippets/typescript.snippets.json" } ], "keybindings": [ diff --git a/snippets/typescript.snippets.json b/snippets/typescript.snippets.json new file mode 100644 index 0000000..8a3826b --- /dev/null +++ b/snippets/typescript.snippets.json @@ -0,0 +1,21 @@ +{ + "BoostCode: Resolver": { + "prefix": ["GraplQL resolvers", "grs"], + "body": [ + "const resolvers = {", + " ${1|Query,Mutation,Subscription|}: {", + " ${2:functionName}: async (", + " _parent: unknown,", + " args: ${3|unknown|},", + " context: ${4|unknown|}", + " ): Promise<${5|any|}> => {", + " $0", + " },", + " },", + "};", + "", + "export default resolvers;" + ], + "description": "GraplQL resolvers" + } +}