From c5e1997127e3790fcb4823849fd36534f3a57694 Mon Sep 17 00:00:00 2001 From: Jordan Phillips Date: Mon, 3 Jun 2024 20:44:14 +1000 Subject: [PATCH] fix: add + configure uint graphql scalar type --- .../Giantnodes.Infrastructure.GraphQL.csproj | 5 +++-- ...rConvention.cs => GiantnodesFilterConvention.cs} | 9 +++++++-- .../GraphQL/Scalars/CharOperationFilterInputType.cs | 2 +- src/Infrastructure/src/GraphQL/Scalars/CharType.cs | 2 +- .../Scalars/UnsignedIntOperationFilterInputType.cs | 13 +++++++++++++ ...rvice.Orchestrator.Application.Components.csproj | 2 +- .../Giantnodes.Service.Orchestrator.HttpApi.csproj | 8 ++++---- 7 files changed, 30 insertions(+), 11 deletions(-) rename src/Infrastructure/src/GraphQL/{Scalars/CharFilterConvention.cs => GiantnodesFilterConvention.cs} (51%) create mode 100644 src/Infrastructure/src/GraphQL/Scalars/UnsignedIntOperationFilterInputType.cs diff --git a/src/Infrastructure/src/GraphQL/Giantnodes.Infrastructure.GraphQL.csproj b/src/Infrastructure/src/GraphQL/Giantnodes.Infrastructure.GraphQL.csproj index da140585..fac47d11 100644 --- a/src/Infrastructure/src/GraphQL/Giantnodes.Infrastructure.GraphQL.csproj +++ b/src/Infrastructure/src/GraphQL/Giantnodes.Infrastructure.GraphQL.csproj @@ -7,8 +7,9 @@ - - + + + diff --git a/src/Infrastructure/src/GraphQL/Scalars/CharFilterConvention.cs b/src/Infrastructure/src/GraphQL/GiantnodesFilterConvention.cs similarity index 51% rename from src/Infrastructure/src/GraphQL/Scalars/CharFilterConvention.cs rename to src/Infrastructure/src/GraphQL/GiantnodesFilterConvention.cs index 4744a6b2..80d983f5 100644 --- a/src/Infrastructure/src/GraphQL/Scalars/CharFilterConvention.cs +++ b/src/Infrastructure/src/GraphQL/GiantnodesFilterConvention.cs @@ -1,8 +1,9 @@ +using Giantnodes.Infrastructure.GraphQL.Scalars; using HotChocolate.Data.Filters; -namespace Giantnodes.Infrastructure.GraphQL.Scalars; +namespace Giantnodes.Infrastructure.GraphQL; -public class CharFilterConvention : FilterConvention +public sealed class GiantnodesFilterConvention : FilterConvention { protected override void Configure(IFilterConventionDescriptor descriptor) { @@ -10,6 +11,10 @@ protected override void Configure(IFilterConventionDescriptor descriptor) descriptor.BindRuntimeType(); descriptor.BindRuntimeType(); + + descriptor.BindRuntimeType(); + descriptor.BindRuntimeType(); + descriptor.AddDefaults(); } } \ No newline at end of file diff --git a/src/Infrastructure/src/GraphQL/Scalars/CharOperationFilterInputType.cs b/src/Infrastructure/src/GraphQL/Scalars/CharOperationFilterInputType.cs index de21df32..844c776c 100644 --- a/src/Infrastructure/src/GraphQL/Scalars/CharOperationFilterInputType.cs +++ b/src/Infrastructure/src/GraphQL/Scalars/CharOperationFilterInputType.cs @@ -2,7 +2,7 @@ namespace Giantnodes.Infrastructure.GraphQL.Scalars; -public class CharOperationFilterInputType : ComparableOperationFilterInputType +public sealed class CharOperationFilterInputType : ComparableOperationFilterInputType { protected override void Configure(IFilterInputTypeDescriptor descriptor) { diff --git a/src/Infrastructure/src/GraphQL/Scalars/CharType.cs b/src/Infrastructure/src/GraphQL/Scalars/CharType.cs index ecda2085..b19a1d75 100644 --- a/src/Infrastructure/src/GraphQL/Scalars/CharType.cs +++ b/src/Infrastructure/src/GraphQL/Scalars/CharType.cs @@ -3,7 +3,7 @@ namespace Giantnodes.Infrastructure.GraphQL.Scalars; -public class CharType : ScalarType +public sealed class CharType : ScalarType { /// /// Initializes a new instance of the class. diff --git a/src/Infrastructure/src/GraphQL/Scalars/UnsignedIntOperationFilterInputType.cs b/src/Infrastructure/src/GraphQL/Scalars/UnsignedIntOperationFilterInputType.cs new file mode 100644 index 00000000..dea2b099 --- /dev/null +++ b/src/Infrastructure/src/GraphQL/Scalars/UnsignedIntOperationFilterInputType.cs @@ -0,0 +1,13 @@ +using HotChocolate.Data.Filters; +using HotChocolate.Types; + +namespace Giantnodes.Infrastructure.GraphQL.Scalars; + +public sealed class UnsignedIntOperationFilterInputType : ComparableOperationFilterInputType +{ + protected override void Configure(IFilterInputTypeDescriptor descriptor) + { + descriptor.Name("UnsignedIntOperationFilterInput"); + base.Configure(descriptor); + } +} \ No newline at end of file diff --git a/src/Service.Orchestrator/src/Application.Components/Giantnodes.Service.Orchestrator.Application.Components.csproj b/src/Service.Orchestrator/src/Application.Components/Giantnodes.Service.Orchestrator.Application.Components.csproj index b65d6564..a1becd19 100644 --- a/src/Service.Orchestrator/src/Application.Components/Giantnodes.Service.Orchestrator.Application.Components.csproj +++ b/src/Service.Orchestrator/src/Application.Components/Giantnodes.Service.Orchestrator.Application.Components.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/Service.Orchestrator/src/HttpApi/Giantnodes.Service.Orchestrator.HttpApi.csproj b/src/Service.Orchestrator/src/HttpApi/Giantnodes.Service.Orchestrator.HttpApi.csproj index a14ce367..48493a9f 100644 --- a/src/Service.Orchestrator/src/HttpApi/Giantnodes.Service.Orchestrator.HttpApi.csproj +++ b/src/Service.Orchestrator/src/HttpApi/Giantnodes.Service.Orchestrator.HttpApi.csproj @@ -14,10 +14,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive