PR-757991: adding typegraphql.

This commit is contained in:
2023-03-10 13:18:24 +00:00
parent 6ff6edaaf4
commit 4ffc696ee4
14 changed files with 392 additions and 114 deletions
+36
View File
@@ -0,0 +1,36 @@
'use strict';
import { Field, ObjectType, Arg } from "type-graphql";
import { getTest, addText } from '@controllerGraphQL';
@ObjectType()
export class Test {
@Field(() => Text)
async text(){
return {
text: await getTest({})
}
}
}
@ObjectType()
export class Text {
@Field()
text?: string
}
@ObjectType()
export class TestMutation {
@Field(type => TextMutation)
async textMutation(@Arg('text') text?: string){
return {
text: await addText({text})
}
}
}
@ObjectType()
export class TextMutation {
@Field()
text?: string
}