From 6ff437385ec81418448b090b0266eff1d8545ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20W=C3=B6lk?= Date: Wed, 7 Apr 2021 11:23:50 +0200 Subject: [PATCH] fix(graphql,auth,#1026): Fixed renamed export --- examples/auth/src/todo-item/todo-item.resolver.ts | 13 +++++-------- packages/query-graphql/src/index.ts | 7 +------ 2 files changed, 6 insertions(+), 14 deletions(-) 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,