Category "nestjs"

How to import directives in a nestJS graphQLModule?

I need to generate typeScript types for mongoDB using graphql-code-generator and the typescript-mongodb plugin, but I don't understand how to import the directi

How to catch 3rd party api error response using NestJS' httpService?

Suppose i make a request using httpService like this const response = await this.httpService .request({ url: 'https://example.com/data', m

Trying to persist not discovered entity of type object

The problem I'm new to Nest.js and Mikro-ORM, which I have to learn as a job requirement. This stack requires TypeScript, which I despise from the bottom of my

Updating Multiple Records with varying conditions in a single query

With Typeorm + NestJS + Postgres is there a way to update multiple records with varying conditions and varying values in a single query. Normally I could do awa

nestjs return undefined in Public Guards

I follow this link https://docs.nestjs.com/security/authentication#enable-authentication-globally I went ahead and create a public guard But it does not recogni

How can i get domain name in Nestjs?

Now, i want to get domain name. I don't want hardcode for path return eg: https://mydomain/url-img. My purpose is when i develop in local enviroment, I can ret

How to upload Files and Other fields with Request Body in Nestjs

I want to upload three fields like: Example Data: partner_id: 3638, review: [{'product_id': 155, 'order_sku_id': 155, 'review_title': 'Orange Review','rating':

Getting 'ReferenceError: describe is not defined' error when going to start the application

I'm going to test typescript(inversify) code using jest. Below mentioned the code that use to test a controller method. describe('Test UserController',() =>{

Nest.JS/Multer: UploadedFile undefined

I've got some strange problem here: I've setup file upload just like in the nest.js tutorials. On my machine (Windows 10) everything works fine but when I deplo

NestJs redirect without response usage

Is it possible to make a redirect from a Nest controller without the usage of the @Response object? For now I know that we can only do this via direct @Response

How to validate an array of Date with class validator?

I have an array of dates in a post request body that I want to validate: { "meals": [...], "dates": [ "2022-03-06T11:00:00.000Z", "2022-

Integrate firebase notificaiton in nest js

I am trying to create fcm API using nest js which I am using in a flutter. I am new to Nest js and I have implemented the code using this. There is no error in

NestJs/swagger: Define ref schemas without DTO classes

I have an app where I define the API response schemas as plain javascript objects according to the open-api spec. Currently I am passing that to the ApiResponse

How to send response from middleware created in a Nest fastify server?

I've created a NestJs project with Fastify, and have created a middleware for it, but I can't figure out how to send a response to the client, similar to how we

Nestjs as API gateway + Moleculer as microservice

I'm very new in microservices, I was a wonder to know that is there any way to call a moleculer action from nestjs gateway?

TypeORM throws QueryFailedError Table already exists on MySQL when synchronize is true

I am using NestJS, TypeORM, and MySQL to build a web application. I am using a .env file to pass in some environment variables for connecting to my local datab

node-fetch@3 Not support in nestjs because it is ESM

I can't use the package "node-fetch@3". I just import it and my console will log the error: const node_fetch_1 = require("node-fetch"); ^ E

How to init RouterModule with variable from ConfigService?

I want to use the RouterModule.register(arrayOfRoutes), but I need to build the arrayOfRoutes with a variable from the ConfigService. What is the proper way to

How to mock S3 with jest?

I am tryng to code a test for upload. But i am not understating how to properly use jest.mock('aws-sdk') export class S3Service { private readonly s3: S3;

GraphQL Schema not updated with NestJS (code-first approach)

Pretty new to GraphQL, I am facing an issue with the latest version of NestJS where I am currently trying to add a mutation to a resolver that doesn't show in t