Не получается засетить куки на бэке в приложении graphQl nestjs

Пытаюсь засетить куки через .setCookie или .cookie

@Injectable()
export class GqlAuthGuard extends AuthGuard("local") {
  constructor() {
    super();
  }

  getRequest(context: ExecutionContext) {
    const context_ = GqlExecutionContext.create(context);
    const request = context_.getContext();
    // should be the same name as args
    request.body = context_.getArgs().loginUserInput;
    return request;
  }

  handleRequest(error, user, info, context) {
    if (error || !user || info) throw error || new UnauthorizedException();

    const authContext = GqlExecutionContext.create(context);
    const ctx = authContext.getContext();

    ctx.reply.setCookie("token", "any", "any");

    return user;
  }
}

Вот небольшой пример, то есть преобразую GqlExecutionContext в нужный мне вид, получаю объект только requesta, response всегда undefined

В данном случает пытаюсь подвязаться на reply (взял из какого-то примера), но он тоже undefined

В итоге я не нашел где нужно вызывать .setCookie

** fastifyCookie подключен в main.ts **


Ответы (0 шт):