mirror of
https://github.com/aleleba/create-node-ts-graphql-server.git
synced 2025-01-09 13:36:47 -06:00
Adding to controllers object params.
This commit is contained in:
parent
45763ff6e6
commit
52cb31e609
@ -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",
|
||||
|
@ -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})
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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 });
|
||||
};
|
Loading…
Reference in New Issue
Block a user