From 52cb31e609d49713f40b1033fda4dd0a6f5fb22d Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Mon, 30 May 2022 12:52:37 +0000 Subject: [PATCH] Adding to controllers object params. --- package.json | 2 +- src/GraphQL/resolvers/index.ts | 4 ++-- src/controllers/controllerGraphQL/index.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 64451e8..5c84b25 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aleleba/create-node-ts-graphql-server", - "version": "1.0.4", + "version": "1.0.5", "description": "Node with Typescript and GraphQL Server", "bin": "./bin/cli.js", "main": "index.js", diff --git a/src/GraphQL/resolvers/index.ts b/src/GraphQL/resolvers/index.ts index e827f89..c662741 100644 --- a/src/GraphQL/resolvers/index.ts +++ b/src/GraphQL/resolvers/index.ts @@ -13,10 +13,10 @@ const resolvers = { testMutation: (rootValue, args, context) => ({}), }, Test: { - test: (rootValue, args, context) => getTest(rootValue, args, context) + test: (rootValue, args, context) => getTest({rootValue, args, context}) }, TestMutation: { - testMutation: (rootValue, args, context) => addText(rootValue, args, context) + testMutation: (rootValue, args, context) => addText({rootValue, args, context}) } }; diff --git a/src/controllers/controllerGraphQL/index.ts b/src/controllers/controllerGraphQL/index.ts index 659bd10..ce41902 100644 --- a/src/controllers/controllerGraphQL/index.ts +++ b/src/controllers/controllerGraphQL/index.ts @@ -3,12 +3,12 @@ import { getTestModel, addTextModel } from '../../models'; // eslint-disable-next-line -export const getTest = async (rootValue, args, context) => { +export const getTest = async ({rootValue, args, context}) => { return getTestModel(); }; // eslint-disable-next-line -export const addText = async (rootValue, args, context) => { +export const addText = async ({rootValue, args, context}) => { const text = args.text; return addTextModel({ text }); }; \ No newline at end of file