Skip to content

Releases: benmccallum/fairybread

v4.1.1

20 Feb 16:32
Compare
Choose a tag to compare

Supports an unexpected breaking change in HotChocolate v11.0.9. Required a recompiled version of FairyBread against v11.0.9 of HotChocolate as the ContextData field of IField was removed and instead inherited from a new parent interface IHasReadOnlyContextData.

Fixes #37

v4.1.0

13 Feb 13:10
Compare
Choose a tag to compare

Simplifies setup.

Previously you needed to tell FairyBread about the assemblies to crawl for validators. Now it crawls the IServiceCollection at startup.

Before:

// Add the FluentValidation validators
services.AddValidatorsFromAssemblyContaining<FooInputDtoValidator>();

// Add GraphQL and FairyBread
services
    .AddGraphQL()
    .AddFairyBread(options =>
    {
        options.AssembliesToScanForValidators = new[] { typeof(FooInputDtoValidator).Assembly };
    });

Now:

// Add the FluentValidation validators
services.AddValidatorsFromAssemblyContaining<FooInputDtoValidator>();

// Add GraphQL and FairyBread
services
    .AddGraphQL()
    .AddFairyBread();

v4.0.0

30 Jan 15:38
Compare
Choose a tag to compare

This release changes the way validation errors are reported which results in a few breaking changes but gives us a lot more flexibility in the future.

Instead of collecting validation errors and then throwing an exception for an IErrorFilter to report the error, the validation errors are now passed over to a IValidationErrorsHandler (whose default implementation calls ReportError on each validation failure) and the middleware short-circuits.

Breaking changes:

  • Existing error filter removed.
    • To customize errors reported still you can substitute in your own IValidationErrorsHandler (potentially inheriting the default implementation and just overriding the CreateErrorBuilder, calling the base impl to create the default error and then the Set methods to customize some things).
  • The structure of the errors sent back has changed.
    • There's now (by default) an error item added per argument and per validation rule failure. If you want them grouped as before, you could do that also with a custom IValidationErrorsHandler and not loop over each like the default impl does.
  • IValidationErrorHandler removed (it wasn't doing anything and is replaced by IValidationErrorsHandler that does the error reporting; if anyone was using it, let me know and we can work out an alternative).

v3.0.1

25 Jan 10:24
Compare
Choose a tag to compare
Merge branch 'develop'

v3.0.0

30 Dec 19:32
Compare
Choose a tag to compare
Merge branch 'master' of https://github.com/benmccallum/fairybread

v2.0.0

30 Dec 19:31
Compare
Choose a tag to compare
2.0.0

v1.0.0

21 Nov 16:41
Compare
Choose a tag to compare
Merge branch 'develop'