Adding to controllers object params.

This commit is contained in:
Alejandro Lembke Barrientos 2022-05-30 12:52:37 +00:00
parent 45763ff6e6
commit 52cb31e609
3 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@aleleba/create-node-ts-graphql-server", "name": "@aleleba/create-node-ts-graphql-server",
"version": "1.0.4", "version": "1.0.5",
"description": "Node with Typescript and GraphQL Server", "description": "Node with Typescript and GraphQL Server",
"bin": "./bin/cli.js", "bin": "./bin/cli.js",
"main": "index.js", "main": "index.js",

View File

@ -13,10 +13,10 @@ const resolvers = {
testMutation: (rootValue, args, context) => ({}), testMutation: (rootValue, args, context) => ({}),
}, },
Test: { Test: {
test: (rootValue, args, context) => getTest(rootValue, args, context) test: (rootValue, args, context) => getTest({rootValue, args, context})
}, },
TestMutation: { TestMutation: {
testMutation: (rootValue, args, context) => addText(rootValue, args, context) testMutation: (rootValue, args, context) => addText({rootValue, args, context})
} }
}; };

View File

@ -3,12 +3,12 @@
import { getTestModel, addTextModel } from '../../models'; import { getTestModel, addTextModel } from '../../models';
// eslint-disable-next-line // eslint-disable-next-line
export const getTest = async (rootValue, args, context) => { export const getTest = async ({rootValue, args, context}) => {
return getTestModel(); return getTestModel();
}; };
// eslint-disable-next-line // eslint-disable-next-line
export const addText = async (rootValue, args, context) => { export const addText = async ({rootValue, args, context}) => {
const text = args.text; const text = args.text;
return addTextModel({ text }); return addTextModel({ text });
}; };