-
-
Notifications
You must be signed in to change notification settings - Fork 677
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
Does not work with class-validator 0.14.0 #1443
Labels
Community 👨👧
Something initiated by a community
Duplicate 🔑
This issue or pull request already exists
Comments
See #1397 Using const schema = await buildSchema({
// ...
validate: { forbidUnknownValues: false } // <--
}); |
MichalLytek
added
Duplicate 🔑
This issue or pull request already exists
Community 👨👧
Something initiated by a community
labels
Apr 7, 2023
Is there still a security risk here with class-validator? According to its maintainers, the main change in 0.14.0 was to enable |
With GraphQL I guess not, it has own type system, fields validation and you can't put values not present in schema. |
Thanks, this worked |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Community 👨👧
Something initiated by a community
Duplicate 🔑
This issue or pull request already exists
Describe the Bug
When
TypeGraphQL 1.1.1
is used together withclass-validator 0.14.0
the TypqGraphQL validation stops working (it crashes).This happens in the validate-args file and the reason is most likely that there was a breaking change in class-validator 0.14.0 (see here). All my integration tests work with class-validator 0.13.2, but most of them fail with 0.14.0.
To Reproduce
Create a resolver with a mutation that takes this input:
This is what is returned to the API caller:
For some reason TypeGraphQL uses class-validator without specifying it as a dependency, so I was quite surprised to find this incompatibility.
The text was updated successfully, but these errors were encountered: