PR-393405:

chore: update dependencies and version to 1.6.0

feat: refactor GraphQL resolvers for improved structure and functionality
- Split TestResolver into TestResolverQuery and TestResolverMutation
- Implement FieldResolvers for dynamic data fetching

fix: update import paths for graphql-ws to use new module structure

chore: add ESLint configuration for improved code quality
- Migrate from previous ESLint config to a new structure with TypeScript support

style: update TypeScript target to ES2021 for better compatibility
This commit is contained in:
2025-04-21 18:47:45 +00:00
parent f8cc416737
commit e7fc85ea83
15 changed files with 2316 additions and 2706 deletions
+20 -6
View File
@@ -1,19 +1,33 @@
/* eslint-disable no-mixed-spaces-and-tabs */
'use strict';
import { Query, Resolver, Mutation } from 'type-graphql';
import { Test, TestMutation } from '@GraphQL/schema/test.schema';
import { Query, Resolver, Mutation, FieldResolver, Root, Arg } from 'type-graphql';
import { Test, TestMutation } from '@GraphQL/schema';
import { getTest, addText } from '@controllerGraphQL';
@Resolver(() => Test)
export class TestResolver {
export class TestResolverQuery {
@Query(() => Test)
async test() {
return Test;
return {};
}
@FieldResolver(() => String)
async text() {
return await getTest({});
}
}
@Resolver(() => TestMutation)
export class TestResolverMutation {
@Mutation(() => TestMutation)
async testMutation() {
return TestMutation;
}
return {};
}
@FieldResolver(() => String)
async text(@Arg('text') text?: string){
return await addText({text});
}
}