#Do @ResolveReference() need guards?

2 messages · Page 1 of 1 (latest)

agile atlas
#

E.g. should I put

    @UseGuards(GqlUserAuthGuard) // This?
    @ResolveReference()
    async resolveReference(reference: { __typename: string; id: string }) {
         if (reference.__typename === 'User') {
            return this.usersService.findOneById(reference.id);
         }
        return null;
    }

Feel like not because it's coming from another mutation/query... but wanted to make sure

sly plaza
#

I think enhancers have to be specifically enabled to even work on resolved fields, so you probably don't need it