AppAny.HotChocolate.FluentValidation 0.0.1

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package AppAny.HotChocolate.FluentValidation --version 0.0.1
NuGet\Install-Package AppAny.HotChocolate.FluentValidation -Version 0.0.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.0.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.0.1
#r "nuget: AppAny.HotChocolate.FluentValidation, 0.0.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.0.1

// Install AppAny.HotChocolate.FluentValidation as a Cake Tool
#tool nuget:?package=AppAny.HotChocolate.FluentValidation&version=0.0.1

AppAny.HotChocolate.FluentValidation

Nuget Hotchocolate | FluentValidation

Input field HotChocolate + FluentValidation validation integration

Abstractions

  • SkipValidation delegate

    • Configures predicate to skip validation
  • ErrorMapper delegate

    • Maps FluentValidation validation result to HotChocolate error
  • InputValidator delegate

    • Wraps IValidator + ValidationStrategy and executes ValidateAsync
  • InputValidatorFactory delegate

    • Configures conventions to resolve FluentValidation validators wrapped in InputValidator

Features

  • Global + per-argument multiple ErrorMapper configuration
  • Global + per-argument multiple InputValidationFactory configuration
  • Per-argument multiple IValidator
  • Per-validator ValidationStrategy
  • Conditional validation skipping
  • Basic attribute-based configuration, code-first preferred

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) { ... }
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1 12,067 1/8/2024
0.11.0 142,230 1/10/2023
0.10.0 13,158 10/7/2022
0.9.0 110,889 8/7/2022
0.8.1 11,998 5/29/2022
0.8.0 8,523 5/6/2022
0.7.0 11,263 4/1/2022
0.6.3 6,244 3/3/2022
0.6.2 10,618 1/28/2022
0.6.1 1,635 1/21/2022
0.6.0 6,229 12/14/2021
0.5.0 2,310 11/7/2021
0.4.0 4,563 9/28/2021
0.3.9 3,025 8/17/2021
0.3.8 1,573 8/6/2021
0.3.7 2,361 7/24/2021
0.3.6 4,388 6/29/2021
0.3.5 2,182 6/10/2021
0.3.4 1,769 6/7/2021
0.3.3 1,735 5/30/2021
0.3.2 1,512 5/30/2021
0.3.1 1,835 5/20/2021
0.3.0 1,481 5/20/2021
0.2.8 3,409 4/28/2021
0.2.7 1,838 4/23/2021
0.2.6 1,680 4/21/2021
0.2.5 194 4/12/2021
0.2.4 2,007 3/30/2021
0.2.3 238 3/29/2021
0.2.2 244 3/26/2021
0.2.1 314 3/22/2021
0.2.0 611 3/15/2021
0.1.19 2,254 2/26/2021
0.1.18 1,877 2/23/2021
0.1.17 1,846 2/20/2021
0.1.16 1,832 2/16/2021
0.1.14 1,539 2/16/2021
0.1.13 1,591 2/16/2021
0.1.12 1,779 2/12/2021
0.1.11 2,335 2/4/2021
0.1.10 1,758 2/1/2021
0.1.9 1,676 1/31/2021
0.1.8 1,623 1/30/2021
0.1.7 1,639 1/29/2021
0.1.6 1,744 1/27/2021
0.1.5 1,868 1/22/2021
0.1.4 1,885 1/16/2021
0.1.3 1,533 1/15/2021
0.1.2 1,657 1/14/2021
0.1.1 1,598 1/12/2021
0.1.0 1,661 1/9/2021
0.0.1 1,563 1/7/2021