diff --git a/examples/auth/src/todo-item/todo-item.resolver.ts b/examples/auth/src/todo-item/todo-item.resolver.ts index 14b7ebb81..b68d854e7 100644 --- a/examples/auth/src/todo-item/todo-item.resolver.ts +++ b/examples/auth/src/todo-item/todo-item.resolver.ts @@ -1,10 +1,5 @@ import { Filter, InjectAssemblerQueryService, mergeFilter, mergeQuery, QueryService } from '@nestjs-query/core'; -import { - AuthorizerInterceptor, - AuthorizerFilter, - ConnectionType, - AuthorizationOperationGroup, -} from '@nestjs-query/query-graphql'; +import { AuthorizerInterceptor, AuthorizerFilter, ConnectionType, OperationGroup } from '@nestjs-query/query-graphql'; import { Args, Query, Resolver } from '@nestjs/graphql'; import { UseGuards, UseInterceptors } from '@nestjs/common'; import { TodoItemDTO } from './dto/todo-item.dto'; @@ -23,7 +18,7 @@ export class TodoItemResolver { async completedTodoItems( @Args() query: TodoItemQuery, @AuthorizerFilter({ - operationGroup: AuthorizationOperationGroup.READ, + operationGroup: OperationGroup.READ, many: true, }) authFilter: Filter, @@ -43,7 +38,9 @@ export class TodoItemResolver { async uncompletedTodoItems( @Args() query: TodoItemQuery, @AuthorizerFilter({ - operationGroup: AuthorizationOperationGroup.READ, + operationName: 'queryUncompletedTodoItems', + operationGroup: OperationGroup.READ, + readonly: true, many: true, }) authFilter: Filter, diff --git a/packages/query-graphql/src/index.ts b/packages/query-graphql/src/index.ts index 454761b7f..2681974a2 100644 --- a/packages/query-graphql/src/index.ts +++ b/packages/query-graphql/src/index.ts @@ -40,12 +40,7 @@ export { DTONamesOpts } from './common'; export { NestjsQueryGraphQLModule } from './module'; export { AutoResolverOpts } from './providers'; export { pubSubToken, GraphQLPubSub } from './subscription'; -export { - Authorizer, - AuthorizerOptions, - AuthorizationContext, - OperationGroup as AuthorizationOperationGroup, -} from './auth'; +export { Authorizer, AuthorizerOptions, AuthorizationContext, OperationGroup } from './auth'; export { Hook, HookTypes,