Files
create-node-ts-graphql-server/src/GraphQL/resolvers/test.resolver.ts
T
aleleba a5d7b2bebc PR-736133: Update dependencies and bump version to 1.6.6
Run check-updates and keep majors that are incompatible with
type-graphql 2.0.0-rc.3 or the current tooling (typescript 6, graphql 16,
graphql-scalars 1, Babel 7). Declare previously transitive imports
(terser-webpack-plugin, globals, typescript-eslint, @eslint/js) as
devDependencies so build and lint work again. Fix lint errors and update
the versions listed in the README.
2026-12-02 06:45:46 +00:00

34 lines
670 B
TypeScript

'use strict';
import { Query, Resolver, Mutation, FieldResolver, Arg } from 'type-graphql';
import { Test, TestMutation } from '@GraphQL/schema';
import { getTest, addText } from '@controllerGraphQL';
@Resolver(() => Test)
export class TestResolverQuery {
@Query(() => Test)
async test() {
return {};
}
@FieldResolver(() => String)
async text() {
return await getTest({});
}
}
@Resolver(() => TestMutation)
export class TestResolverMutation {
@Mutation(() => TestMutation)
async testMutation() {
return {};
}
@FieldResolver(() => String)
async text(@Arg('text') text?: string){
return await addText({text});
}
}