Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL Internal Server Error w/ I18N #669

Open
5 tasks done
G0maa opened this issue Oct 15, 2024 · 2 comments
Open
5 tasks done

GraphQL Internal Server Error w/ I18N #669

G0maa opened this issue Oct 15, 2024 · 2 comments

Comments

@G0maa
Copy link

G0maa commented Oct 15, 2024

Describe the bug

Hello, thanks for the package! 🌹

As in the provided code sample, RESTful requests work correctly (when validation fails or passes), GraphQL requests fail when validation fails, resulting in this error:

{
  "errors": [
    {
      "message": "Bad Request",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "helloWorldI18n"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "stacktrace": [
          "I18nValidationException: Bad Request",
          "    at I18nValidationPipe.i18nValidationErrorFactory (/home/gomaa-zorin/Github/GE-Techs/i18n-graphql/node_modules/nestjs-i18n/src/utils/util.ts:34:10)",
          "    at I18nValidationPipe.transform (/home/gomaa-zorin/Github/GE-Techs/i18n-graphql/node_modules/@nestjs/common/pipes/validation.pipe.js:74:30)",
          "    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
          "    at async resolveParamValue (/home/gomaa-zorin/Github/GE-Techs/i18n-graphql/node_modules/@nestjs/core/helpers/external-context-creator.js:136:31)",
          "    at async Promise.all (index 0)",
          "    at async pipesFn (/home/gomaa-zorin/Github/GE-Techs/i18n-graphql/node_modules/@nestjs/core/helpers/external-context-creator.js:138:13)",
          "    at async /home/gomaa-zorin/Github/GE-Techs/i18n-graphql/node_modules/@nestjs/core/helpers/external-context-creator.js:66:17"
        ]
      }
    }
  ],
  "data": null
}

Any help is appreciated!

Reproduction

https://github.com/G0maa/i18n-graphql

System Info

System:
    OS: Linux 6.8 Zorin OS 17.2 17.2
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
    Memory: 5.09 GB / 15.53 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 20.14.0 - ~/.asdf/installs/nodejs/20.14.0/bin/node
    npm: 10.7.0 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 9.1.0 - ~/.asdf/installs/nodejs/20.14.0/bin/pnpm
  Browsers:
    Chrome: 129.0.6668.89

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@G0maa

This comment was marked as outdated.

@G0maa
Copy link
Author

G0maa commented Oct 15, 2024

I got this error in some other project (similar configuration, not identical), dunno if it's related or not:

{
  "errors": [
    {
      "message": "Cannot read properties of undefined (reading 'service')",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "shoppingLists"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "stacktrace": [
          "TypeError: Cannot read properties of undefined (reading 'service')",
          "    at I18nValidationExceptionFilter.catch (/home/gomaa-zorin/Github/GE-Techs/rasheed-backend/node_modules/nestjs-i18n/src/filters/i18n-validation-exception.filter.ts:31:66)",
          "    at ExternalExceptionsHandler.invokeCustomFilters (/home/gomaa-zorin/Github/GE-Techs/rasheed-backend/node_modules/@nestjs/core/exceptions/external-exceptions-handler.js:31:32)",
          "    at ExternalExceptionsHandler.next (/home/gomaa-zorin/Github/GE-Techs/rasheed-backend/node_modules/@nestjs/core/exceptions/external-exceptions-handler.js:14:29)",
          "    at Object.shoppingLists (/home/gomaa-zorin/Github/GE-Techs/rasheed-backend/node_modules/@nestjs/core/helpers/external-proxy.js:14:42)",
          "    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
        ]
      }
    }
  ],
  "data": null
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant