mirror of
https://github.com/aleleba/create-node-ts-graphql-server.git
synced 2025-04-19 06:08:01 -06:00
22 lines
425 B
TypeScript
22 lines
425 B
TypeScript
/* eslint-disable no-mixed-spaces-and-tabs */
|
|
'use strict';
|
|
|
|
import { Field, ObjectType, Arg } from 'type-graphql';
|
|
import { getTest, addText } from '@controllerGraphQL';
|
|
|
|
@ObjectType()
|
|
export class Test {
|
|
@Field(() => String)
|
|
async text(){
|
|
return await getTest({});
|
|
}
|
|
}
|
|
|
|
@ObjectType()
|
|
export class TestMutation {
|
|
@Field(() => String)
|
|
async text(@Arg('text') text?: string){
|
|
return await addText({text});
|
|
}
|
|
}
|