AppAny.HotChocolate.FluentValidation
0.1.1
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package AppAny.HotChocolate.FluentValidation --version 0.1.1
NuGet\Install-Package AppAny.HotChocolate.FluentValidation -Version 0.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AppAny.HotChocolate.FluentValidation" Version="0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AppAny.HotChocolate.FluentValidation --version 0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AppAny.HotChocolate.FluentValidation, 0.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AppAny.HotChocolate.FluentValidation as a Cake Addin #addin nuget:?package=AppAny.HotChocolate.FluentValidation&version=0.1.1 // Install AppAny.HotChocolate.FluentValidation as a Cake Tool #tool nuget:?package=AppAny.HotChocolate.FluentValidation&version=0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AppAny.HotChocolate.FluentValidation
Input field HotChocolate
+ FluentValidation
integration
Usage
# Basic
services.AddGraphQLServer()
.AddFluentValidation();
descriptor.Field(x => x.Example(default!))
.Argument("input", argument => argument.UseFluentValidation());
... Example([UseFluentValidation] ExampleInput input) { ... }
# Customizations
services.AddGraphQLServer()
.AddFluentValidation(options =>
{
options.SkipValidation(...)
.UseErrorMappers(...)
.UseInputValidatorFactories(...);
});
descriptor.Field(x => x.Example(default!))
.Argument("input", argument => argument.UseFluentValidation(options =>
{
options.SkipValidation(...)
.UseErrorMappers(...)
.UseInputValidatorFactories(...)
.UseValidator<ExampleInputValidator>()
.UseValidator<ExampleInput, ExampleInputValidator>()
.UseValidator<ExampleInput, ExampleInputValidator>(strategy =>
{
strategy.IncludeProperties(input => input.ExampleProperty);
// ...
});
}));
... Example([UseFluentValidation(typeof(ExampleInputValidator))] ExampleInput input) { ... }
Abstractions
SkipValidation
delegate- Configures skip validation predicate
ErrorMapper
delegate- Maps
FluentValidation
validation result toHotChocolate
error
- Maps
InputValidator
delegate- Wraps
IValidator
execution
- Wraps
InputValidatorFactory
delegate- Configures conventions to resolve
InputValidator
- Configures conventions to resolve
Features
- Global + per-argument multiple
ErrorMapper
configuration - Global + per-argument multiple
InputValidationFactory
configuration - Per-argument multiple
InputValidator
- Per-validator
ValidationStrategy
- Conditional validation skipping
- Basic attribute-based configuration, code-first preferred
ErrorMappers
- .UseDefaultErrorMapper()
{
"errors": [
{
"message": "Name is empty",
"path": [
"createUser"
],
"extensions": {
"code": "ValidationFailed"
}
}
],
"data": {
"createUser": null
}
}
- .UseDefaultErrorMapperWithDetails()
{
"errors": [
{
"message": "Name is empty",
"path": [
"createUser"
],
"extensions": {
"code": "ValidationFailed",
"validator": "NotEmptyValidator",
"inputField": "input",
"property": "Name",
"severity": "Error",
"attemptedValue": ""
}
}
],
"data": {
"createUser": null
}
}
- .UseDefaultErrorMapperWithExtendedDetails()
{
"errors": [
{
"message": "Name is empty",
"path": [
"createUser"
],
"extensions": {
"code": "ValidationFailed",
"validator": "NotEmptyValidator",
"inputField": "input",
"property": "Name",
"severity": "Error",
"attemptedValue": "",
"customState": null,
"formattedMessagePlaceholderValues": {
"PropertyName": "Name",
"PropertyValue": ""
}
}
}
],
"data": {
"createUser": null
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- FluentValidation (>= 9.3.0)
- HotChocolate.Execution (>= 11.0.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.11.2 | 10,795 | 8/20/2024 |
0.11.1 | 68,601 | 1/8/2024 |
0.11.0 | 180,506 | 1/10/2023 |
0.10.0 | 18,183 | 10/7/2022 |
0.9.0 | 130,605 | 8/7/2022 |
0.8.1 | 12,206 | 5/29/2022 |
0.8.0 | 9,007 | 5/6/2022 |
0.7.0 | 12,957 | 4/1/2022 |
0.6.3 | 6,484 | 3/3/2022 |
0.6.2 | 11,095 | 1/28/2022 |
0.6.1 | 1,675 | 1/21/2022 |
0.6.0 | 6,264 | 12/14/2021 |
0.5.0 | 2,518 | 11/7/2021 |
0.4.0 | 4,593 | 9/28/2021 |
0.3.9 | 3,064 | 8/17/2021 |
0.3.8 | 1,605 | 8/6/2021 |
0.3.7 | 2,394 | 7/24/2021 |
0.3.6 | 4,427 | 6/29/2021 |
0.3.5 | 2,254 | 6/10/2021 |
0.3.4 | 1,797 | 6/7/2021 |
0.3.3 | 1,761 | 5/30/2021 |
0.3.2 | 1,544 | 5/30/2021 |
0.3.1 | 1,872 | 5/20/2021 |
0.3.0 | 1,523 | 5/20/2021 |
0.2.8 | 3,579 | 4/28/2021 |
0.2.7 | 1,865 | 4/23/2021 |
0.2.6 | 1,712 | 4/21/2021 |
0.2.5 | 217 | 4/12/2021 |
0.2.4 | 2,036 | 3/30/2021 |
0.2.3 | 262 | 3/29/2021 |
0.2.2 | 269 | 3/26/2021 |
0.2.1 | 340 | 3/22/2021 |
0.2.0 | 631 | 3/15/2021 |
0.1.19 | 2,289 | 2/26/2021 |
0.1.18 | 1,907 | 2/23/2021 |
0.1.17 | 1,873 | 2/20/2021 |
0.1.16 | 1,877 | 2/16/2021 |
0.1.14 | 1,576 | 2/16/2021 |
0.1.13 | 1,618 | 2/16/2021 |
0.1.12 | 1,805 | 2/12/2021 |
0.1.11 | 2,372 | 2/4/2021 |
0.1.10 | 1,791 | 2/1/2021 |
0.1.9 | 1,707 | 1/31/2021 |
0.1.8 | 1,656 | 1/30/2021 |
0.1.7 | 1,672 | 1/29/2021 |
0.1.6 | 1,772 | 1/27/2021 |
0.1.5 | 1,896 | 1/22/2021 |
0.1.4 | 1,918 | 1/16/2021 |
0.1.3 | 1,562 | 1/15/2021 |
0.1.2 | 1,699 | 1/14/2021 |
0.1.1 | 1,624 | 1/12/2021 |
0.1.0 | 1,688 | 1/9/2021 |
0.0.1 | 1,616 | 1/7/2021 |