graphql fluent validation implementation with middleware.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PoweredSoft.CQRS.GraphQL.Abstractions
|
||||
{
|
||||
public interface IGraphQLFieldError
|
||||
{
|
||||
string Field { get; set; }
|
||||
List<string> Errors { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PoweredSoft.CQRS.GraphQL.Abstractions
|
||||
{
|
||||
public interface IGraphQLValidationResult
|
||||
{
|
||||
bool IsValid { get; }
|
||||
|
||||
List<IGraphQLFieldError> Errors { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoweredSoft.CQRS.GraphQL.Abstractions
|
||||
{
|
||||
|
||||
public interface IGraphQLValidationService
|
||||
{
|
||||
Task<IGraphQLValidationResult> ValidateObjectAsync(object subject, CancellationToken cancellationToken = default);
|
||||
Task<IGraphQLValidationResult> ValidateAsync<T>(T subject, CancellationToken cancellationToken = default);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user