我需要以某种方式objectId从@Args警卫内部访问,以检查发件人是否已将其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;