@@ -4,7 +4,7 @@ import GraphQLJSON from 'graphql-type-json';
44
55import { CustomCache } from 'src/cache/custom-cache.decorator' ;
66import { UseAuthGuard } from 'src/common/decorators/auth-guard.decorator' ;
7- import { GraphQLQueryToCondition } from 'src/common/decorators/condition .decorator' ;
7+ import { GraphQLQueryToOption } from 'src/common/decorators/option .decorator' ;
88import { UseRepositoryInterceptor } from 'src/common/decorators/repository-interceptor.decorator' ;
99import { GetManyInput , GetOneInput } from 'src/common/graphql/custom.input' ;
1010import { GetInfoFromQueryProps } from 'src/common/graphql/utils/types' ;
@@ -25,10 +25,10 @@ export class UserResolver {
2525 getManyUserList (
2626 @Args ( { name : 'input' , nullable : true } )
2727 condition : GetManyInput < User > ,
28- @GraphQLQueryToCondition < User > ( true )
29- info : GetInfoFromQueryProps < User > ,
28+ @GraphQLQueryToOption < User > ( true )
29+ option : GetInfoFromQueryProps < User > ,
3030 ) {
31- return this . userService . getMany ( { ...condition , ...info } ) ;
31+ return this . userService . getMany ( { ...condition , ...option } ) ;
3232 }
3333
3434 @Query ( ( ) => User )
@@ -37,10 +37,10 @@ export class UserResolver {
3737 getOneUser (
3838 @Args ( { name : 'input' } )
3939 condition : GetOneInput < User > ,
40- @GraphQLQueryToCondition < User > ( )
41- info : GetInfoFromQueryProps < User > ,
40+ @GraphQLQueryToOption < User > ( )
41+ option : GetInfoFromQueryProps < User > ,
4242 ) {
43- return this . userService . getOne ( { ...condition , ...info } ) ;
43+ return this . userService . getOne ( { ...condition , ...option } ) ;
4444 }
4545
4646 @Mutation ( ( ) => User )
@@ -66,12 +66,12 @@ export class UserResolver {
6666 @UseRepositoryInterceptor ( User )
6767 getMe (
6868 @CurrentUser ( ) user : User ,
69- @GraphQLQueryToCondition < User > ( )
70- info : GetInfoFromQueryProps < User > ,
69+ @GraphQLQueryToOption < User > ( )
70+ option : GetInfoFromQueryProps < User > ,
7171 ) {
7272 return this . userService . getOne ( {
7373 where : { id : user . id } ,
74- ...info ,
74+ ...option ,
7575 } ) ;
7676 }
7777}
0 commit comments