v0.10.x to v0.11.x
@InjectQueryService
In v0.11.x
an new decorator was added @InjectQueryService
, this decorator replaces the ORM specific decorators:
@InjectTypeOrmQueryService
@InjectSequelizeQueryService
To migrate replace all @InjectTypeOrmQueryService
and @InjectSequelizeQueryService
with @InjectQueryService
.
note
You still need to import the NestjsQueryTypeOrmModule
or NestjsQuerySequelizeModule
to use @InjectQueryService
.
import { QueryService, InjectQueryService } from '@ptc-org/nestjs-query-core';
import { CRUDResolver } from '@ptc-org/nestjs-query-graphql';
import { Resolver } from '@nestjs/graphql';
import { TodoItemDTO } from './dto/todo-item.dto';
import { TodoItemEntity } from './todo-item.entity';
@Resolver(() => TodoItemDTO)
export class TodoItemResolver extends CRUDResolver(TodoItemDTO) {
constructor(@InjectQueryService(TodoItemEntity) readonly service: QueryService<TodoItemEntity>) {
super(service);
}
}