mirror of
https://github.com/aleleba/create-node-ts-graphql-server.git
synced 2025-06-18 11:58:23 -06:00
PR-448199:
Adding files from first version. Creating GraphQL server with their controllers and their models, squema and resolvers. Adding support to webpack and typescript.
This commit is contained in:
14
controllers/controllerGraphQL/index.ts
Normal file
14
controllers/controllerGraphQL/index.ts
Normal file
@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
import { getTestModel, addTextModel } from '../../models';
|
||||
|
||||
// eslint-disable-next-line
|
||||
export const getTest = async (rootValue, args, context) => {
|
||||
return getTestModel();
|
||||
};
|
||||
|
||||
// eslint-disable-next-line
|
||||
export const addText = async (rootValue, args, context) => {
|
||||
const text = args.text;
|
||||
return addTextModel({ text });
|
||||
};
|
Reference in New Issue
Block a user