I need the to somehow access the objectId
from @Args
inside the guard so as to check if the sender has the objectId
assigned to his account. Any idea how I could implement it?
@Query(() => [Person])
@UseGuards(ObjectMatch)
async pplWithObject(@Args('objectId') id: string): Promise<Person[]> {
return await this.objService.getPeopleWithObject(id);
}
Is it possible to access the passed argument from the context?
const ctx = GqlExecutionContext.create(context);
const request = ctx.getContext().req;