【发布时间】:2020-12-14 13:27:42
【问题描述】:
我需要以某种方式从警卫内部的@Args 访问objectId,以检查发件人是否将objectId 分配给他的帐户。知道如何实现它吗?
@Query(() => [Person])
@UseGuards(ObjectMatch)
async pplWithObject(@Args('objectId') id: string): Promise<Person[]> {
return await this.objService.getPeopleWithObject(id);
}
是否可以从上下文中访问传递的参数?
const ctx = GqlExecutionContext.create(context);
const request = ctx.getContext().req;
【问题讨论】: