toonvanstrijp / nestjs-i18n

The i18n module for nestjs.
https://nestjs-i18n.com
Other
642 stars 106 forks source link

i18nValidationErrorFactory INTERNAL SERVER ERROR #486

Closed Natchii59 closed 1 year ago

Natchii59 commented 1 year ago

Hello, I just tested nestjs-i18n in my nestjs application with a GraphQL api. I would like to use it for DTO validations, to translate my messages.

I have this setup:

When the validations are bad, I get this error.

image
stigmat4j commented 1 year ago

the same problem

leandrofreire08 commented 1 year ago

Got the same if I don't add the ValidationPipe to the global:

app.useGlobalPipes(
    new ValidationPipe(),
    new I18nValidationPipe({ transform: true }),
  )

but still couldn't make the translation work with DTO

rubiin commented 1 year ago

alt text and alt text . I was not able to replicate

rubiin commented 1 year ago

The code can be found here https://github.com/toonvanstrijp/nestjs-i18n/tree/main/samples/dto-validation

stigmat4j commented 1 year ago
image image image image

I think I have more to do with graphql, but maybe you can help?

rubiin commented 1 year ago

If you could provide me a repro. The exception filter is meant to be used with HTTP as far as I know.

stigmat4j commented 1 year ago
image

image

no, there is support for graphql. Errors are even translated