-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Added support for MutationConventions #80
base: main
Are you sure you want to change the base?
Conversation
…tionException))]" on mutations with enabled conventions
@benmccallum any feedback on this? |
@FleloShe I do not think this is working, I am testing this locally
This line is not hitting |
Maybe you did not enable MutationConventions for your endpoint? Checkout https://chillicream.com/docs/hotchocolate/defining-a-schema/mutations/#errors for further reading. Some hintsUse this on your endpoint:
And this in your startup:
Also make sure you added a validator for your model. |
If I'm not mistaken using Hot Chocolate's mutation conventions means you'll have your mutation input arguments directly as parameters on the corresponding mutation method, so I'm not sure how we could use FluentValidation in that case? What am I missing? |
@FleloShe thanks for your work! I tried this branch myself and I couldn't get it to work. I pushed a small example (https://github.com/TheWillard/mutation-convention-fairybread-validation) where only the |
Added support for MutationConventions. Must use "[Error(typeof(ValidationException))]" on mutations with enabled conventions.
At the current time it is necessary to overwrite the DefaultValidationErrorsHandler to support errors apart from the "ValidationException" from FluentValidation