properties

The prismaConfig take this paramters :

1.entityName(required): The entityName field represents the name of the Prisma model (or table) that you are working with. It tells Prisma which entity (model) to query.

2.select(optional): The select field specifies which properties of the entity (table) should be included in the result. It is used to filter the fields returned by Prisma when querying the database.

3. guards (optional)

The guards option allows you to specify an array of NestJS guards to apply to the routes or actions within the module. Guards are used to enforce authorization, authentication, or other custom validation logic before a request is processed.

guards: [AuthGuard],

4. decorators (optional)

The decorators option allows you to specify an array of decorator factory functions that will be applied to classes such as entities or modules. These decorators can be used to attach additional metadata or modify the behavior of the target classes at runtime, providing a flexible way to extend functionality.

decorators: [() => MyCustomDecorator],

5. swagger (optional)

Setting the swagger flag to true enables automatic generation of Swagger documentation for the API endpoints in the module. This is particularly useful for generating interactive API documentation for consumers.

swagger: true,

If enabled, the EntityModule will automatically generate and expose API documentation via Swagger UI, making it easier to understand and test the API endpoints.

And do not forget to install nestjs/swagger:

npm i @nestjs/swagger

For more info on this package, you can check them in this link: https://docs.nestjs.com/openapi/introductionarrow-up-right

5. Imports (optional)

The imports property is an array that specifies which other modules or dynamic modules your module depends on. It can include static modules, dynamic modules, promises that resolve to dynamic modules, and solutions for circular dependencies.

Last updated