From ffc5296977c7259813c305362f99e9102dbfb43b Mon Sep 17 00:00:00 2001 From: Richard Beauchamp Date: Sun, 6 Oct 2024 12:27:14 -0700 Subject: [PATCH 1/5] sp --- .vscode/settings.json | 1 + .vscode/tasks.json | 21 ++++++++++++++ example/LiveDocs.AppHost/Program.cs | 16 +++++++---- .../Model/GraphQLTestModel.cs | 28 +++++++++---------- 4 files changed, 47 insertions(+), 19 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..5d0b16c --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,21 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/RxDBDotNet.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile", + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} \ No newline at end of file diff --git a/example/LiveDocs.AppHost/Program.cs b/example/LiveDocs.AppHost/Program.cs index c856824..4c38577 100644 --- a/example/LiveDocs.AppHost/Program.cs +++ b/example/LiveDocs.AppHost/Program.cs @@ -1,5 +1,4 @@ -// example/LiveDocs.AppHost/Program.cs - +using System.Runtime.InteropServices; using Projects; var builder = DistributedApplication.CreateBuilder(args); @@ -7,12 +6,20 @@ var redis = builder.AddRedis("redis", 6379) .WithEndpoint(port: 6380, targetPort: 6379, name: "redis-endpoint"); +// Detect OS and architecture +var isArm64 = RuntimeInformation.ProcessArchitecture == Architecture.Arm64; +var sqlServerImage = isArm64 + ? "mcr.microsoft.com/azure-sql-edge:latest" + : "mcr.microsoft.com/mssql/server:2022-latest"; + // Add SQL Server var password = builder.AddParameter("sqlpassword", secret: true); var sqlDb = builder.AddSqlServer("sql", password: password, port: 1433) + .WithImage(sqlServerImage) .WithVolume("livedocs-sql-data", "/var/opt/mssql") .WithEndpoint(port: 1146, targetPort: 1433, name: "sql-endpoint") - .AddDatabase("sqldata", databaseName: "LiveDocsDb"); + .AddDatabase("sqldata", databaseName: "LiveDocsDb") + .WithEnvironment("ACCEPT_EULA", "Y"); // Set ACCEPT_EULA for all architectures builder.AddProject("replicationApi", "http") .WithReference(redis) @@ -27,5 +34,4 @@ .WithExternalHttpEndpoints(); } -await builder.Build() - .RunAsync(); +await builder.Build().RunAsync(); diff --git a/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs b/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs index 64429b3..9cb1064 100644 --- a/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs +++ b/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs @@ -1,20 +1,20 @@ // This file has been auto generated. #pragma warning disable 8618 -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Globalization; -using System.Linq; -using System.Reflection; -using System.Runtime.Serialization; -using System.Text; -using System.Text.RegularExpressions; -#if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -#endif +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Globalization; +using System.Linq; +using System.Reflection; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +#if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +#endif namespace RxDBDotNet.Tests.Model { From 9372e071cd1c541a8762b63478fcbf18ec3834e3 Mon Sep 17 00:00:00 2001 From: Richard Beauchamp Date: Sun, 6 Oct 2024 13:49:47 -0700 Subject: [PATCH 2/5] sp --- .../LiveDocs.AppHost/LiveDocs.AppHost.csproj | 2 +- example/LiveDocs.AppHost/Program.cs | 17 +- .../Data/LiveDocsDbContext.cs | 1 + .../Infrastructure/LiveDocsDbInitializer.cs | 2 + .../LiveDocs.GraphQLApi.csproj | 2 +- .../Models/Entities/LiveDoc.cs | 1 + .../Models/Entities/ReplicatedEntity.cs | 2 + .../Models/Entities/User.cs | 1 + .../Models/Replication/ReplicatedDocument.cs | 3 + .../Models/Replication/ReplicatedLiveDoc.cs | 1 + .../Models/Replication/ReplicatedUser.cs | 1 + example/LiveDocs.GraphQLApi/Program.cs | 6 + .../LiveDocs.GraphQLApi/Security/JwtUtil.cs | 2 + .../Services/DocumentService.cs | 5 + .../Services/LiveDocService.cs | 4 + .../Services/UserService.cs | 4 + .../Services/WorkspaceService.cs | 4 + .../Validations/JwtFormatAttribute.cs | 1 + .../Validations/NotDefaultAttribute.cs | 1 + .../Validations/TrimAttribute.cs | 1 + .../LiveDocs.ServiceDefaults/Extensions.cs | 1 + .../LiveDocs.ServiceDefaults.csproj | 2 +- .../Documents/IReplicatedDocument.cs | 3 + .../Extensions/DocumentExtensions.cs | 1 + .../Extensions/GraphQLBuilderExtensions.cs | 6 + .../Extensions/ReplicationOptions.cs | 3 + src/RxDBDotNet/Models/Checkpoint.cs | 3 + src/RxDBDotNet/Models/DocumentPullBulk.cs | 2 + src/RxDBDotNet/Resolvers/MutationResolver.cs | 5 + src/RxDBDotNet/Resolvers/QueryResolver.cs | 6 + .../Resolvers/SubscriptionResolver.cs | 6 + src/RxDBDotNet/RxDBDotNet.csproj | 2 +- .../Security/AuthorizationHelper.cs | 3 + src/RxDBDotNet/Security/DocumentOperation.cs | 3 + src/RxDBDotNet/Security/Operation.cs | 3 + src/RxDBDotNet/Security/SecurityOptions.cs | 3 + .../Security/WebSocketJwtAuthInterceptor.cs | 6 + .../Services/DefaultEventPublisher.cs | 4 + src/RxDBDotNet/Services/IDocumentService.cs | 6 + src/RxDBDotNet/Services/IEventPublisher.cs | 2 + .../GraphQlClientFactory.cs | 6 + .../NamingHelper.cs | 3 + .../RxDBDotNet.TestModelGenerator/Program.cs | 3 + .../RxDBDotNet.TestModelGenerator.csproj | 4 +- .../ScalarFieldTypeMappingProvider.cs | 2 + tests/RxDBDotNet.Tests.Setup/DbSetupUtil.cs | 6 +- .../RxDBDotNet.Tests.Setup/DockerSetupUtil.cs | 4 +- .../RxDBDotNet.Tests.Setup/RedisSetupUtil.cs | 6 +- .../RxDBDotNet.Tests.Setup.csproj | 4 +- tests/RxDBDotNet.Tests.Setup/Strings.cs | 3 + tests/RxDBDotNet.Tests.Setup/TestContext.cs | 6 + tests/RxDBDotNet.Tests.Setup/TestProgram.cs | 2 + .../TestScenarioBuilder.cs | 5 + .../AdditionalAuthorizationTests.cs | 9 + .../AdditionalCoverageTests.cs | 8 + .../BasicDocumentOperationsTests.cs | 7 + .../DocumentExtensionsTests.cs | 6 +- .../FieldErrors/AddFieldErrorTypesTests.cs | 11 + .../CustomTestErrorQueryBuilderGql.cs | 3 + .../FieldErrors/CustomTestException.cs | 3 + tests/RxDBDotNet.Tests/GlobalUsings.cs | 10 - .../Model/GraphQLTestModel.cs | 6688 ++++++++--------- .../MutationConventions/BookMutations.cs | 3 + .../MutationConventionTests.cs | 9 + tests/RxDBDotNet.Tests/PullDocumentsTests.cs | 5 + tests/RxDBDotNet.Tests/PushDocumentsTests.cs | 8 + .../RxDBDotNet.Tests/RxDBDotNet.Tests.csproj | 2 +- .../RxDBDotNet.Tests/SchemaGenerationTests.cs | 6 + tests/RxDBDotNet.Tests/SecurityTests.cs | 9 + tests/RxDBDotNet.Tests/SubscriptionTests.cs | 12 + .../Utils/DateTimeOffsetExtensions.cs | 3 + .../Utils/DockerSetupCollection.cs | 3 + .../Utils/GraphQLSubscriptionClient.cs | 8 + .../Utils/HttpClientExtensions.cs | 6 + tests/RxDBDotNet.Tests/Utils/TestUtils.cs | 12 + .../Utils/WebApplicationFactoryExtensions.cs | 4 + 76 files changed, 3649 insertions(+), 3371 deletions(-) delete mode 100644 tests/RxDBDotNet.Tests/GlobalUsings.cs diff --git a/example/LiveDocs.AppHost/LiveDocs.AppHost.csproj b/example/LiveDocs.AppHost/LiveDocs.AppHost.csproj index be6f371..849e8bc 100644 --- a/example/LiveDocs.AppHost/LiveDocs.AppHost.csproj +++ b/example/LiveDocs.AppHost/LiveDocs.AppHost.csproj @@ -17,7 +17,7 @@ true true true - enable + 9999 True $(NoWarn);CA1848;CA2007;MA0004 diff --git a/example/LiveDocs.AppHost/Program.cs b/example/LiveDocs.AppHost/Program.cs index 4c38577..61471e8 100644 --- a/example/LiveDocs.AppHost/Program.cs +++ b/example/LiveDocs.AppHost/Program.cs @@ -1,25 +1,34 @@ +// example/LiveDocs.AppHost/Program.cs +using System; using System.Runtime.InteropServices; +using Aspire.Hosting; using Projects; var builder = DistributedApplication.CreateBuilder(args); var redis = builder.AddRedis("redis", 6379) + .WithImage("redis") + .WithImageTag("latest") .WithEndpoint(port: 6380, targetPort: 6379, name: "redis-endpoint"); // Detect OS and architecture var isArm64 = RuntimeInformation.ProcessArchitecture == Architecture.Arm64; var sqlServerImage = isArm64 - ? "mcr.microsoft.com/azure-sql-edge:latest" - : "mcr.microsoft.com/mssql/server:2022-latest"; + ? "azure-sql-edge" + : "mssql/server"; +var sqlServerTag = isArm64 + ? "latest" + : "2022-latest"; // Add SQL Server var password = builder.AddParameter("sqlpassword", secret: true); var sqlDb = builder.AddSqlServer("sql", password: password, port: 1433) .WithImage(sqlServerImage) + .WithImageTag(sqlServerTag) + .WithEnvironment("ACCEPT_EULA", "Y") .WithVolume("livedocs-sql-data", "/var/opt/mssql") .WithEndpoint(port: 1146, targetPort: 1433, name: "sql-endpoint") - .AddDatabase("sqldata", databaseName: "LiveDocsDb") - .WithEnvironment("ACCEPT_EULA", "Y"); // Set ACCEPT_EULA for all architectures + .AddDatabase("sqldata", databaseName: "LiveDocsDb"); builder.AddProject("replicationApi", "http") .WithReference(redis) diff --git a/example/LiveDocs.GraphQLApi/Data/LiveDocsDbContext.cs b/example/LiveDocs.GraphQLApi/Data/LiveDocsDbContext.cs index 661aa1f..3716a5a 100644 --- a/example/LiveDocs.GraphQLApi/Data/LiveDocsDbContext.cs +++ b/example/LiveDocs.GraphQLApi/Data/LiveDocsDbContext.cs @@ -1,5 +1,6 @@ // example/LiveDocs.GraphQLApi/Data/LiveDocsDbContext.cs +using System; using LiveDocs.GraphQLApi.Infrastructure; using LiveDocs.GraphQLApi.Models.Entities; using Microsoft.EntityFrameworkCore; diff --git a/example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs b/example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs index 93f0f63..33d70e5 100644 --- a/example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs +++ b/example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs @@ -1,5 +1,7 @@ // example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs +using System; +using System.Threading.Tasks; using LiveDocs.GraphQLApi.Data; using LiveDocs.GraphQLApi.Models.Entities; using LiveDocs.GraphQLApi.Models.Replication; diff --git a/example/LiveDocs.GraphQLApi/LiveDocs.GraphQLApi.csproj b/example/LiveDocs.GraphQLApi/LiveDocs.GraphQLApi.csproj index 4384856..b29bb8c 100644 --- a/example/LiveDocs.GraphQLApi/LiveDocs.GraphQLApi.csproj +++ b/example/LiveDocs.GraphQLApi/LiveDocs.GraphQLApi.csproj @@ -14,7 +14,7 @@ true true true - enable + 9999 True $(NoWarn);CA1848;CA2007;CA1716;MA0004 diff --git a/example/LiveDocs.GraphQLApi/Models/Entities/LiveDoc.cs b/example/LiveDocs.GraphQLApi/Models/Entities/LiveDoc.cs index 5867450..2324e9c 100644 --- a/example/LiveDocs.GraphQLApi/Models/Entities/LiveDoc.cs +++ b/example/LiveDocs.GraphQLApi/Models/Entities/LiveDoc.cs @@ -1,5 +1,6 @@ // example/LiveDocs.GraphQLApi/Models/Entities/LiveDoc.cs +using System; using System.ComponentModel.DataAnnotations; namespace LiveDocs.GraphQLApi.Models.Entities; diff --git a/example/LiveDocs.GraphQLApi/Models/Entities/ReplicatedEntity.cs b/example/LiveDocs.GraphQLApi/Models/Entities/ReplicatedEntity.cs index 07a1367..5fe3da2 100644 --- a/example/LiveDocs.GraphQLApi/Models/Entities/ReplicatedEntity.cs +++ b/example/LiveDocs.GraphQLApi/Models/Entities/ReplicatedEntity.cs @@ -1,5 +1,7 @@ // example/LiveDocs.GraphQLApi/Models/Entities/ReplicatedEntity.cs +using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace LiveDocs.GraphQLApi.Models.Entities; diff --git a/example/LiveDocs.GraphQLApi/Models/Entities/User.cs b/example/LiveDocs.GraphQLApi/Models/Entities/User.cs index 284ea8d..9ded802 100644 --- a/example/LiveDocs.GraphQLApi/Models/Entities/User.cs +++ b/example/LiveDocs.GraphQLApi/Models/Entities/User.cs @@ -1,5 +1,6 @@ // example/LiveDocs.GraphQLApi/Models/Entities/User.cs +using System; using System.ComponentModel.DataAnnotations; using LiveDocs.GraphQLApi.Security; using LiveDocs.GraphQLApi.Validations; diff --git a/example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedDocument.cs b/example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedDocument.cs index 7f4787f..21c7cfe 100644 --- a/example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedDocument.cs +++ b/example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedDocument.cs @@ -1,6 +1,9 @@ // example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedDocument.cs +using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Linq; using LiveDocs.GraphQLApi.Validations; using RxDBDotNet.Documents; diff --git a/example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedLiveDoc.cs b/example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedLiveDoc.cs index a0fdbda..8fa5dd2 100644 --- a/example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedLiveDoc.cs +++ b/example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedLiveDoc.cs @@ -1,5 +1,6 @@ // example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedLiveDoc.cs +using System; using System.ComponentModel.DataAnnotations; using HotChocolate; using LiveDocs.GraphQLApi.Validations; diff --git a/example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedUser.cs b/example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedUser.cs index bacab8a..4bb3977 100644 --- a/example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedUser.cs +++ b/example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedUser.cs @@ -1,5 +1,6 @@ // example/LiveDocs.GraphQLApi/Models/Replication/ReplicatedUser.cs +using System; using System.ComponentModel.DataAnnotations; using HotChocolate; using HotChocolate.Types; diff --git a/example/LiveDocs.GraphQLApi/Program.cs b/example/LiveDocs.GraphQLApi/Program.cs index 324d369..7cd311b 100644 --- a/example/LiveDocs.GraphQLApi/Program.cs +++ b/example/LiveDocs.GraphQLApi/Program.cs @@ -1,7 +1,9 @@ // example/LiveDocs.GraphQLApi/Program.cs +using System; using System.Net; using System.Security.Claims; +using System.Threading.Tasks; using HotChocolate.AspNetCore; using LiveDocs.GraphQLApi.Data; using LiveDocs.GraphQLApi.Infrastructure; @@ -10,6 +12,10 @@ using LiveDocs.GraphQLApi.Services; using LiveDocs.ServiceDefaults; using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using RxDBDotNet.Extensions; using RxDBDotNet.Security; using RxDBDotNet.Services; diff --git a/example/LiveDocs.GraphQLApi/Security/JwtUtil.cs b/example/LiveDocs.GraphQLApi/Security/JwtUtil.cs index a21b6a8..811de65 100644 --- a/example/LiveDocs.GraphQLApi/Security/JwtUtil.cs +++ b/example/LiveDocs.GraphQLApi/Security/JwtUtil.cs @@ -1,5 +1,7 @@ // example/LiveDocs.GraphQLApi/Security/JwtUtil.cs +using System; +using System.Collections.Generic; using System.Globalization; using System.IdentityModel.Tokens.Jwt; using System.Security.Claims; diff --git a/example/LiveDocs.GraphQLApi/Services/DocumentService.cs b/example/LiveDocs.GraphQLApi/Services/DocumentService.cs index 36d89cf..365be6a 100644 --- a/example/LiveDocs.GraphQLApi/Services/DocumentService.cs +++ b/example/LiveDocs.GraphQLApi/Services/DocumentService.cs @@ -1,5 +1,10 @@ // example/LiveDocs.GraphQLApi/Services/DocumentService.cs +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; using LiveDocs.GraphQLApi.Data; using LiveDocs.GraphQLApi.Models.Entities; using Microsoft.EntityFrameworkCore; diff --git a/example/LiveDocs.GraphQLApi/Services/LiveDocService.cs b/example/LiveDocs.GraphQLApi/Services/LiveDocService.cs index 421ac43..f5f392a 100644 --- a/example/LiveDocs.GraphQLApi/Services/LiveDocService.cs +++ b/example/LiveDocs.GraphQLApi/Services/LiveDocService.cs @@ -1,5 +1,9 @@ // example/LiveDocs.GraphQLApi/Services/LiveDocService.cs +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; using LiveDocs.GraphQLApi.Data; using LiveDocs.GraphQLApi.Models.Entities; using LiveDocs.GraphQLApi.Models.Replication; diff --git a/example/LiveDocs.GraphQLApi/Services/UserService.cs b/example/LiveDocs.GraphQLApi/Services/UserService.cs index 63bf4aa..6fcd065 100644 --- a/example/LiveDocs.GraphQLApi/Services/UserService.cs +++ b/example/LiveDocs.GraphQLApi/Services/UserService.cs @@ -1,5 +1,9 @@ // example/LiveDocs.GraphQLApi/Services/UserService.cs +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; using LiveDocs.GraphQLApi.Data; using LiveDocs.GraphQLApi.Models.Entities; using LiveDocs.GraphQLApi.Models.Replication; diff --git a/example/LiveDocs.GraphQLApi/Services/WorkspaceService.cs b/example/LiveDocs.GraphQLApi/Services/WorkspaceService.cs index 0c8a23d..7628d88 100644 --- a/example/LiveDocs.GraphQLApi/Services/WorkspaceService.cs +++ b/example/LiveDocs.GraphQLApi/Services/WorkspaceService.cs @@ -1,5 +1,9 @@ // example/LiveDocs.GraphQLApi/Services/WorkspaceService.cs +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; using LiveDocs.GraphQLApi.Data; using LiveDocs.GraphQLApi.Models.Entities; using LiveDocs.GraphQLApi.Models.Replication; diff --git a/example/LiveDocs.GraphQLApi/Validations/JwtFormatAttribute.cs b/example/LiveDocs.GraphQLApi/Validations/JwtFormatAttribute.cs index 3a20a9a..0055d15 100644 --- a/example/LiveDocs.GraphQLApi/Validations/JwtFormatAttribute.cs +++ b/example/LiveDocs.GraphQLApi/Validations/JwtFormatAttribute.cs @@ -1,5 +1,6 @@ // example/LiveDocs.GraphQLApi/Validations/JwtFormatAttribute.cs +using System; using System.ComponentModel.DataAnnotations; using System.IdentityModel.Tokens.Jwt; diff --git a/example/LiveDocs.GraphQLApi/Validations/NotDefaultAttribute.cs b/example/LiveDocs.GraphQLApi/Validations/NotDefaultAttribute.cs index 349aac5..ac04e6a 100644 --- a/example/LiveDocs.GraphQLApi/Validations/NotDefaultAttribute.cs +++ b/example/LiveDocs.GraphQLApi/Validations/NotDefaultAttribute.cs @@ -1,5 +1,6 @@ // example/LiveDocs.GraphQLApi/Validations/NotDefaultAttribute.cs +using System; using System.ComponentModel.DataAnnotations; namespace LiveDocs.GraphQLApi.Validations; diff --git a/example/LiveDocs.GraphQLApi/Validations/TrimAttribute.cs b/example/LiveDocs.GraphQLApi/Validations/TrimAttribute.cs index 94e8649..b47165d 100644 --- a/example/LiveDocs.GraphQLApi/Validations/TrimAttribute.cs +++ b/example/LiveDocs.GraphQLApi/Validations/TrimAttribute.cs @@ -1,5 +1,6 @@ // example/LiveDocs.GraphQLApi/Validations/TrimAttribute.cs +using System; using System.ComponentModel.DataAnnotations; namespace LiveDocs.GraphQLApi.Validations; diff --git a/example/LiveDocs.ServiceDefaults/Extensions.cs b/example/LiveDocs.ServiceDefaults/Extensions.cs index 2122ecb..d5dd66c 100644 --- a/example/LiveDocs.ServiceDefaults/Extensions.cs +++ b/example/LiveDocs.ServiceDefaults/Extensions.cs @@ -1,5 +1,6 @@ // example/LiveDocs.ServiceDefaults/Extensions.cs +using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.Extensions.DependencyInjection; diff --git a/example/LiveDocs.ServiceDefaults/LiveDocs.ServiceDefaults.csproj b/example/LiveDocs.ServiceDefaults/LiveDocs.ServiceDefaults.csproj index 92546dd..a1c420e 100644 --- a/example/LiveDocs.ServiceDefaults/LiveDocs.ServiceDefaults.csproj +++ b/example/LiveDocs.ServiceDefaults/LiveDocs.ServiceDefaults.csproj @@ -15,7 +15,7 @@ true true true - enable + 9999 True diff --git a/src/RxDBDotNet/Documents/IReplicatedDocument.cs b/src/RxDBDotNet/Documents/IReplicatedDocument.cs index 33e1387..4c6577b 100644 --- a/src/RxDBDotNet/Documents/IReplicatedDocument.cs +++ b/src/RxDBDotNet/Documents/IReplicatedDocument.cs @@ -1,5 +1,8 @@ // src\RxDBDotNet\Documents\IReplicatedDocument.cs +using System; +using System.Collections.Generic; + namespace RxDBDotNet.Documents; /// diff --git a/src/RxDBDotNet/Extensions/DocumentExtensions.cs b/src/RxDBDotNet/Extensions/DocumentExtensions.cs index f7a0e36..84a777d 100644 --- a/src/RxDBDotNet/Extensions/DocumentExtensions.cs +++ b/src/RxDBDotNet/Extensions/DocumentExtensions.cs @@ -1,5 +1,6 @@ // src\RxDBDotNet\Extensions\DocumentExtensions.cs using System.Reflection; +using HotChocolate; using RxDBDotNet.Documents; namespace RxDBDotNet.Extensions; diff --git a/src/RxDBDotNet/Extensions/GraphQLBuilderExtensions.cs b/src/RxDBDotNet/Extensions/GraphQLBuilderExtensions.cs index a8e25a4..dc06e1c 100644 --- a/src/RxDBDotNet/Extensions/GraphQLBuilderExtensions.cs +++ b/src/RxDBDotNet/Extensions/GraphQLBuilderExtensions.cs @@ -1,8 +1,14 @@ // src\RxDBDotNet\Extensions\GraphQLBuilderExtensions.cs + +using System; +using System.Collections.Generic; +using System.Linq; using System.Security.Authentication; +using HotChocolate; using HotChocolate.Execution.Configuration; using HotChocolate.Language; using HotChocolate.Subscriptions; +using HotChocolate.Types; using Microsoft.Extensions.DependencyInjection; using RxDBDotNet.Documents; using RxDBDotNet.Models; diff --git a/src/RxDBDotNet/Extensions/ReplicationOptions.cs b/src/RxDBDotNet/Extensions/ReplicationOptions.cs index 74b4e65..27236bb 100644 --- a/src/RxDBDotNet/Extensions/ReplicationOptions.cs +++ b/src/RxDBDotNet/Extensions/ReplicationOptions.cs @@ -1,4 +1,7 @@ // src\RxDBDotNet\Extensions\ReplicationOptions.cs + +using System; +using System.Collections.Generic; using RxDBDotNet.Documents; using RxDBDotNet.Security; diff --git a/src/RxDBDotNet/Models/Checkpoint.cs b/src/RxDBDotNet/Models/Checkpoint.cs index 7a1e2ec..c56ce91 100644 --- a/src/RxDBDotNet/Models/Checkpoint.cs +++ b/src/RxDBDotNet/Models/Checkpoint.cs @@ -1,4 +1,7 @@ // src\RxDBDotNet\Models\Checkpoint.cs + +using System; + namespace RxDBDotNet.Models; /// diff --git a/src/RxDBDotNet/Models/DocumentPullBulk.cs b/src/RxDBDotNet/Models/DocumentPullBulk.cs index 015220a..f8540bd 100644 --- a/src/RxDBDotNet/Models/DocumentPullBulk.cs +++ b/src/RxDBDotNet/Models/DocumentPullBulk.cs @@ -1,4 +1,6 @@ // src\RxDBDotNet\Models\DocumentPullBulk.cs + +using System.Collections.Generic; using RxDBDotNet.Documents; namespace RxDBDotNet.Models; diff --git a/src/RxDBDotNet/Resolvers/MutationResolver.cs b/src/RxDBDotNet/Resolvers/MutationResolver.cs index f78717e..7d44d7d 100644 --- a/src/RxDBDotNet/Resolvers/MutationResolver.cs +++ b/src/RxDBDotNet/Resolvers/MutationResolver.cs @@ -1,5 +1,10 @@ // src\RxDBDotNet\Resolvers\MutationResolver.cs + +using System; +using System.Collections.Generic; using System.Security.Claims; +using System.Threading; +using System.Threading.Tasks; using RxDBDotNet.Documents; using RxDBDotNet.Models; using RxDBDotNet.Security; diff --git a/src/RxDBDotNet/Resolvers/QueryResolver.cs b/src/RxDBDotNet/Resolvers/QueryResolver.cs index b879496..c41b4fb 100644 --- a/src/RxDBDotNet/Resolvers/QueryResolver.cs +++ b/src/RxDBDotNet/Resolvers/QueryResolver.cs @@ -1,4 +1,10 @@ // src\RxDBDotNet\Resolvers\QueryResolver.cs + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using HotChocolate.Data; using HotChocolate.Execution; using HotChocolate.Resolvers; using RxDBDotNet.Documents; diff --git a/src/RxDBDotNet/Resolvers/SubscriptionResolver.cs b/src/RxDBDotNet/Resolvers/SubscriptionResolver.cs index d0cd4b9..648eccf 100644 --- a/src/RxDBDotNet/Resolvers/SubscriptionResolver.cs +++ b/src/RxDBDotNet/Resolvers/SubscriptionResolver.cs @@ -1,5 +1,11 @@ // src\RxDBDotNet\Resolvers\SubscriptionResolver.cs + +using System; +using System.Collections.Generic; +using System.Linq; using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; using HotChocolate.Execution; using HotChocolate.Subscriptions; using RxDBDotNet.Documents; diff --git a/src/RxDBDotNet/RxDBDotNet.csproj b/src/RxDBDotNet/RxDBDotNet.csproj index 7c4f7cc..d9cdbbd 100644 --- a/src/RxDBDotNet/RxDBDotNet.csproj +++ b/src/RxDBDotNet/RxDBDotNet.csproj @@ -13,7 +13,7 @@ true true true - enable + 9999 True $(NoWarn);CA1848;NU5104;RCS1181;RCS1154 diff --git a/src/RxDBDotNet/Security/AuthorizationHelper.cs b/src/RxDBDotNet/Security/AuthorizationHelper.cs index c1a0740..1edce00 100644 --- a/src/RxDBDotNet/Security/AuthorizationHelper.cs +++ b/src/RxDBDotNet/Security/AuthorizationHelper.cs @@ -1,6 +1,9 @@ // src\RxDBDotNet\Security\AuthorizationHelper.cs + +using System; using System.Security.Authentication; using System.Security.Claims; +using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using RxDBDotNet.Documents; diff --git a/src/RxDBDotNet/Security/DocumentOperation.cs b/src/RxDBDotNet/Security/DocumentOperation.cs index 953eef1..dd8dfa3 100644 --- a/src/RxDBDotNet/Security/DocumentOperation.cs +++ b/src/RxDBDotNet/Security/DocumentOperation.cs @@ -1,4 +1,7 @@ // src\RxDBDotNet\Security\DocumentOperation.cs + +using System; + namespace RxDBDotNet.Security; /// diff --git a/src/RxDBDotNet/Security/Operation.cs b/src/RxDBDotNet/Security/Operation.cs index 2ab952c..26819e5 100644 --- a/src/RxDBDotNet/Security/Operation.cs +++ b/src/RxDBDotNet/Security/Operation.cs @@ -1,5 +1,8 @@ // src\RxDBDotNet\Security\Operation.cs + +using System; using System.Text.Json.Serialization; +using HotChocolate; namespace RxDBDotNet.Security; diff --git a/src/RxDBDotNet/Security/SecurityOptions.cs b/src/RxDBDotNet/Security/SecurityOptions.cs index 85401c9..81a66aa 100644 --- a/src/RxDBDotNet/Security/SecurityOptions.cs +++ b/src/RxDBDotNet/Security/SecurityOptions.cs @@ -1,4 +1,7 @@ // src\RxDBDotNet\Security\SecurityOptions.cs + +using System; +using System.Collections.Generic; using RxDBDotNet.Documents; namespace RxDBDotNet.Security; diff --git a/src/RxDBDotNet/Security/WebSocketJwtAuthInterceptor.cs b/src/RxDBDotNet/Security/WebSocketJwtAuthInterceptor.cs index b8672a0..1060bfb 100644 --- a/src/RxDBDotNet/Security/WebSocketJwtAuthInterceptor.cs +++ b/src/RxDBDotNet/Security/WebSocketJwtAuthInterceptor.cs @@ -1,5 +1,11 @@ // src\RxDBDotNet\Security\WebSocketJwtAuthInterceptor.cs + +using System; +using System.Collections.Generic; +using System.Linq; using System.Security.Claims; +using System.Threading; +using System.Threading.Tasks; using HotChocolate.AspNetCore; using HotChocolate.AspNetCore.Subscriptions; using HotChocolate.AspNetCore.Subscriptions.Protocols; diff --git a/src/RxDBDotNet/Services/DefaultEventPublisher.cs b/src/RxDBDotNet/Services/DefaultEventPublisher.cs index 42d7a80..fdb6fb7 100644 --- a/src/RxDBDotNet/Services/DefaultEventPublisher.cs +++ b/src/RxDBDotNet/Services/DefaultEventPublisher.cs @@ -1,4 +1,8 @@ // src\RxDBDotNet\Services\DefaultEventPublisher.cs + +using System; +using System.Threading; +using System.Threading.Tasks; using HotChocolate.Subscriptions; using RxDBDotNet.Documents; using RxDBDotNet.Models; diff --git a/src/RxDBDotNet/Services/IDocumentService.cs b/src/RxDBDotNet/Services/IDocumentService.cs index aff5ad7..c3cba2b 100644 --- a/src/RxDBDotNet/Services/IDocumentService.cs +++ b/src/RxDBDotNet/Services/IDocumentService.cs @@ -1,4 +1,10 @@ // src\RxDBDotNet\Services\IDocumentService.cs + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; using RxDBDotNet.Documents; namespace RxDBDotNet.Services; diff --git a/src/RxDBDotNet/Services/IEventPublisher.cs b/src/RxDBDotNet/Services/IEventPublisher.cs index 3961a65..af9f06e 100644 --- a/src/RxDBDotNet/Services/IEventPublisher.cs +++ b/src/RxDBDotNet/Services/IEventPublisher.cs @@ -1,5 +1,7 @@ // src\RxDBDotNet\Services\IEventPublisher.cs +using System.Threading; +using System.Threading.Tasks; using RxDBDotNet.Documents; namespace RxDBDotNet.Services; diff --git a/tests/RxDBDotNet.TestModelGenerator/GraphQlClientFactory.cs b/tests/RxDBDotNet.TestModelGenerator/GraphQlClientFactory.cs index 59e8195..84a4adc 100644 --- a/tests/RxDBDotNet.TestModelGenerator/GraphQlClientFactory.cs +++ b/tests/RxDBDotNet.TestModelGenerator/GraphQlClientFactory.cs @@ -1,5 +1,11 @@ // tests\RxDBDotNet.TestModelGenerator\GraphQlClientFactory.cs + +using System; +using System.IO; +using System.Linq; +using System.Net.Http; using System.Text; +using System.Threading.Tasks; using GraphQlClientGenerator; using Newtonsoft.Json; diff --git a/tests/RxDBDotNet.TestModelGenerator/NamingHelper.cs b/tests/RxDBDotNet.TestModelGenerator/NamingHelper.cs index 67f4bc0..9a5a6a7 100644 --- a/tests/RxDBDotNet.TestModelGenerator/NamingHelper.cs +++ b/tests/RxDBDotNet.TestModelGenerator/NamingHelper.cs @@ -1,5 +1,8 @@ // tests\RxDBDotNet.TestModelGenerator\NamingHelper.cs + +using System; using System.Globalization; +using System.Linq; using System.Text.RegularExpressions; namespace RxDBDotNet.TestModelGenerator; diff --git a/tests/RxDBDotNet.TestModelGenerator/Program.cs b/tests/RxDBDotNet.TestModelGenerator/Program.cs index a52229c..789e99e 100644 --- a/tests/RxDBDotNet.TestModelGenerator/Program.cs +++ b/tests/RxDBDotNet.TestModelGenerator/Program.cs @@ -1,4 +1,7 @@ // tests\RxDBDotNet.TestModelGenerator\Program.cs + +using System; +using System.Threading.Tasks; using RxDBDotNet.Tests.Setup; namespace RxDBDotNet.TestModelGenerator; diff --git a/tests/RxDBDotNet.TestModelGenerator/RxDBDotNet.TestModelGenerator.csproj b/tests/RxDBDotNet.TestModelGenerator/RxDBDotNet.TestModelGenerator.csproj index 34290ca..16938a1 100644 --- a/tests/RxDBDotNet.TestModelGenerator/RxDBDotNet.TestModelGenerator.csproj +++ b/tests/RxDBDotNet.TestModelGenerator/RxDBDotNet.TestModelGenerator.csproj @@ -3,7 +3,7 @@ Exe net8.0 - enable + enable strict true @@ -16,7 +16,7 @@ true true true - enable + 9999 True $(NoWarn);CA1848;NU5104;RCS1181;MA0004;CA2234;CA2007;MA0009 diff --git a/tests/RxDBDotNet.TestModelGenerator/ScalarFieldTypeMappingProvider.cs b/tests/RxDBDotNet.TestModelGenerator/ScalarFieldTypeMappingProvider.cs index 8e90dcf..ec3819f 100644 --- a/tests/RxDBDotNet.TestModelGenerator/ScalarFieldTypeMappingProvider.cs +++ b/tests/RxDBDotNet.TestModelGenerator/ScalarFieldTypeMappingProvider.cs @@ -1,4 +1,6 @@ // tests\RxDBDotNet.TestModelGenerator\ScalarFieldTypeMappingProvider.cs + +using System; using System.Text.Json; using GraphQlClientGenerator; using LiveDocs.GraphQLApi.Security; diff --git a/tests/RxDBDotNet.Tests.Setup/DbSetupUtil.cs b/tests/RxDBDotNet.Tests.Setup/DbSetupUtil.cs index 7483e19..1981046 100644 --- a/tests/RxDBDotNet.Tests.Setup/DbSetupUtil.cs +++ b/tests/RxDBDotNet.Tests.Setup/DbSetupUtil.cs @@ -1,4 +1,8 @@ -using Docker.DotNet.Models; +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Docker.DotNet.Models; using Docker.DotNet; using LiveDocs.GraphQLApi.Infrastructure; using Testcontainers.MsSql; diff --git a/tests/RxDBDotNet.Tests.Setup/DockerSetupUtil.cs b/tests/RxDBDotNet.Tests.Setup/DockerSetupUtil.cs index f8b6a92..1abcf4f 100644 --- a/tests/RxDBDotNet.Tests.Setup/DockerSetupUtil.cs +++ b/tests/RxDBDotNet.Tests.Setup/DockerSetupUtil.cs @@ -1,4 +1,6 @@ -using Xunit; +using System; +using System.Threading.Tasks; +using Xunit; namespace RxDBDotNet.Tests.Setup; diff --git a/tests/RxDBDotNet.Tests.Setup/RedisSetupUtil.cs b/tests/RxDBDotNet.Tests.Setup/RedisSetupUtil.cs index 408409a..dd152e2 100644 --- a/tests/RxDBDotNet.Tests.Setup/RedisSetupUtil.cs +++ b/tests/RxDBDotNet.Tests.Setup/RedisSetupUtil.cs @@ -1,4 +1,8 @@ -using Docker.DotNet; +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Docker.DotNet; using Docker.DotNet.Models; using Testcontainers.Redis; diff --git a/tests/RxDBDotNet.Tests.Setup/RxDBDotNet.Tests.Setup.csproj b/tests/RxDBDotNet.Tests.Setup/RxDBDotNet.Tests.Setup.csproj index 8b34865..a9d6da0 100644 --- a/tests/RxDBDotNet.Tests.Setup/RxDBDotNet.Tests.Setup.csproj +++ b/tests/RxDBDotNet.Tests.Setup/RxDBDotNet.Tests.Setup.csproj @@ -3,7 +3,7 @@ Exe net8.0 - enable + enable strict true @@ -16,7 +16,7 @@ true true true - enable + 9999 True $(NoWarn);CA1848;NU5104;RCS1181;MA0004;CA2007;CA1711;CA1062 diff --git a/tests/RxDBDotNet.Tests.Setup/Strings.cs b/tests/RxDBDotNet.Tests.Setup/Strings.cs index 34c84cb..1852c99 100644 --- a/tests/RxDBDotNet.Tests.Setup/Strings.cs +++ b/tests/RxDBDotNet.Tests.Setup/Strings.cs @@ -1,4 +1,7 @@ // tests\RxDBDotNet.Tests.Setup\Strings.cs + +using System; + namespace RxDBDotNet.Tests.Setup; public static class Strings diff --git a/tests/RxDBDotNet.Tests.Setup/TestContext.cs b/tests/RxDBDotNet.Tests.Setup/TestContext.cs index 10946d1..5f2c337 100644 --- a/tests/RxDBDotNet.Tests.Setup/TestContext.cs +++ b/tests/RxDBDotNet.Tests.Setup/TestContext.cs @@ -1,4 +1,10 @@ // tests\RxDBDotNet.Tests.Setup\TestContext.cs + +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Testing; namespace RxDBDotNet.Tests.Setup; diff --git a/tests/RxDBDotNet.Tests.Setup/TestProgram.cs b/tests/RxDBDotNet.Tests.Setup/TestProgram.cs index 978a2ae..f233dcb 100644 --- a/tests/RxDBDotNet.Tests.Setup/TestProgram.cs +++ b/tests/RxDBDotNet.Tests.Setup/TestProgram.cs @@ -1,4 +1,6 @@ // tests\RxDBDotNet.Tests.Setup\TestProgram.cs + +using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.Logging; diff --git a/tests/RxDBDotNet.Tests.Setup/TestScenarioBuilder.cs b/tests/RxDBDotNet.Tests.Setup/TestScenarioBuilder.cs index 934c299..efb0710 100644 --- a/tests/RxDBDotNet.Tests.Setup/TestScenarioBuilder.cs +++ b/tests/RxDBDotNet.Tests.Setup/TestScenarioBuilder.cs @@ -1,7 +1,12 @@ // tests\RxDBDotNet.Tests.Setup\TestScenarioBuilder.cs + +using System; +using System.Collections.Generic; using System.Diagnostics; using System.Net; using System.Security.Claims; +using System.Threading; +using System.Threading.Tasks; using HotChocolate.AspNetCore; using HotChocolate.Execution.Configuration; using HotChocolate.Execution.Options; diff --git a/tests/RxDBDotNet.Tests/AdditionalAuthorizationTests.cs b/tests/RxDBDotNet.Tests/AdditionalAuthorizationTests.cs index d664a46..d2c30ec 100644 --- a/tests/RxDBDotNet.Tests/AdditionalAuthorizationTests.cs +++ b/tests/RxDBDotNet.Tests/AdditionalAuthorizationTests.cs @@ -1,6 +1,15 @@ // tests\RxDBDotNet.Tests\AdditionalAuthorizationTests.cs + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using LiveDocs.GraphQLApi.Models.Replication; using LiveDocs.GraphQLApi.Security; +using RT.Comb; using RxDBDotNet.Tests.Model; +using RxDBDotNet.Tests.Setup; using RxDBDotNet.Tests.Utils; namespace RxDBDotNet.Tests; diff --git a/tests/RxDBDotNet.Tests/AdditionalCoverageTests.cs b/tests/RxDBDotNet.Tests/AdditionalCoverageTests.cs index 833b7dc..36c2bcc 100644 --- a/tests/RxDBDotNet.Tests/AdditionalCoverageTests.cs +++ b/tests/RxDBDotNet.Tests/AdditionalCoverageTests.cs @@ -1,6 +1,14 @@ // tests\RxDBDotNet.Tests\AdditionalCoverageTests.cs + +using System; +using System.Collections.Generic; using System.Diagnostics; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using FluentAssertions; using RxDBDotNet.Tests.Model; +using RxDBDotNet.Tests.Setup; using RxDBDotNet.Tests.Utils; namespace RxDBDotNet.Tests; diff --git a/tests/RxDBDotNet.Tests/BasicDocumentOperationsTests.cs b/tests/RxDBDotNet.Tests/BasicDocumentOperationsTests.cs index 97e9245..6bacbb5 100644 --- a/tests/RxDBDotNet.Tests/BasicDocumentOperationsTests.cs +++ b/tests/RxDBDotNet.Tests/BasicDocumentOperationsTests.cs @@ -1,5 +1,12 @@ // tests\RxDBDotNet.Tests\BasicDocumentOperationsTests.cs + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using FluentAssertions; +using RT.Comb; using RxDBDotNet.Tests.Model; +using RxDBDotNet.Tests.Setup; using RxDBDotNet.Tests.Utils; namespace RxDBDotNet.Tests; diff --git a/tests/RxDBDotNet.Tests/DocumentExtensionsTests.cs b/tests/RxDBDotNet.Tests/DocumentExtensionsTests.cs index cca4200..1ee1e0c 100644 --- a/tests/RxDBDotNet.Tests/DocumentExtensionsTests.cs +++ b/tests/RxDBDotNet.Tests/DocumentExtensionsTests.cs @@ -1,5 +1,9 @@ -using HotChocolate; +using System; +using System.Collections.Generic; +using FluentAssertions; +using HotChocolate; using RxDBDotNet.Documents; +using RxDBDotNet.Extensions; namespace RxDBDotNet.Tests { diff --git a/tests/RxDBDotNet.Tests/FieldErrors/AddFieldErrorTypesTests.cs b/tests/RxDBDotNet.Tests/FieldErrors/AddFieldErrorTypesTests.cs index 140b9d1..3b95088 100644 --- a/tests/RxDBDotNet.Tests/FieldErrors/AddFieldErrorTypesTests.cs +++ b/tests/RxDBDotNet.Tests/FieldErrors/AddFieldErrorTypesTests.cs @@ -1,8 +1,19 @@ // tests\RxDBDotNet.Tests\FieldErrors\AddFieldErrorTypesTests.cs + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using FluentAssertions; +using LiveDocs.GraphQLApi.Models.Replication; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Moq; +using RT.Comb; using RxDBDotNet.Services; using RxDBDotNet.Tests.Model; +using RxDBDotNet.Tests.Setup; using RxDBDotNet.Tests.Utils; namespace RxDBDotNet.Tests.FieldErrors; diff --git a/tests/RxDBDotNet.Tests/FieldErrors/CustomTestErrorQueryBuilderGql.cs b/tests/RxDBDotNet.Tests/FieldErrors/CustomTestErrorQueryBuilderGql.cs index 5079237..ff1f7b0 100644 --- a/tests/RxDBDotNet.Tests/FieldErrors/CustomTestErrorQueryBuilderGql.cs +++ b/tests/RxDBDotNet.Tests/FieldErrors/CustomTestErrorQueryBuilderGql.cs @@ -1,4 +1,7 @@ // tests\RxDBDotNet.Tests\FieldErrors\CustomTestErrorQueryBuilderGql.cs + +using System.Collections.Generic; + namespace RxDBDotNet.Tests.Model; public class CustomTestErrorQueryBuilderGql : GraphQlQueryBuilder diff --git a/tests/RxDBDotNet.Tests/FieldErrors/CustomTestException.cs b/tests/RxDBDotNet.Tests/FieldErrors/CustomTestException.cs index bfca5f3..3b6de8d 100644 --- a/tests/RxDBDotNet.Tests/FieldErrors/CustomTestException.cs +++ b/tests/RxDBDotNet.Tests/FieldErrors/CustomTestException.cs @@ -1,4 +1,7 @@ // tests\RxDBDotNet.Tests\FieldErrors\CustomTestException.cs + +using System; + namespace RxDBDotNet.Tests.Model; public class CustomTestException : Exception diff --git a/tests/RxDBDotNet.Tests/GlobalUsings.cs b/tests/RxDBDotNet.Tests/GlobalUsings.cs deleted file mode 100644 index 85f9a55..0000000 --- a/tests/RxDBDotNet.Tests/GlobalUsings.cs +++ /dev/null @@ -1,10 +0,0 @@ -// tests\RxDBDotNet.Tests\GlobalUsings.cs -global using System.Reflection; -global using System.Runtime.CompilerServices; -global using System.Text; -global using FluentAssertions; -global using LiveDocs.GraphQLApi.Models.Replication; -global using Microsoft.Extensions.DependencyInjection; -global using RT.Comb; -global using RxDBDotNet.Extensions; -global using RxDBDotNet.Tests.Setup; diff --git a/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs b/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs index 9cb1064..08daaad 100644 --- a/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs +++ b/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs @@ -1,6 +1,6 @@ -// This file has been auto generated. -#pragma warning disable 8618 - +// This file has been auto generated. +#pragma warning disable 8618 + using System; using System.Collections; using System.Collections.Generic; @@ -15,3344 +15,3344 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; #endif - -namespace RxDBDotNet.Tests.Model -{ - #region base classes - public struct GraphQlFieldMetadata - { - public string Name { get; set; } - public string DefaultAlias { get; set; } - public bool IsComplex { get; set; } - public bool RequiresParameters { get; set; } - public global::System.Type QueryBuilderType { get; set; } - } - - public enum Formatting - { - None, - Indented - } - - public class GraphQlObjectTypeAttribute : global::System.Attribute - { - public string TypeName { get; } - - public GraphQlObjectTypeAttribute(string typeName) => TypeName = typeName; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - public class QueryBuilderParameterConverter : global::Newtonsoft.Json.JsonConverter - { - public override object ReadJson(JsonReader reader, global::System.Type objectType, object existingValue, JsonSerializer serializer) - { - switch (reader.TokenType) - { - case JsonToken.Null: - return null; - - default: - return (QueryBuilderParameter)(T)serializer.Deserialize(reader, typeof(T)); - } - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - if (value == null) - writer.WriteNull(); - else - serializer.Serialize(writer, ((QueryBuilderParameter)value).Value, typeof(T)); - } - - public override bool CanConvert(global::System.Type objectType) => objectType.IsSubclassOf(typeof(QueryBuilderParameter)); - } - - public class GraphQlInterfaceJsonConverter : global::Newtonsoft.Json.JsonConverter - { - private const string FieldNameType = "__typename"; - - private static readonly Dictionary InterfaceTypeMapping = - typeof(GraphQlInterfaceJsonConverter).Assembly.GetTypes() - .Select(t => new { Type = t, Attribute = t.GetCustomAttribute() }) - .Where(x => x.Attribute != null && x.Type.Namespace == typeof(GraphQlInterfaceJsonConverter).Namespace) - .ToDictionary(x => x.Attribute.TypeName, x => x.Type); - - public override bool CanConvert(global::System.Type objectType) => objectType.IsInterface || objectType.IsArray; - - public override object ReadJson(JsonReader reader, global::System.Type objectType, object existingValue, JsonSerializer serializer) - { - while (reader.TokenType == JsonToken.Comment) - reader.Read(); - - switch (reader.TokenType) - { - case JsonToken.Null: - return null; - - case JsonToken.StartObject: - var jObject = JObject.Load(reader); - if (!jObject.TryGetValue(FieldNameType, out var token) || token.Type != JTokenType.String) - throw CreateJsonReaderException(reader, $"\"{GetType().FullName}\" requires JSON object to contain \"{FieldNameType}\" field with type name"); - - var typeName = token.Value(); - if (!InterfaceTypeMapping.TryGetValue(typeName, out var type)) - throw CreateJsonReaderException(reader, $"type \"{typeName}\" not found"); - - using (reader = CloneReader(jObject, reader)) - return serializer.Deserialize(reader, type); - - case JsonToken.StartArray: - var elementType = GetElementType(objectType); - if (elementType == null) - throw CreateJsonReaderException(reader, $"array element type could not be resolved for type \"{objectType.FullName}\""); - - return ReadArray(reader, objectType, elementType, serializer); - - default: - throw CreateJsonReaderException(reader, $"unrecognized token: {reader.TokenType}"); - } - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) => serializer.Serialize(writer, value); - - private static JsonReader CloneReader(JToken jToken, JsonReader reader) - { - var jObjectReader = jToken.CreateReader(); - jObjectReader.Culture = reader.Culture; - jObjectReader.CloseInput = reader.CloseInput; - jObjectReader.SupportMultipleContent = reader.SupportMultipleContent; - jObjectReader.DateTimeZoneHandling = reader.DateTimeZoneHandling; - jObjectReader.FloatParseHandling = reader.FloatParseHandling; - jObjectReader.DateFormatString = reader.DateFormatString; - jObjectReader.DateParseHandling = reader.DateParseHandling; - return jObjectReader; - } - - private static JsonReaderException CreateJsonReaderException(JsonReader reader, string message) - { - if (reader is IJsonLineInfo lineInfo && lineInfo.HasLineInfo()) - return new JsonReaderException(message, reader.Path, lineInfo.LineNumber, lineInfo.LinePosition, null); - - return new JsonReaderException(message); - } - - private static global::System.Type GetElementType(global::System.Type arrayOrGenericContainer) => - arrayOrGenericContainer.IsArray ? arrayOrGenericContainer.GetElementType() : arrayOrGenericContainer.GenericTypeArguments.FirstOrDefault(); - - private IList ReadArray(JsonReader reader, global::System.Type targetType, global::System.Type elementType, JsonSerializer serializer) - { - var list = CreateCompatibleList(targetType, elementType); - while (reader.Read() && reader.TokenType != JsonToken.EndArray) - list.Add(ReadJson(reader, elementType, null, serializer)); - - if (!targetType.IsArray) - return list; - - var array = Array.CreateInstance(elementType, list.Count); - list.CopyTo(array, 0); - return array; - } - - private static IList CreateCompatibleList(global::System.Type targetContainerType, global::System.Type elementType) => - (IList)Activator.CreateInstance(targetContainerType.IsArray || targetContainerType.IsAbstract ? typeof(List<>).MakeGenericType(elementType) : targetContainerType); - } - #endif - - internal static class GraphQlQueryHelper - { - private static readonly Regex RegexGraphQlIdentifier = new Regex(@"^[_A-Za-z][_0-9A-Za-z]*$", RegexOptions.Compiled); - private static readonly Regex RegexEscapeGraphQlString = new Regex(@"[\\\""/\b\f\n\r\t]", RegexOptions.Compiled); - - public static string GetIndentation(int level, byte indentationSize) - { - return new String(' ', level * indentationSize); - } - - public static string EscapeGraphQlStringValue(string value) - { - return RegexEscapeGraphQlString.Replace(value, m => @$"\{GetEscapeSequence(m.Value)}"); - } - - private static string GetEscapeSequence(string input) - { - switch (input) - { - case "\\": - return "\\"; - case "\"": - return "\""; - case "/": - return "/"; - case "\b": - return "b"; - case "\f": - return "f"; - case "\n": - return "n"; - case "\r": - return "r"; - case "\t": - return "t"; - default: - throw new InvalidOperationException($"invalid character: {input}"); - } - } - - public static string BuildArgumentValue(object value, string formatMask, GraphQlBuilderOptions options, int level) - { - var serializer = options.ArgumentBuilder ?? DefaultGraphQlArgumentBuilder.Instance; - if (serializer.TryBuild(new GraphQlArgumentBuilderContext { Value = value, FormatMask = formatMask, Options = options, Level = level }, out var serializedValue)) - return serializedValue; - - if (value is null) - return "null"; - - var enumerable = value as IEnumerable; - if (!String.IsNullOrEmpty(formatMask) && enumerable == null) - return - value is IFormattable formattable - ? $"\"{EscapeGraphQlStringValue(formattable.ToString(formatMask, CultureInfo.InvariantCulture))}\"" - : throw new ArgumentException($"Value must implement {nameof(IFormattable)} interface to use a format mask. ", nameof(value)); - - if (value is Enum @enum) - return ConvertEnumToString(@enum); - - if (value is bool @bool) - return @bool ? "true" : "false"; - - if (value is DateTime dateTime) - return $"\"{dateTime.ToString("O")}\""; - - if (value is DateTimeOffset dateTimeOffset) - return $"\"{dateTimeOffset.ToString("O")}\""; - - if (value is IGraphQlInputObject inputObject) - return BuildInputObject(inputObject, options, level + 2); - - if (value is Guid) - return $"\"{value}\""; - - if (value is String @string) - return $"\"{EscapeGraphQlStringValue(@string)}\""; - - if (enumerable != null) - return BuildEnumerableArgument(enumerable, formatMask, options, level, '[', ']'); - - if (value is short || value is ushort || value is byte || value is int || value is uint || value is long || value is ulong || value is float || value is double || value is decimal) - return Convert.ToString(value, CultureInfo.InvariantCulture); - - var argumentValue = EscapeGraphQlStringValue(Convert.ToString(value, CultureInfo.InvariantCulture)); - return $"\"{argumentValue}\""; - } - - public static string BuildEnumerableArgument(IEnumerable enumerable, string formatMask, GraphQlBuilderOptions options, int level, char openingSymbol, char closingSymbol) - { - var builder = new StringBuilder(); - builder.Append(openingSymbol); - var delimiter = String.Empty; - foreach (var item in enumerable) - { - builder.Append(delimiter); - - if (options.Formatting == Formatting.Indented) - { - builder.AppendLine(); - builder.Append(GetIndentation(level + 1, options.IndentationSize)); - } - - builder.Append(BuildArgumentValue(item, formatMask, options, level)); - delimiter = ","; - } - - builder.Append(closingSymbol); - return builder.ToString(); - } - - public static string BuildInputObject(IGraphQlInputObject inputObject, GraphQlBuilderOptions options, int level) - { - var builder = new StringBuilder(); - builder.Append("{"); - - var isIndentedFormatting = options.Formatting == Formatting.Indented; - string valueSeparator; - if (isIndentedFormatting) - { - builder.AppendLine(); - valueSeparator = ": "; - } - else - valueSeparator = ":"; - - var separator = String.Empty; - foreach (var propertyValue in inputObject.GetPropertyValues()) - { - var queryBuilderParameter = propertyValue.Value as QueryBuilderParameter; - var value = - queryBuilderParameter?.Name != null - ? $"${queryBuilderParameter.Name}" - : BuildArgumentValue(queryBuilderParameter == null ? propertyValue.Value : queryBuilderParameter.Value, propertyValue.FormatMask, options, level); - - builder.Append(isIndentedFormatting ? GetIndentation(level, options.IndentationSize) : separator); - builder.Append(propertyValue.Name); - builder.Append(valueSeparator); - builder.Append(value); - - separator = ","; - - if (isIndentedFormatting) - builder.AppendLine(); - } - - if (isIndentedFormatting) - builder.Append(GetIndentation(level - 1, options.IndentationSize)); - - builder.Append("}"); - - return builder.ToString(); - } - - public static string BuildDirective(GraphQlDirective directive, GraphQlBuilderOptions options, int level) - { - if (directive == null) - return String.Empty; - - var isIndentedFormatting = options.Formatting == Formatting.Indented; - var indentationSpace = isIndentedFormatting ? " " : String.Empty; - var builder = new StringBuilder(); - builder.Append(indentationSpace); - builder.Append("@"); - builder.Append(directive.Name); - builder.Append("("); - - string separator = null; - foreach (var kvp in directive.Arguments) - { - var argumentName = kvp.Key; - var argument = kvp.Value; - - builder.Append(separator); - builder.Append(argumentName); - builder.Append(":"); - builder.Append(indentationSpace); - - if (argument.Name == null) - builder.Append(BuildArgumentValue(argument.Value, null, options, level)); - else - { - builder.Append("$"); - builder.Append(argument.Name); - } - - separator = isIndentedFormatting ? ", " : ","; - } - - builder.Append(")"); - return builder.ToString(); - } - - public static void ValidateGraphQlIdentifier(string name, string identifier) - { - if (identifier != null && !RegexGraphQlIdentifier.IsMatch(identifier)) - throw new ArgumentException("value must match " + RegexGraphQlIdentifier, name); - } - - private static string ConvertEnumToString(Enum @enum) - { - var enumMember = @enum.GetType().GetField(@enum.ToString()); - if (enumMember == null) - throw new InvalidOperationException("enum member resolution failed"); - - var enumMemberAttribute = (EnumMemberAttribute)enumMember.GetCustomAttribute(typeof(EnumMemberAttribute)); - - return enumMemberAttribute == null - ? @enum.ToString() - : enumMemberAttribute.Value; - } - } - - public interface IGraphQlArgumentBuilder - { - bool TryBuild(GraphQlArgumentBuilderContext context, out string graphQlString); - } - - public class GraphQlArgumentBuilderContext - { - public object Value { get; set; } - public string FormatMask { get; set; } - public GraphQlBuilderOptions Options { get; set; } - public int Level { get; set; } - } - - public class DefaultGraphQlArgumentBuilder : IGraphQlArgumentBuilder - { - private static readonly Regex RegexWhiteSpace = new Regex(@"\s", RegexOptions.Compiled); - - public static readonly DefaultGraphQlArgumentBuilder Instance = new(); - - public bool TryBuild(GraphQlArgumentBuilderContext context, out string graphQlString) - { - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - if (context.Value is JValue jValue) - { - switch (jValue.Type) - { - case JTokenType.Null: - graphQlString = "null"; - return true; - - case JTokenType.Integer: - case JTokenType.Float: - case JTokenType.Boolean: - graphQlString = GraphQlQueryHelper.BuildArgumentValue(jValue.Value, null, context.Options, context.Level); - return true; - - case JTokenType.String: - graphQlString = $"\"{GraphQlQueryHelper.EscapeGraphQlStringValue((string)jValue.Value)}\""; - return true; - - default: - graphQlString = $"\"{jValue.Value}\""; - return true; - } - } - - if (context.Value is JProperty jProperty) - { - if (RegexWhiteSpace.IsMatch(jProperty.Name)) - throw new ArgumentException($"JSON object keys used as GraphQL arguments must not contain whitespace; key: {jProperty.Name}"); - - graphQlString = $"{jProperty.Name}:{(context.Options.Formatting == Formatting.Indented ? " " : null)}{GraphQlQueryHelper.BuildArgumentValue(jProperty.Value, null, context.Options, context.Level)}"; - return true; - } - - if (context.Value is JObject jObject) - { - graphQlString = GraphQlQueryHelper.BuildEnumerableArgument(jObject, null, context.Options, context.Level + 1, '{', '}'); - return true; - } - #endif - - graphQlString = null; - return false; - } - } - - internal struct InputPropertyInfo - { - public string Name { get; set; } - public object Value { get; set; } - public string FormatMask { get; set; } - } - - internal interface IGraphQlInputObject - { - IEnumerable GetPropertyValues(); - } - - public interface IGraphQlQueryBuilder - { - void Clear(); - void IncludeAllFields(); - string Build(Formatting formatting = Formatting.None, byte indentationSize = 2); - } - - public struct QueryBuilderArgumentInfo - { - public string ArgumentName { get; set; } - public QueryBuilderParameter ArgumentValue { get; set; } - public string FormatMask { get; set; } - } - - public abstract class QueryBuilderParameter - { - private string _name; - - internal string GraphQlTypeName { get; } - internal object Value { get; set; } - - public string Name - { - get => _name; - set - { - GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(Name), value); - _name = value; - } - } - - protected QueryBuilderParameter(string name, string graphQlTypeName, object value) - { - Name = name?.Trim(); - GraphQlTypeName = graphQlTypeName?.Replace(" ", null).Replace("\t", null).Replace("\n", null).Replace("\r", null); - Value = value; - } - - protected QueryBuilderParameter(object value) => Value = value; - } - - public class QueryBuilderParameter : QueryBuilderParameter - { - public new T Value - { - get => base.Value == null ? default : (T)base.Value; - set => base.Value = value; - } - - protected QueryBuilderParameter(string name, string graphQlTypeName, T value) : base(name, graphQlTypeName, value) - { - EnsureGraphQlTypeName(graphQlTypeName); - } - - protected QueryBuilderParameter(string name, string graphQlTypeName) : base(name, graphQlTypeName, null) - { - EnsureGraphQlTypeName(graphQlTypeName); - } - - private QueryBuilderParameter(T value) : base(value) - { - } - - public void ResetValue() => base.Value = null; - - public static implicit operator QueryBuilderParameter(T value) => new QueryBuilderParameter(value); - - public static implicit operator T(QueryBuilderParameter parameter) => parameter.Value; - - private static void EnsureGraphQlTypeName(string graphQlTypeName) - { - if (String.IsNullOrWhiteSpace(graphQlTypeName)) - throw new ArgumentException("value required", nameof(graphQlTypeName)); - } - } - - public class GraphQlQueryParameter : QueryBuilderParameter - { - private string _formatMask; - - public string FormatMask - { - get => _formatMask; - set => _formatMask = - typeof(IFormattable).IsAssignableFrom(typeof(T)) - ? value - : throw new InvalidOperationException($"Value must be of {nameof(IFormattable)} type. "); - } - - public GraphQlQueryParameter(string name, string graphQlTypeName = null) - : base(name, graphQlTypeName ?? GetGraphQlTypeName(typeof(T))) - { - } - - public GraphQlQueryParameter(string name, string graphQlTypeName, T defaultValue) - : base(name, graphQlTypeName, defaultValue) - { - } - - public GraphQlQueryParameter(string name, T defaultValue, bool isNullable = true) - : base(name, GetGraphQlTypeName(typeof(T), isNullable), defaultValue) - { - } - - private static string GetGraphQlTypeName(global::System.Type valueType, bool isNullable) - { - var graphQlTypeName = GetGraphQlTypeName(valueType); - if (!isNullable) - graphQlTypeName += "!"; - - return graphQlTypeName; - } - - private static string GetGraphQlTypeName(global::System.Type valueType) - { - var nullableUnderlyingType = Nullable.GetUnderlyingType(valueType); - valueType = nullableUnderlyingType ?? valueType; - - if (valueType.IsArray) - { - var arrayItemType = GetGraphQlTypeName(valueType.GetElementType()); - return arrayItemType == null ? null : "[" + arrayItemType + "]"; - } - - if (typeof(IEnumerable).IsAssignableFrom(valueType)) - { - var genericArguments = valueType.GetGenericArguments(); - if (genericArguments.Length == 1) - { - var listItemType = GetGraphQlTypeName(valueType.GetGenericArguments()[0]); - return listItemType == null ? null : "[" + listItemType + "]"; - } - } - - if (GraphQlTypes.ReverseMapping.TryGetValue(valueType, out var graphQlTypeName)) - return graphQlTypeName; - - if (valueType == typeof(string)) - return "String"; - - var nullableSuffix = nullableUnderlyingType == null ? null : "?"; - graphQlTypeName = GetValueTypeGraphQlTypeName(valueType); - return graphQlTypeName == null ? null : graphQlTypeName + nullableSuffix; - } - - private static string GetValueTypeGraphQlTypeName(global::System.Type valueType) - { - if (valueType == typeof(bool)) - return "Boolean"; - - if (valueType == typeof(float) || valueType == typeof(double) || valueType == typeof(decimal)) - return "Float"; - - if (valueType == typeof(Guid)) - return "ID"; - - if (valueType == typeof(sbyte) || valueType == typeof(byte) || valueType == typeof(short) || valueType == typeof(ushort) || valueType == typeof(int) || valueType == typeof(uint) || - valueType == typeof(long) || valueType == typeof(ulong)) - return "Int"; - - return null; - } - } - - public abstract class GraphQlDirective - { - private readonly Dictionary _arguments = new Dictionary(); - - internal IEnumerable> Arguments => _arguments; - - public string Name { get; } - - protected GraphQlDirective(string name) - { - GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(name), name); - Name = name; - } - - protected void AddArgument(string name, QueryBuilderParameter value) - { - if (value != null) - _arguments[name] = value; - } - } - - public class GraphQlBuilderOptions - { - public Formatting Formatting { get; set; } - public byte IndentationSize { get; set; } = 2; - public IGraphQlArgumentBuilder ArgumentBuilder { get; set; } - } - - public abstract partial class GraphQlQueryBuilder : IGraphQlQueryBuilder - { - private readonly Dictionary _fieldCriteria = new Dictionary(); - - private readonly string _operationType; - private readonly string _operationName; - private Dictionary _fragments; - private List _queryParameters; - - protected abstract string TypeName { get; } - - public abstract IReadOnlyList AllFields { get; } - - protected GraphQlQueryBuilder(string operationType, string operationName) - { - GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(operationName), operationName); - _operationType = operationType; - _operationName = operationName; - } - - public virtual void Clear() - { - _fieldCriteria.Clear(); - _fragments?.Clear(); - _queryParameters?.Clear(); - } - - void IGraphQlQueryBuilder.IncludeAllFields() - { - IncludeAllFields(); - } - - public string Build(Formatting formatting = Formatting.None, byte indentationSize = 2) - { - return Build(new GraphQlBuilderOptions { Formatting = formatting, IndentationSize = indentationSize }); - } - - public string Build(GraphQlBuilderOptions options) - { - return Build(options, 1); - } - - protected void IncludeAllFields() - { - IncludeFields(AllFields.Where(f => !f.RequiresParameters)); - } - - protected virtual string Build(GraphQlBuilderOptions options, int level) - { - var isIndentedFormatting = options.Formatting == Formatting.Indented; - var separator = String.Empty; - var indentationSpace = isIndentedFormatting ? " " : String.Empty; - var builder = new StringBuilder(); - - BuildOperationSignature(builder, options, indentationSpace, level); - - if (builder.Length > 0 || level > 1) - builder.Append(indentationSpace); - - builder.Append("{"); - - if (isIndentedFormatting) - builder.AppendLine(); - - separator = String.Empty; - - foreach (var criteria in _fieldCriteria.Values.Concat(_fragments?.Values ?? Enumerable.Empty())) - { - var fieldCriteria = criteria.Build(options, level); - if (isIndentedFormatting) - builder.AppendLine(fieldCriteria); - else if (!String.IsNullOrEmpty(fieldCriteria)) - { - builder.Append(separator); - builder.Append(fieldCriteria); - } - - separator = ","; - } - - if (isIndentedFormatting) - builder.Append(GraphQlQueryHelper.GetIndentation(level - 1, options.IndentationSize)); - - builder.Append("}"); - - return builder.ToString(); - } - - private void BuildOperationSignature(StringBuilder builder, GraphQlBuilderOptions options, string indentationSpace, int level) - { - if (String.IsNullOrEmpty(_operationType)) - return; - - builder.Append(_operationType); - - if (!String.IsNullOrEmpty(_operationName)) - { - builder.Append(" "); - builder.Append(_operationName); - } - - if (_queryParameters?.Count > 0) - { - builder.Append(indentationSpace); - builder.Append("("); - - var separator = String.Empty; - var isIndentedFormatting = options.Formatting == Formatting.Indented; - - foreach (var queryParameterInfo in _queryParameters) - { - if (isIndentedFormatting) - { - builder.AppendLine(separator); - builder.Append(GraphQlQueryHelper.GetIndentation(level, options.IndentationSize)); - } - else - builder.Append(separator); - - builder.Append("$"); - builder.Append(queryParameterInfo.ArgumentValue.Name); - builder.Append(":"); - builder.Append(indentationSpace); - - builder.Append(queryParameterInfo.ArgumentValue.GraphQlTypeName); - - if (!queryParameterInfo.ArgumentValue.GraphQlTypeName.EndsWith("!") && queryParameterInfo.ArgumentValue.Value is not null) - { - builder.Append(indentationSpace); - builder.Append("="); - builder.Append(indentationSpace); - builder.Append(GraphQlQueryHelper.BuildArgumentValue(queryParameterInfo.ArgumentValue.Value, queryParameterInfo.FormatMask, options, 0)); - } - - if (!isIndentedFormatting) - separator = ","; - } - - builder.Append(")"); - } - } - - protected void IncludeScalarField(string fieldName, string alias, IList args, GraphQlDirective[] directives) - { - _fieldCriteria[alias ?? fieldName] = new GraphQlScalarFieldCriteria(fieldName, alias, args, directives); - } - - protected void IncludeObjectField(string fieldName, string alias, GraphQlQueryBuilder objectFieldQueryBuilder, IList args, GraphQlDirective[] directives) - { - _fieldCriteria[alias ?? fieldName] = new GraphQlObjectFieldCriteria(fieldName, alias, objectFieldQueryBuilder, args, directives); - } - - protected void IncludeFragment(GraphQlQueryBuilder objectFieldQueryBuilder, GraphQlDirective[] directives) - { - _fragments = _fragments ?? new Dictionary(); - _fragments[objectFieldQueryBuilder.TypeName] = new GraphQlFragmentCriteria(objectFieldQueryBuilder, directives); - } - - protected void ExcludeField(string fieldName) - { - if (fieldName == null) - throw new ArgumentNullException(nameof(fieldName)); - - _fieldCriteria.Remove(fieldName); - } - - protected void IncludeFields(IEnumerable fields) - { - IncludeFields(fields, 0, new Dictionary()); - } - - private void IncludeFields(IEnumerable fields, int level, Dictionary parentTypeLevel) - { - global::System.Type builderType = null; - - foreach (var field in fields) - { - if (field.QueryBuilderType == null) - IncludeScalarField(field.Name, field.DefaultAlias, null, null); - else - { - if (_operationType != null && GetType() == field.QueryBuilderType || - parentTypeLevel.TryGetValue(field.QueryBuilderType, out var parentLevel) && parentLevel < level) - continue; - - if (builderType is null) - { - builderType = GetType(); - parentLevel = parentTypeLevel.TryGetValue(builderType, out parentLevel) ? parentLevel : level; - parentTypeLevel[builderType] = Math.Min(level, parentLevel); - } - - var queryBuilder = InitializeChildQueryBuilder(builderType, field.QueryBuilderType, level, parentTypeLevel); - - var includeFragmentMethods = field.QueryBuilderType.GetMethods().Where(IsIncludeFragmentMethod); - - foreach (var includeFragmentMethod in includeFragmentMethods) - includeFragmentMethod.Invoke( - queryBuilder, - new object[] { InitializeChildQueryBuilder(builderType, includeFragmentMethod.GetParameters()[0].ParameterType, level, parentTypeLevel) }); - - if (queryBuilder._fieldCriteria.Count > 0 || queryBuilder._fragments != null) - IncludeObjectField(field.Name, field.DefaultAlias, queryBuilder, null, null); - } - } - } - - private static GraphQlQueryBuilder InitializeChildQueryBuilder(global::System.Type parentQueryBuilderType, global::System.Type queryBuilderType, int level, Dictionary parentTypeLevel) - { - var queryBuilder = (GraphQlQueryBuilder)Activator.CreateInstance(queryBuilderType); - queryBuilder.IncludeFields( - queryBuilder.AllFields.Where(f => !f.RequiresParameters), - level + 1, - parentTypeLevel); - - return queryBuilder; - } - - private static bool IsIncludeFragmentMethod(MethodInfo methodInfo) - { - if (!methodInfo.Name.StartsWith("With") || !methodInfo.Name.EndsWith("Fragment")) - return false; - - var parameters = methodInfo.GetParameters(); - return parameters.Length == 1 && parameters[0].ParameterType.IsSubclassOf(typeof(GraphQlQueryBuilder)); - } - - protected void AddParameter(GraphQlQueryParameter parameter) - { - if (_queryParameters == null) - _queryParameters = new List(); - - _queryParameters.Add(new QueryBuilderArgumentInfo { ArgumentValue = parameter, FormatMask = parameter.FormatMask }); - } - - private abstract class GraphQlFieldCriteria - { - private readonly IList _args; - private readonly GraphQlDirective[] _directives; - - protected readonly string FieldName; - protected readonly string Alias; - - protected static string GetIndentation(Formatting formatting, int level, byte indentationSize) => - formatting == Formatting.Indented ? GraphQlQueryHelper.GetIndentation(level, indentationSize) : null; - - protected GraphQlFieldCriteria(string fieldName, string alias, IList args, GraphQlDirective[] directives) - { - GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(alias), alias); - FieldName = fieldName; - Alias = alias; - _args = args; - _directives = directives; - } - - public abstract string Build(GraphQlBuilderOptions options, int level); - - protected string BuildArgumentClause(GraphQlBuilderOptions options, int level) - { - var separator = options.Formatting == Formatting.Indented ? " " : null; - var argumentCount = _args?.Count ?? 0; - if (argumentCount == 0) - return String.Empty; - - var arguments = - _args.Select( - a => $"{a.ArgumentName}:{separator}{(a.ArgumentValue.Name == null ? GraphQlQueryHelper.BuildArgumentValue(a.ArgumentValue.Value, a.FormatMask, options, level) : $"${a.ArgumentValue.Name}")}"); - - return $"({String.Join($",{separator}", arguments)})"; - } - - protected string BuildDirectiveClause(GraphQlBuilderOptions options, int level) => - _directives == null ? null : String.Concat(_directives.Select(d => d == null ? null : GraphQlQueryHelper.BuildDirective(d, options, level))); - - protected static string BuildAliasPrefix(string alias, Formatting formatting) - { - var separator = formatting == Formatting.Indented ? " " : String.Empty; - return String.IsNullOrWhiteSpace(alias) ? null : $"{alias}:{separator}"; - } - } - - private class GraphQlScalarFieldCriteria : GraphQlFieldCriteria - { - public GraphQlScalarFieldCriteria(string fieldName, string alias, IList args, GraphQlDirective[] directives) - : base(fieldName, alias, args, directives) - { - } - - public override string Build(GraphQlBuilderOptions options, int level) => - GetIndentation(options.Formatting, level, options.IndentationSize) + - BuildAliasPrefix(Alias, options.Formatting) + - FieldName + - BuildArgumentClause(options, level) + - BuildDirectiveClause(options, level); - } - - private class GraphQlObjectFieldCriteria : GraphQlFieldCriteria - { - private readonly GraphQlQueryBuilder _objectQueryBuilder; - - public GraphQlObjectFieldCriteria(string fieldName, string alias, GraphQlQueryBuilder objectQueryBuilder, IList args, GraphQlDirective[] directives) - : base(fieldName, alias, args, directives) - { - _objectQueryBuilder = objectQueryBuilder; - } - - public override string Build(GraphQlBuilderOptions options, int level) => - _objectQueryBuilder._fieldCriteria.Count > 0 || _objectQueryBuilder._fragments?.Count > 0 - ? GetIndentation(options.Formatting, level, options.IndentationSize) + BuildAliasPrefix(Alias, options.Formatting) + FieldName + - BuildArgumentClause(options, level) + BuildDirectiveClause(options, level) + _objectQueryBuilder.Build(options, level + 1) - : null; - } - - private class GraphQlFragmentCriteria : GraphQlFieldCriteria - { - private readonly GraphQlQueryBuilder _objectQueryBuilder; - - public GraphQlFragmentCriteria(GraphQlQueryBuilder objectQueryBuilder, GraphQlDirective[] directives) : base(objectQueryBuilder.TypeName, null, null, directives) - { - _objectQueryBuilder = objectQueryBuilder; - } - - public override string Build(GraphQlBuilderOptions options, int level) => - _objectQueryBuilder._fieldCriteria.Count == 0 - ? null - : GetIndentation(options.Formatting, level, options.IndentationSize) + "..." + (options.Formatting == Formatting.Indented ? " " : null) + "on " + - FieldName + BuildArgumentClause(options, level) + BuildDirectiveClause(options, level) + _objectQueryBuilder.Build(options, level + 1); - } - } - - public abstract partial class GraphQlQueryBuilder : GraphQlQueryBuilder where TQueryBuilder : GraphQlQueryBuilder - { - protected GraphQlQueryBuilder(string operationType = null, string operationName = null) : base(operationType, operationName) - { - } - - /// - /// Includes all fields that don't require parameters into the query. - /// - public TQueryBuilder WithAllFields() - { - IncludeAllFields(); - return (TQueryBuilder)this; - } - - /// - /// Includes all scalar fields that don't require parameters into the query. - /// - public TQueryBuilder WithAllScalarFields() - { - IncludeFields(AllFields.Where(f => !f.IsComplex && !f.RequiresParameters)); - return (TQueryBuilder)this; - } - - public TQueryBuilder ExceptField(string fieldName) - { - ExcludeField(fieldName); - return (TQueryBuilder)this; - } - - /// - /// Includes "__typename" field; included automatically for interface and union types. - /// - public TQueryBuilder WithTypeName(string alias = null, params GraphQlDirective[] directives) - { - IncludeScalarField("__typename", alias, null, directives); - return (TQueryBuilder)this; - } - - protected TQueryBuilder WithScalarField(string fieldName, string alias, GraphQlDirective[] directives, IList args = null) - { - IncludeScalarField(fieldName, alias, args, directives); - return (TQueryBuilder)this; - } - - protected TQueryBuilder WithObjectField(string fieldName, string alias, GraphQlQueryBuilder queryBuilder, GraphQlDirective[] directives, IList args = null) - { - IncludeObjectField(fieldName, alias, queryBuilder, args, directives); - return (TQueryBuilder)this; - } - - protected TQueryBuilder WithFragment(GraphQlQueryBuilder queryBuilder, GraphQlDirective[] directives) - { - IncludeFragment(queryBuilder, directives); - return (TQueryBuilder)this; - } - - protected TQueryBuilder WithParameterInternal(GraphQlQueryParameter parameter) - { - AddParameter(parameter); - return (TQueryBuilder)this; - } - } - - public abstract class GraphQlResponse - { - public TDataContract Data { get; set; } - public ICollection Errors { get; set; } - } - - public class GraphQlQueryError - { - public string Message { get; set; } - public ICollection Locations { get; set; } - } - - public class GraphQlErrorLocation - { - public int Line { get; set; } - public int Column { get; set; } - } - #endregion - - #region GraphQL type helpers - public static class GraphQlTypes - { - public const string Boolean = "Boolean"; - public const string DateTime = "DateTime"; - public const string EmailAddress = "EmailAddress"; - public const string Id = "ID"; - public const string Int = "Int"; - public const string String = "String"; - public const string Uuid = "UUID"; - - public const string UserRole = "UserRole"; - - public const string AuthenticationError = "AuthenticationError"; - public const string Checkpoint = "Checkpoint"; - public const string LiveDoc = "LiveDoc"; - public const string LiveDocPullBulk = "LiveDocPullBulk"; - public const string Mutation = "Mutation"; - public const string PushLiveDocPayload = "PushLiveDocPayload"; - public const string PushUserPayload = "PushUserPayload"; - public const string PushWorkspacePayload = "PushWorkspacePayload"; - public const string Query = "Query"; - public const string Subscription = "Subscription"; - public const string UnauthorizedAccessError = "UnauthorizedAccessError"; - public const string User = "User"; - public const string UserPullBulk = "UserPullBulk"; - public const string Workspace = "Workspace"; - public const string WorkspacePullBulk = "WorkspacePullBulk"; - - public const string BooleanOperationFilterInput = "BooleanOperationFilterInput"; - public const string DateTimeOperationFilterInput = "DateTimeOperationFilterInput"; - public const string ListStringOperationFilterInput = "ListStringOperationFilterInput"; - public const string LiveDocFilterInput = "LiveDocFilterInput"; - public const string LiveDocInput = "LiveDocInput"; - public const string LiveDocInputCheckpoint = "LiveDocInputCheckpoint"; - public const string LiveDocInputHeaders = "LiveDocInputHeaders"; - public const string LiveDocInputPushRow = "LiveDocInputPushRow"; - public const string PushLiveDocInput = "PushLiveDocInput"; - public const string PushUserInput = "PushUserInput"; - public const string PushWorkspaceInput = "PushWorkspaceInput"; - public const string StringOperationFilterInput = "StringOperationFilterInput"; - public const string UserFilterInput = "UserFilterInput"; - public const string UserInput = "UserInput"; - public const string UserInputCheckpoint = "UserInputCheckpoint"; - public const string UserInputHeaders = "UserInputHeaders"; - public const string UserInputPushRow = "UserInputPushRow"; - public const string UserRoleOperationFilterInput = "UserRoleOperationFilterInput"; - public const string UuidOperationFilterInput = "UuidOperationFilterInput"; - public const string WorkspaceFilterInput = "WorkspaceFilterInput"; - public const string WorkspaceInput = "WorkspaceInput"; - public const string WorkspaceInputCheckpoint = "WorkspaceInputCheckpoint"; - public const string WorkspaceInputHeaders = "WorkspaceInputHeaders"; - public const string WorkspaceInputPushRow = "WorkspaceInputPushRow"; - - public const string PushLiveDocError = "PushLiveDocError"; - public const string PushUserError = "PushUserError"; - public const string PushWorkspaceError = "PushWorkspaceError"; - - public const string Error = "Error"; - - public static readonly IReadOnlyDictionary ReverseMapping = - new Dictionary - { - { typeof(string), "String" }, - { typeof(Guid), "UUID" }, - { typeof(DateTimeOffset), "DateTime" }, - { typeof(bool), "Boolean" }, - { typeof(BooleanOperationFilterInputGql), "BooleanOperationFilterInput" }, - { typeof(DateTimeOperationFilterInputGql), "DateTimeOperationFilterInput" }, - { typeof(ListStringOperationFilterInputGql), "ListStringOperationFilterInput" }, - { typeof(LiveDocFilterInputGql), "LiveDocFilterInput" }, - { typeof(LiveDocInputGql), "LiveDocInput" }, - { typeof(LiveDocInputCheckpointGql), "LiveDocInputCheckpoint" }, - { typeof(LiveDocInputHeadersGql), "LiveDocInputHeaders" }, - { typeof(LiveDocInputPushRowGql), "LiveDocInputPushRow" }, - { typeof(PushLiveDocInputGql), "PushLiveDocInput" }, - { typeof(PushUserInputGql), "PushUserInput" }, - { typeof(PushWorkspaceInputGql), "PushWorkspaceInput" }, - { typeof(StringOperationFilterInputGql), "StringOperationFilterInput" }, - { typeof(UserFilterInputGql), "UserFilterInput" }, - { typeof(UserInputGql), "UserInput" }, - { typeof(UserInputCheckpointGql), "UserInputCheckpoint" }, - { typeof(UserInputHeadersGql), "UserInputHeaders" }, - { typeof(UserInputPushRowGql), "UserInputPushRow" }, - { typeof(UserRoleOperationFilterInputGql), "UserRoleOperationFilterInput" }, - { typeof(UuidOperationFilterInputGql), "UuidOperationFilterInput" }, - { typeof(WorkspaceFilterInputGql), "WorkspaceFilterInput" }, - { typeof(WorkspaceInputGql), "WorkspaceInput" }, - { typeof(WorkspaceInputCheckpointGql), "WorkspaceInputCheckpoint" }, - { typeof(WorkspaceInputHeadersGql), "WorkspaceInputHeaders" }, - { typeof(WorkspaceInputPushRowGql), "WorkspaceInputPushRow" } - }; -} - #endregion - - #region enums - public enum UserRoleGql - { - StandardUser, - WorkspaceAdmin, - SystemAdmin - } - #endregion - - #nullable enable - #region directives - public class SkipDirective : GraphQlDirective - { - public SkipDirective(QueryBuilderParameter @if) : base("skip") - { - AddArgument("if", @if); - } - } - - public class IncludeDirective : GraphQlDirective - { - public IncludeDirective(QueryBuilderParameter @if) : base("include") - { - AddArgument("if", @if); - } - } - #endregion - - #region builder classes - public partial class UserPullBulkQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(UserQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "UserPullBulk"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public UserPullBulkQueryBuilderGql WithDocuments(UserQueryBuilderGql userQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, userQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public UserPullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); - - public UserPullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public UserPullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); - } - - public partial class WorkspacePullBulkQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(WorkspaceQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "WorkspacePullBulk"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public WorkspacePullBulkQueryBuilderGql WithDocuments(WorkspaceQueryBuilderGql workspaceQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, workspaceQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public WorkspacePullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); - - public WorkspacePullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public WorkspacePullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); - } - - public partial class LiveDocPullBulkQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(LiveDocQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "LiveDocPullBulk"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public LiveDocPullBulkQueryBuilderGql WithDocuments(LiveDocQueryBuilderGql liveDocQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, liveDocQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public LiveDocPullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); - - public LiveDocPullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public LiveDocPullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); - } - - public partial class QueryQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "pullUser", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(UserPullBulkQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "pullWorkspace", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(WorkspacePullBulkQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "pullLiveDoc", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(LiveDocPullBulkQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "Query"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public QueryQueryBuilderGql(string? operationName = null) : base("query", operationName) - { - } - - public QueryQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); - - public QueryQueryBuilderGql WithPullUser(UserPullBulkQueryBuilderGql userPullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (checkpoint != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); - - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); - if (where != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); - - return WithObjectField("pullUser", alias, userPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public QueryQueryBuilderGql ExceptPullUser() => ExceptField("pullUser"); - - public QueryQueryBuilderGql WithPullWorkspace(WorkspacePullBulkQueryBuilderGql workspacePullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (checkpoint != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); - - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); - if (where != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); - - return WithObjectField("pullWorkspace", alias, workspacePullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public QueryQueryBuilderGql ExceptPullWorkspace() => ExceptField("pullWorkspace"); - - public QueryQueryBuilderGql WithPullLiveDoc(LiveDocPullBulkQueryBuilderGql liveDocPullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (checkpoint != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); - - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); - if (where != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); - - return WithObjectField("pullLiveDoc", alias, liveDocPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public QueryQueryBuilderGql ExceptPullLiveDoc() => ExceptField("pullLiveDoc"); - } - - public partial class MutationQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "pushUser", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushUserPayloadQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "pushWorkspace", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushWorkspacePayloadQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "pushLiveDoc", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushLiveDocPayloadQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "Mutation"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public MutationQueryBuilderGql(string? operationName = null) : base("mutation", operationName) - { - } - - public MutationQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); - - public MutationQueryBuilderGql WithPushUser(PushUserPayloadQueryBuilderGql pushUserPayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); - return WithObjectField("pushUser", alias, pushUserPayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public MutationQueryBuilderGql ExceptPushUser() => ExceptField("pushUser"); - - public MutationQueryBuilderGql WithPushWorkspace(PushWorkspacePayloadQueryBuilderGql pushWorkspacePayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); - return WithObjectField("pushWorkspace", alias, pushWorkspacePayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public MutationQueryBuilderGql ExceptPushWorkspace() => ExceptField("pushWorkspace"); - - public MutationQueryBuilderGql WithPushLiveDoc(PushLiveDocPayloadQueryBuilderGql pushLiveDocPayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); - return WithObjectField("pushLiveDoc", alias, pushLiveDocPayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public MutationQueryBuilderGql ExceptPushLiveDoc() => ExceptField("pushLiveDoc"); - } - - public partial class SubscriptionQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "streamUser", IsComplex = true, QueryBuilderType = typeof(UserPullBulkQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "streamWorkspace", IsComplex = true, QueryBuilderType = typeof(WorkspacePullBulkQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "streamLiveDoc", IsComplex = true, QueryBuilderType = typeof(LiveDocPullBulkQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "Subscription"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public SubscriptionQueryBuilderGql(string? operationName = null) : base("subscription", operationName) - { - } - - public SubscriptionQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); - - public SubscriptionQueryBuilderGql WithStreamUser(UserPullBulkQueryBuilderGql userPullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (headers != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); - - if (topics != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); - - return WithObjectField("streamUser", alias, userPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public SubscriptionQueryBuilderGql ExceptStreamUser() => ExceptField("streamUser"); - - public SubscriptionQueryBuilderGql WithStreamWorkspace(WorkspacePullBulkQueryBuilderGql workspacePullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (headers != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); - - if (topics != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); - - return WithObjectField("streamWorkspace", alias, workspacePullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public SubscriptionQueryBuilderGql ExceptStreamWorkspace() => ExceptField("streamWorkspace"); - - public SubscriptionQueryBuilderGql WithStreamLiveDoc(LiveDocPullBulkQueryBuilderGql liveDocPullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (headers != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); - - if (topics != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); - - return WithObjectField("streamLiveDoc", alias, liveDocPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public SubscriptionQueryBuilderGql ExceptStreamLiveDoc() => ExceptField("streamLiveDoc"); - } - - public partial class UserQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "firstName" }, - new GraphQlFieldMetadata { Name = "lastName" }, - new GraphQlFieldMetadata { Name = "fullName" }, - new GraphQlFieldMetadata { Name = "email" }, - new GraphQlFieldMetadata { Name = "role" }, - new GraphQlFieldMetadata { Name = "jwtAccessToken" }, - new GraphQlFieldMetadata { Name = "workspaceId" }, - new GraphQlFieldMetadata { Name = "id" }, - new GraphQlFieldMetadata { Name = "isDeleted" }, - new GraphQlFieldMetadata { Name = "updatedAt" }, - new GraphQlFieldMetadata { Name = "topics", IsComplex = true } - }; - - protected override string TypeName { get; } = "User"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public UserQueryBuilderGql WithFirstName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("firstName", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptFirstName() => ExceptField("firstName"); - - public UserQueryBuilderGql WithLastName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("lastName", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptLastName() => ExceptField("lastName"); - - public UserQueryBuilderGql WithFullName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("fullName", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptFullName() => ExceptField("fullName"); - - public UserQueryBuilderGql WithEmail(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("email", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptEmail() => ExceptField("email"); - - public UserQueryBuilderGql WithRole(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("role", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptRole() => ExceptField("role"); - - public UserQueryBuilderGql WithJwtAccessToken(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("jwtAccessToken", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptJwtAccessToken() => ExceptField("jwtAccessToken"); - - public UserQueryBuilderGql WithWorkspaceId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("workspaceId", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptWorkspaceId() => ExceptField("workspaceId"); - - public UserQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptId() => ExceptField("id"); - - public UserQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); - - public UserQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); - - public UserQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptTopics() => ExceptField("topics"); - } - - public partial class CheckpointQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "lastDocumentId" }, - new GraphQlFieldMetadata { Name = "updatedAt" } - }; - - protected override string TypeName { get; } = "Checkpoint"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public CheckpointQueryBuilderGql WithLastDocumentId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("lastDocumentId", alias, new GraphQlDirective?[] { skip, include }); - - public CheckpointQueryBuilderGql ExceptLastDocumentId() => ExceptField("lastDocumentId"); - - public CheckpointQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); - - public CheckpointQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); - } - - public partial class AuthenticationErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "message" } - }; - - protected override string TypeName { get; } = "AuthenticationError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public AuthenticationErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); - - public AuthenticationErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); - } - - public partial class UnauthorizedAccessErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "message" } - }; - - protected override string TypeName { get; } = "UnauthorizedAccessError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public UnauthorizedAccessErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); - - public UnauthorizedAccessErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); - } - - public partial class WorkspaceQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "name" }, - new GraphQlFieldMetadata { Name = "id" }, - new GraphQlFieldMetadata { Name = "isDeleted" }, - new GraphQlFieldMetadata { Name = "updatedAt" }, - new GraphQlFieldMetadata { Name = "topics", IsComplex = true } - }; - - protected override string TypeName { get; } = "Workspace"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public WorkspaceQueryBuilderGql WithName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("name", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptName() => ExceptField("name"); - - public WorkspaceQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptId() => ExceptField("id"); - - public WorkspaceQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); - - public WorkspaceQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); - - public WorkspaceQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptTopics() => ExceptField("topics"); - } - - public partial class LiveDocQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "content" }, - new GraphQlFieldMetadata { Name = "ownerId" }, - new GraphQlFieldMetadata { Name = "workspaceId" }, - new GraphQlFieldMetadata { Name = "id" }, - new GraphQlFieldMetadata { Name = "isDeleted" }, - new GraphQlFieldMetadata { Name = "updatedAt" }, - new GraphQlFieldMetadata { Name = "topics", IsComplex = true } - }; - - protected override string TypeName { get; } = "LiveDoc"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public LiveDocQueryBuilderGql WithContent(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("content", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptContent() => ExceptField("content"); - - public LiveDocQueryBuilderGql WithOwnerId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("ownerId", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptOwnerId() => ExceptField("ownerId"); - - public LiveDocQueryBuilderGql WithWorkspaceId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("workspaceId", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptWorkspaceId() => ExceptField("workspaceId"); - - public LiveDocQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptId() => ExceptField("id"); - - public LiveDocQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); - - public LiveDocQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); - - public LiveDocQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptTopics() => ExceptField("topics"); - } - - public partial class ErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "message" } - }; - - public ErrorQueryBuilderGql() => WithTypeName(); - - protected override string TypeName { get; } = "Error"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public ErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); - - public ErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); - - public ErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public ErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - } - - public partial class PushUserErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); - - public PushUserErrorQueryBuilderGql() => WithTypeName(); - - protected override string TypeName { get; } = "PushUserError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushUserErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushUserErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - } - - public partial class PushUserPayloadQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "user", IsComplex = true, QueryBuilderType = typeof(UserQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushUserErrorQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "PushUserPayload"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushUserPayloadQueryBuilderGql WithUser(UserQueryBuilderGql userQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("user", alias, userQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushUserPayloadQueryBuilderGql ExceptUser() => ExceptField("user"); - - public PushUserPayloadQueryBuilderGql WithErrors(PushUserErrorQueryBuilderGql pushUserErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushUserErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushUserPayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); - } - - public partial class PushWorkspaceErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); - - public PushWorkspaceErrorQueryBuilderGql() => WithTypeName(); - - protected override string TypeName { get; } = "PushWorkspaceError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushWorkspaceErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushWorkspaceErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - } - - public partial class PushWorkspacePayloadQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "workspace", IsComplex = true, QueryBuilderType = typeof(WorkspaceQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushWorkspaceErrorQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "PushWorkspacePayload"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushWorkspacePayloadQueryBuilderGql WithWorkspace(WorkspaceQueryBuilderGql workspaceQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("workspace", alias, workspaceQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushWorkspacePayloadQueryBuilderGql ExceptWorkspace() => ExceptField("workspace"); - - public PushWorkspacePayloadQueryBuilderGql WithErrors(PushWorkspaceErrorQueryBuilderGql pushWorkspaceErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushWorkspaceErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushWorkspacePayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); - } - - public partial class PushLiveDocErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); - - public PushLiveDocErrorQueryBuilderGql() => WithTypeName(); - - protected override string TypeName { get; } = "PushLiveDocError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushLiveDocErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushLiveDocErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - } - - public partial class PushLiveDocPayloadQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "liveDoc", IsComplex = true, QueryBuilderType = typeof(LiveDocQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushLiveDocErrorQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "PushLiveDocPayload"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushLiveDocPayloadQueryBuilderGql WithLiveDoc(LiveDocQueryBuilderGql liveDocQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("liveDoc", alias, liveDocQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushLiveDocPayloadQueryBuilderGql ExceptLiveDoc() => ExceptField("liveDoc"); - - public PushLiveDocPayloadQueryBuilderGql WithErrors(PushLiveDocErrorQueryBuilderGql pushLiveDocErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushLiveDocErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushLiveDocPayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); - } - #endregion - - #region input classes - public partial class UserInputCheckpointGql : IGraphQlInputObject - { - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _lastDocumentId; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastDocumentId - { - get => (QueryBuilderParameter?)_lastDocumentId.Value; - set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_updatedAt.Name != null) yield return _updatedAt; - if (_lastDocumentId.Name != null) yield return _lastDocumentId; - } - } - - public partial class UserInputPushRowGql : IGraphQlInputObject - { - private InputPropertyInfo _assumedMasterState; - private InputPropertyInfo _newDocumentState; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? AssumedMasterState - { - get => (QueryBuilderParameter?)_assumedMasterState.Value; - set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NewDocumentState - { - get => (QueryBuilderParameter?)_newDocumentState.Value; - set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_assumedMasterState.Name != null) yield return _assumedMasterState; - if (_newDocumentState.Name != null) yield return _newDocumentState; - } - } - - public partial class WorkspaceInputCheckpointGql : IGraphQlInputObject - { - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _lastDocumentId; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastDocumentId - { - get => (QueryBuilderParameter?)_lastDocumentId.Value; - set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_updatedAt.Name != null) yield return _updatedAt; - if (_lastDocumentId.Name != null) yield return _lastDocumentId; - } - } - - public partial class WorkspaceInputPushRowGql : IGraphQlInputObject - { - private InputPropertyInfo _assumedMasterState; - private InputPropertyInfo _newDocumentState; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? AssumedMasterState - { - get => (QueryBuilderParameter?)_assumedMasterState.Value; - set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NewDocumentState - { - get => (QueryBuilderParameter?)_newDocumentState.Value; - set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_assumedMasterState.Name != null) yield return _assumedMasterState; - if (_newDocumentState.Name != null) yield return _newDocumentState; - } - } - - public partial class LiveDocInputCheckpointGql : IGraphQlInputObject - { - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _lastDocumentId; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastDocumentId - { - get => (QueryBuilderParameter?)_lastDocumentId.Value; - set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_updatedAt.Name != null) yield return _updatedAt; - if (_lastDocumentId.Name != null) yield return _lastDocumentId; - } - } - - public partial class LiveDocInputPushRowGql : IGraphQlInputObject - { - private InputPropertyInfo _assumedMasterState; - private InputPropertyInfo _newDocumentState; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? AssumedMasterState - { - get => (QueryBuilderParameter?)_assumedMasterState.Value; - set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NewDocumentState - { - get => (QueryBuilderParameter?)_newDocumentState.Value; - set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_assumedMasterState.Name != null) yield return _assumedMasterState; - if (_newDocumentState.Name != null) yield return _newDocumentState; - } - } - - public partial class UserFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _and; - private InputPropertyInfo _or; - private InputPropertyInfo _firstName; - private InputPropertyInfo _lastName; - private InputPropertyInfo _fullName; - private InputPropertyInfo _email; - private InputPropertyInfo _role; - private InputPropertyInfo _jwtAccessToken; - private InputPropertyInfo _workspaceId; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? And - { - get => (QueryBuilderParameter?>?)_and.Value; - set => _and = new InputPropertyInfo { Name = "and", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Or - { - get => (QueryBuilderParameter?>?)_or.Value; - set => _or = new InputPropertyInfo { Name = "or", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? FirstName - { - get => (QueryBuilderParameter?)_firstName.Value; - set => _firstName = new InputPropertyInfo { Name = "firstName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastName - { - get => (QueryBuilderParameter?)_lastName.Value; - set => _lastName = new InputPropertyInfo { Name = "lastName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? FullName - { - get => (QueryBuilderParameter?)_fullName.Value; - set => _fullName = new InputPropertyInfo { Name = "fullName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Email - { - get => (QueryBuilderParameter?)_email.Value; - set => _email = new InputPropertyInfo { Name = "email", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Role - { - get => (QueryBuilderParameter?)_role.Value; - set => _role = new InputPropertyInfo { Name = "role", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? JwtAccessToken - { - get => (QueryBuilderParameter?)_jwtAccessToken.Value; - set => _jwtAccessToken = new InputPropertyInfo { Name = "jwtAccessToken", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? WorkspaceId - { - get => (QueryBuilderParameter?)_workspaceId.Value; - set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Topics - { - get => (QueryBuilderParameter?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_and.Name != null) yield return _and; - if (_or.Name != null) yield return _or; - if (_firstName.Name != null) yield return _firstName; - if (_lastName.Name != null) yield return _lastName; - if (_fullName.Name != null) yield return _fullName; - if (_email.Name != null) yield return _email; - if (_role.Name != null) yield return _role; - if (_jwtAccessToken.Name != null) yield return _jwtAccessToken; - if (_workspaceId.Name != null) yield return _workspaceId; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class UserInputGql : IGraphQlInputObject - { - private InputPropertyInfo _firstName; - private InputPropertyInfo _lastName; - private InputPropertyInfo _fullName; - private InputPropertyInfo _email; - private InputPropertyInfo _role; - private InputPropertyInfo _jwtAccessToken; - private InputPropertyInfo _workspaceId; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? FirstName - { - get => (QueryBuilderParameter?)_firstName.Value; - set => _firstName = new InputPropertyInfo { Name = "firstName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastName - { - get => (QueryBuilderParameter?)_lastName.Value; - set => _lastName = new InputPropertyInfo { Name = "lastName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? FullName - { - get => (QueryBuilderParameter?)_fullName.Value; - set => _fullName = new InputPropertyInfo { Name = "fullName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Email - { - get => (QueryBuilderParameter?)_email.Value; - set => _email = new InputPropertyInfo { Name = "email", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Role - { - get => (QueryBuilderParameter?)_role.Value; - set => _role = new InputPropertyInfo { Name = "role", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? JwtAccessToken - { - get => (QueryBuilderParameter?)_jwtAccessToken.Value; - set => _jwtAccessToken = new InputPropertyInfo { Name = "jwtAccessToken", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? WorkspaceId - { - get => (QueryBuilderParameter?)_workspaceId.Value; - set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Topics - { - get => (QueryBuilderParameter?>?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_firstName.Name != null) yield return _firstName; - if (_lastName.Name != null) yield return _lastName; - if (_fullName.Name != null) yield return _fullName; - if (_email.Name != null) yield return _email; - if (_role.Name != null) yield return _role; - if (_jwtAccessToken.Name != null) yield return _jwtAccessToken; - if (_workspaceId.Name != null) yield return _workspaceId; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class UserInputHeadersGql : IGraphQlInputObject - { - private InputPropertyInfo _authorization; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Authorization - { - get => (QueryBuilderParameter?)_authorization.Value; - set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_authorization.Name != null) yield return _authorization; - } - } - - public partial class WorkspaceFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _and; - private InputPropertyInfo _or; - private InputPropertyInfo _name; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? And - { - get => (QueryBuilderParameter?>?)_and.Value; - set => _and = new InputPropertyInfo { Name = "and", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Or - { - get => (QueryBuilderParameter?>?)_or.Value; - set => _or = new InputPropertyInfo { Name = "or", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Name - { - get => (QueryBuilderParameter?)_name.Value; - set => _name = new InputPropertyInfo { Name = "name", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Topics - { - get => (QueryBuilderParameter?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_and.Name != null) yield return _and; - if (_or.Name != null) yield return _or; - if (_name.Name != null) yield return _name; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class WorkspaceInputGql : IGraphQlInputObject - { - private InputPropertyInfo _name; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Name - { - get => (QueryBuilderParameter?)_name.Value; - set => _name = new InputPropertyInfo { Name = "name", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Topics - { - get => (QueryBuilderParameter?>?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_name.Name != null) yield return _name; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class WorkspaceInputHeadersGql : IGraphQlInputObject - { - private InputPropertyInfo _authorization; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Authorization - { - get => (QueryBuilderParameter?)_authorization.Value; - set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_authorization.Name != null) yield return _authorization; - } - } - - public partial class LiveDocFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _and; - private InputPropertyInfo _or; - private InputPropertyInfo _content; - private InputPropertyInfo _ownerId; - private InputPropertyInfo _workspaceId; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? And - { - get => (QueryBuilderParameter?>?)_and.Value; - set => _and = new InputPropertyInfo { Name = "and", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Or - { - get => (QueryBuilderParameter?>?)_or.Value; - set => _or = new InputPropertyInfo { Name = "or", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Content - { - get => (QueryBuilderParameter?)_content.Value; - set => _content = new InputPropertyInfo { Name = "content", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? OwnerId - { - get => (QueryBuilderParameter?)_ownerId.Value; - set => _ownerId = new InputPropertyInfo { Name = "ownerId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? WorkspaceId - { - get => (QueryBuilderParameter?)_workspaceId.Value; - set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Topics - { - get => (QueryBuilderParameter?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_and.Name != null) yield return _and; - if (_or.Name != null) yield return _or; - if (_content.Name != null) yield return _content; - if (_ownerId.Name != null) yield return _ownerId; - if (_workspaceId.Name != null) yield return _workspaceId; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class LiveDocInputGql : IGraphQlInputObject - { - private InputPropertyInfo _content; - private InputPropertyInfo _ownerId; - private InputPropertyInfo _workspaceId; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Content - { - get => (QueryBuilderParameter?)_content.Value; - set => _content = new InputPropertyInfo { Name = "content", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? OwnerId - { - get => (QueryBuilderParameter?)_ownerId.Value; - set => _ownerId = new InputPropertyInfo { Name = "ownerId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? WorkspaceId - { - get => (QueryBuilderParameter?)_workspaceId.Value; - set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Topics - { - get => (QueryBuilderParameter?>?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_content.Name != null) yield return _content; - if (_ownerId.Name != null) yield return _ownerId; - if (_workspaceId.Name != null) yield return _workspaceId; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class LiveDocInputHeadersGql : IGraphQlInputObject - { - private InputPropertyInfo _authorization; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Authorization - { - get => (QueryBuilderParameter?)_authorization.Value; - set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_authorization.Name != null) yield return _authorization; - } - } - - public partial class StringOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _and; - private InputPropertyInfo _or; - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - private InputPropertyInfo _contains; - private InputPropertyInfo _ncontains; - private InputPropertyInfo _in; - private InputPropertyInfo _nin; - private InputPropertyInfo _startsWith; - private InputPropertyInfo _nstartsWith; - private InputPropertyInfo _endsWith; - private InputPropertyInfo _nendsWith; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? And - { - get => (QueryBuilderParameter?>?)_and.Value; - set => _and = new InputPropertyInfo { Name = "and", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Or - { - get => (QueryBuilderParameter?>?)_or.Value; - set => _or = new InputPropertyInfo { Name = "or", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Contains - { - get => (QueryBuilderParameter?)_contains.Value; - set => _contains = new InputPropertyInfo { Name = "contains", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ncontains - { - get => (QueryBuilderParameter?)_ncontains.Value; - set => _ncontains = new InputPropertyInfo { Name = "ncontains", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? In - { - get => (QueryBuilderParameter?>?)_in.Value; - set => _in = new InputPropertyInfo { Name = "in", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Nin - { - get => (QueryBuilderParameter?>?)_nin.Value; - set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? StartsWith - { - get => (QueryBuilderParameter?)_startsWith.Value; - set => _startsWith = new InputPropertyInfo { Name = "startsWith", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NstartsWith - { - get => (QueryBuilderParameter?)_nstartsWith.Value; - set => _nstartsWith = new InputPropertyInfo { Name = "nstartsWith", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? EndsWith - { - get => (QueryBuilderParameter?)_endsWith.Value; - set => _endsWith = new InputPropertyInfo { Name = "endsWith", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NendsWith - { - get => (QueryBuilderParameter?)_nendsWith.Value; - set => _nendsWith = new InputPropertyInfo { Name = "nendsWith", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_and.Name != null) yield return _and; - if (_or.Name != null) yield return _or; - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - if (_contains.Name != null) yield return _contains; - if (_ncontains.Name != null) yield return _ncontains; - if (_in.Name != null) yield return _in; - if (_nin.Name != null) yield return _nin; - if (_startsWith.Name != null) yield return _startsWith; - if (_nstartsWith.Name != null) yield return _nstartsWith; - if (_endsWith.Name != null) yield return _endsWith; - if (_nendsWith.Name != null) yield return _nendsWith; - } - } - - public partial class UserRoleOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - private InputPropertyInfo _in; - private InputPropertyInfo _nin; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? In - { - get => (QueryBuilderParameter?>?)_in.Value; - set => _in = new InputPropertyInfo { Name = "in", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Nin - { - get => (QueryBuilderParameter?>?)_nin.Value; - set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - if (_in.Name != null) yield return _in; - if (_nin.Name != null) yield return _nin; - } - } - - public partial class UuidOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - private InputPropertyInfo _in; - private InputPropertyInfo _nin; - private InputPropertyInfo _gt; - private InputPropertyInfo _ngt; - private InputPropertyInfo _gte; - private InputPropertyInfo _ngte; - private InputPropertyInfo _lt; - private InputPropertyInfo _nlt; - private InputPropertyInfo _lte; - private InputPropertyInfo _nlte; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? In - { - get => (QueryBuilderParameter?>?)_in.Value; - set => _in = new InputPropertyInfo { Name = "in", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Nin - { - get => (QueryBuilderParameter?>?)_nin.Value; - set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Gt - { - get => (QueryBuilderParameter?)_gt.Value; - set => _gt = new InputPropertyInfo { Name = "gt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ngt - { - get => (QueryBuilderParameter?)_ngt.Value; - set => _ngt = new InputPropertyInfo { Name = "ngt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Gte - { - get => (QueryBuilderParameter?)_gte.Value; - set => _gte = new InputPropertyInfo { Name = "gte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ngte - { - get => (QueryBuilderParameter?)_ngte.Value; - set => _ngte = new InputPropertyInfo { Name = "ngte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Lt - { - get => (QueryBuilderParameter?)_lt.Value; - set => _lt = new InputPropertyInfo { Name = "lt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Nlt - { - get => (QueryBuilderParameter?)_nlt.Value; - set => _nlt = new InputPropertyInfo { Name = "nlt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Lte - { - get => (QueryBuilderParameter?)_lte.Value; - set => _lte = new InputPropertyInfo { Name = "lte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Nlte - { - get => (QueryBuilderParameter?)_nlte.Value; - set => _nlte = new InputPropertyInfo { Name = "nlte", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - if (_in.Name != null) yield return _in; - if (_nin.Name != null) yield return _nin; - if (_gt.Name != null) yield return _gt; - if (_ngt.Name != null) yield return _ngt; - if (_gte.Name != null) yield return _gte; - if (_ngte.Name != null) yield return _ngte; - if (_lt.Name != null) yield return _lt; - if (_nlt.Name != null) yield return _nlt; - if (_lte.Name != null) yield return _lte; - if (_nlte.Name != null) yield return _nlte; - } - } - - public partial class BooleanOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - } - } - - public partial class DateTimeOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - private InputPropertyInfo _in; - private InputPropertyInfo _nin; - private InputPropertyInfo _gt; - private InputPropertyInfo _ngt; - private InputPropertyInfo _gte; - private InputPropertyInfo _ngte; - private InputPropertyInfo _lt; - private InputPropertyInfo _nlt; - private InputPropertyInfo _lte; - private InputPropertyInfo _nlte; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? In - { - get => (QueryBuilderParameter?>?)_in.Value; - set => _in = new InputPropertyInfo { Name = "in", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Nin - { - get => (QueryBuilderParameter?>?)_nin.Value; - set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Gt - { - get => (QueryBuilderParameter?)_gt.Value; - set => _gt = new InputPropertyInfo { Name = "gt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ngt - { - get => (QueryBuilderParameter?)_ngt.Value; - set => _ngt = new InputPropertyInfo { Name = "ngt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Gte - { - get => (QueryBuilderParameter?)_gte.Value; - set => _gte = new InputPropertyInfo { Name = "gte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ngte - { - get => (QueryBuilderParameter?)_ngte.Value; - set => _ngte = new InputPropertyInfo { Name = "ngte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Lt - { - get => (QueryBuilderParameter?)_lt.Value; - set => _lt = new InputPropertyInfo { Name = "lt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Nlt - { - get => (QueryBuilderParameter?)_nlt.Value; - set => _nlt = new InputPropertyInfo { Name = "nlt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Lte - { - get => (QueryBuilderParameter?)_lte.Value; - set => _lte = new InputPropertyInfo { Name = "lte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Nlte - { - get => (QueryBuilderParameter?)_nlte.Value; - set => _nlte = new InputPropertyInfo { Name = "nlte", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - if (_in.Name != null) yield return _in; - if (_nin.Name != null) yield return _nin; - if (_gt.Name != null) yield return _gt; - if (_ngt.Name != null) yield return _ngt; - if (_gte.Name != null) yield return _gte; - if (_ngte.Name != null) yield return _ngte; - if (_lt.Name != null) yield return _lt; - if (_nlt.Name != null) yield return _nlt; - if (_lte.Name != null) yield return _lte; - if (_nlte.Name != null) yield return _nlte; - } - } - - public partial class ListStringOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _all; - private InputPropertyInfo _none; - private InputPropertyInfo _some; - private InputPropertyInfo _any; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? All - { - get => (QueryBuilderParameter?)_all.Value; - set => _all = new InputPropertyInfo { Name = "all", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? None - { - get => (QueryBuilderParameter?)_none.Value; - set => _none = new InputPropertyInfo { Name = "none", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Some - { - get => (QueryBuilderParameter?)_some.Value; - set => _some = new InputPropertyInfo { Name = "some", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Any - { - get => (QueryBuilderParameter?)_any.Value; - set => _any = new InputPropertyInfo { Name = "any", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_all.Name != null) yield return _all; - if (_none.Name != null) yield return _none; - if (_some.Name != null) yield return _some; - if (_any.Name != null) yield return _any; - } - } - - public partial class PushUserInputGql : IGraphQlInputObject - { - private InputPropertyInfo _userPushRow; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? UserPushRow - { - get => (QueryBuilderParameter?>?)_userPushRow.Value; - set => _userPushRow = new InputPropertyInfo { Name = "userPushRow", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_userPushRow.Name != null) yield return _userPushRow; - } - } - - public partial class PushWorkspaceInputGql : IGraphQlInputObject - { - private InputPropertyInfo _workspacePushRow; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? WorkspacePushRow - { - get => (QueryBuilderParameter?>?)_workspacePushRow.Value; - set => _workspacePushRow = new InputPropertyInfo { Name = "workspacePushRow", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_workspacePushRow.Name != null) yield return _workspacePushRow; - } - } - - public partial class PushLiveDocInputGql : IGraphQlInputObject - { - private InputPropertyInfo _liveDocPushRow; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? LiveDocPushRow - { - get => (QueryBuilderParameter?>?)_liveDocPushRow.Value; - set => _liveDocPushRow = new InputPropertyInfo { Name = "liveDocPushRow", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_liveDocPushRow.Name != null) yield return _liveDocPushRow; - } - } - #endregion - - #region data classes - public partial class UserPullBulkGql - { - public ICollection? Documents { get; set; } - public CheckpointGql? Checkpoint { get; set; } - } - - public partial class WorkspacePullBulkGql - { - public ICollection? Documents { get; set; } - public CheckpointGql? Checkpoint { get; set; } - } - - public partial class LiveDocPullBulkGql - { - public ICollection? Documents { get; set; } - public CheckpointGql? Checkpoint { get; set; } - } - - public partial class QueryGql - { - public UserPullBulkGql? PullUser { get; set; } - public WorkspacePullBulkGql? PullWorkspace { get; set; } - public LiveDocPullBulkGql? PullLiveDoc { get; set; } - } - - public partial class MutationGql - { - public PushUserPayloadGql? PushUser { get; set; } - public PushWorkspacePayloadGql? PushWorkspace { get; set; } - public PushLiveDocPayloadGql? PushLiveDoc { get; set; } - } - - public partial class SubscriptionGql - { - public UserPullBulkGql? StreamUser { get; set; } - public WorkspacePullBulkGql? StreamWorkspace { get; set; } - public LiveDocPullBulkGql? StreamLiveDoc { get; set; } - } - - public partial class UserGql - { - public string FirstName { get; set; } - public string LastName { get; set; } - public string? FullName { get; set; } - public string? Email { get; set; } - public LiveDocs.GraphQLApi.Security.UserRole Role { get; set; } - public string? JwtAccessToken { get; set; } - public Guid WorkspaceId { get; set; } - public Guid Id { get; set; } - public bool IsDeleted { get; set; } - public DateTimeOffset UpdatedAt { get; set; } - public ICollection? Topics { get; set; } - } - - public partial class CheckpointGql - { - public Guid? LastDocumentId { get; set; } - public DateTimeOffset? UpdatedAt { get; set; } - } - - [GraphQlObjectType("AuthenticationError")] - public partial class AuthenticationErrorGql : IPushUserErrorGql, IPushWorkspaceErrorGql, IPushLiveDocErrorGql, IErrorGql - { - public string Message { get; set; } - } - - [GraphQlObjectType("UnauthorizedAccessError")] - public partial class UnauthorizedAccessErrorGql : IPushUserErrorGql, IPushWorkspaceErrorGql, IPushLiveDocErrorGql, IErrorGql - { - public string Message { get; set; } - } - - public partial class WorkspaceGql - { - public string Name { get; set; } - public Guid Id { get; set; } - public bool IsDeleted { get; set; } - public DateTimeOffset UpdatedAt { get; set; } - public ICollection? Topics { get; set; } - } - - public partial class LiveDocGql - { - public string Content { get; set; } - public Guid OwnerId { get; set; } - public Guid WorkspaceId { get; set; } - public Guid Id { get; set; } - public bool IsDeleted { get; set; } - public DateTimeOffset UpdatedAt { get; set; } - public ICollection? Topics { get; set; } - } - - public partial interface IErrorGql - { - string Message { get; set; } - } - - public partial interface IPushUserErrorGql - { - } - - public partial class PushUserPayloadGql - { - public ICollection? User { get; set; } - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] - #endif - public ICollection? Errors { get; set; } - } - - public partial interface IPushWorkspaceErrorGql - { - } - - public partial class PushWorkspacePayloadGql - { - public ICollection? Workspace { get; set; } - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] - #endif - public ICollection? Errors { get; set; } - } - - public partial interface IPushLiveDocErrorGql - { - } - - public partial class PushLiveDocPayloadGql - { - public ICollection? LiveDoc { get; set; } - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] - #endif - public ICollection? Errors { get; set; } - } - #endregion - #nullable restore -} + +namespace RxDBDotNet.Tests.Model +{ + #region base classes + public struct GraphQlFieldMetadata + { + public string Name { get; set; } + public string DefaultAlias { get; set; } + public bool IsComplex { get; set; } + public bool RequiresParameters { get; set; } + public global::System.Type QueryBuilderType { get; set; } + } + + public enum Formatting + { + None, + Indented + } + + public class GraphQlObjectTypeAttribute : global::System.Attribute + { + public string TypeName { get; } + + public GraphQlObjectTypeAttribute(string typeName) => TypeName = typeName; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + public class QueryBuilderParameterConverter : global::Newtonsoft.Json.JsonConverter + { + public override object ReadJson(JsonReader reader, global::System.Type objectType, object existingValue, JsonSerializer serializer) + { + switch (reader.TokenType) + { + case JsonToken.Null: + return null; + + default: + return (QueryBuilderParameter)(T)serializer.Deserialize(reader, typeof(T)); + } + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + if (value == null) + writer.WriteNull(); + else + serializer.Serialize(writer, ((QueryBuilderParameter)value).Value, typeof(T)); + } + + public override bool CanConvert(global::System.Type objectType) => objectType.IsSubclassOf(typeof(QueryBuilderParameter)); + } + + public class GraphQlInterfaceJsonConverter : global::Newtonsoft.Json.JsonConverter + { + private const string FieldNameType = "__typename"; + + private static readonly Dictionary InterfaceTypeMapping = + typeof(GraphQlInterfaceJsonConverter).Assembly.GetTypes() + .Select(t => new { Type = t, Attribute = t.GetCustomAttribute() }) + .Where(x => x.Attribute != null && x.Type.Namespace == typeof(GraphQlInterfaceJsonConverter).Namespace) + .ToDictionary(x => x.Attribute.TypeName, x => x.Type); + + public override bool CanConvert(global::System.Type objectType) => objectType.IsInterface || objectType.IsArray; + + public override object ReadJson(JsonReader reader, global::System.Type objectType, object existingValue, JsonSerializer serializer) + { + while (reader.TokenType == JsonToken.Comment) + reader.Read(); + + switch (reader.TokenType) + { + case JsonToken.Null: + return null; + + case JsonToken.StartObject: + var jObject = JObject.Load(reader); + if (!jObject.TryGetValue(FieldNameType, out var token) || token.Type != JTokenType.String) + throw CreateJsonReaderException(reader, $"\"{GetType().FullName}\" requires JSON object to contain \"{FieldNameType}\" field with type name"); + + var typeName = token.Value(); + if (!InterfaceTypeMapping.TryGetValue(typeName, out var type)) + throw CreateJsonReaderException(reader, $"type \"{typeName}\" not found"); + + using (reader = CloneReader(jObject, reader)) + return serializer.Deserialize(reader, type); + + case JsonToken.StartArray: + var elementType = GetElementType(objectType); + if (elementType == null) + throw CreateJsonReaderException(reader, $"array element type could not be resolved for type \"{objectType.FullName}\""); + + return ReadArray(reader, objectType, elementType, serializer); + + default: + throw CreateJsonReaderException(reader, $"unrecognized token: {reader.TokenType}"); + } + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) => serializer.Serialize(writer, value); + + private static JsonReader CloneReader(JToken jToken, JsonReader reader) + { + var jObjectReader = jToken.CreateReader(); + jObjectReader.Culture = reader.Culture; + jObjectReader.CloseInput = reader.CloseInput; + jObjectReader.SupportMultipleContent = reader.SupportMultipleContent; + jObjectReader.DateTimeZoneHandling = reader.DateTimeZoneHandling; + jObjectReader.FloatParseHandling = reader.FloatParseHandling; + jObjectReader.DateFormatString = reader.DateFormatString; + jObjectReader.DateParseHandling = reader.DateParseHandling; + return jObjectReader; + } + + private static JsonReaderException CreateJsonReaderException(JsonReader reader, string message) + { + if (reader is IJsonLineInfo lineInfo && lineInfo.HasLineInfo()) + return new JsonReaderException(message, reader.Path, lineInfo.LineNumber, lineInfo.LinePosition, null); + + return new JsonReaderException(message); + } + + private static global::System.Type GetElementType(global::System.Type arrayOrGenericContainer) => + arrayOrGenericContainer.IsArray ? arrayOrGenericContainer.GetElementType() : arrayOrGenericContainer.GenericTypeArguments.FirstOrDefault(); + + private IList ReadArray(JsonReader reader, global::System.Type targetType, global::System.Type elementType, JsonSerializer serializer) + { + var list = CreateCompatibleList(targetType, elementType); + while (reader.Read() && reader.TokenType != JsonToken.EndArray) + list.Add(ReadJson(reader, elementType, null, serializer)); + + if (!targetType.IsArray) + return list; + + var array = Array.CreateInstance(elementType, list.Count); + list.CopyTo(array, 0); + return array; + } + + private static IList CreateCompatibleList(global::System.Type targetContainerType, global::System.Type elementType) => + (IList)Activator.CreateInstance(targetContainerType.IsArray || targetContainerType.IsAbstract ? typeof(List<>).MakeGenericType(elementType) : targetContainerType); + } + #endif + + internal static class GraphQlQueryHelper + { + private static readonly Regex RegexGraphQlIdentifier = new Regex(@"^[_A-Za-z][_0-9A-Za-z]*$", RegexOptions.Compiled); + private static readonly Regex RegexEscapeGraphQlString = new Regex(@"[\\\""/\b\f\n\r\t]", RegexOptions.Compiled); + + public static string GetIndentation(int level, byte indentationSize) + { + return new String(' ', level * indentationSize); + } + + public static string EscapeGraphQlStringValue(string value) + { + return RegexEscapeGraphQlString.Replace(value, m => @$"\{GetEscapeSequence(m.Value)}"); + } + + private static string GetEscapeSequence(string input) + { + switch (input) + { + case "\\": + return "\\"; + case "\"": + return "\""; + case "/": + return "/"; + case "\b": + return "b"; + case "\f": + return "f"; + case "\n": + return "n"; + case "\r": + return "r"; + case "\t": + return "t"; + default: + throw new InvalidOperationException($"invalid character: {input}"); + } + } + + public static string BuildArgumentValue(object value, string formatMask, GraphQlBuilderOptions options, int level) + { + var serializer = options.ArgumentBuilder ?? DefaultGraphQlArgumentBuilder.Instance; + if (serializer.TryBuild(new GraphQlArgumentBuilderContext { Value = value, FormatMask = formatMask, Options = options, Level = level }, out var serializedValue)) + return serializedValue; + + if (value is null) + return "null"; + + var enumerable = value as IEnumerable; + if (!String.IsNullOrEmpty(formatMask) && enumerable == null) + return + value is IFormattable formattable + ? $"\"{EscapeGraphQlStringValue(formattable.ToString(formatMask, CultureInfo.InvariantCulture))}\"" + : throw new ArgumentException($"Value must implement {nameof(IFormattable)} interface to use a format mask. ", nameof(value)); + + if (value is Enum @enum) + return ConvertEnumToString(@enum); + + if (value is bool @bool) + return @bool ? "true" : "false"; + + if (value is DateTime dateTime) + return $"\"{dateTime.ToString("O")}\""; + + if (value is DateTimeOffset dateTimeOffset) + return $"\"{dateTimeOffset.ToString("O")}\""; + + if (value is IGraphQlInputObject inputObject) + return BuildInputObject(inputObject, options, level + 2); + + if (value is Guid) + return $"\"{value}\""; + + if (value is String @string) + return $"\"{EscapeGraphQlStringValue(@string)}\""; + + if (enumerable != null) + return BuildEnumerableArgument(enumerable, formatMask, options, level, '[', ']'); + + if (value is short || value is ushort || value is byte || value is int || value is uint || value is long || value is ulong || value is float || value is double || value is decimal) + return Convert.ToString(value, CultureInfo.InvariantCulture); + + var argumentValue = EscapeGraphQlStringValue(Convert.ToString(value, CultureInfo.InvariantCulture)); + return $"\"{argumentValue}\""; + } + + public static string BuildEnumerableArgument(IEnumerable enumerable, string formatMask, GraphQlBuilderOptions options, int level, char openingSymbol, char closingSymbol) + { + var builder = new StringBuilder(); + builder.Append(openingSymbol); + var delimiter = String.Empty; + foreach (var item in enumerable) + { + builder.Append(delimiter); + + if (options.Formatting == Formatting.Indented) + { + builder.AppendLine(); + builder.Append(GetIndentation(level + 1, options.IndentationSize)); + } + + builder.Append(BuildArgumentValue(item, formatMask, options, level)); + delimiter = ","; + } + + builder.Append(closingSymbol); + return builder.ToString(); + } + + public static string BuildInputObject(IGraphQlInputObject inputObject, GraphQlBuilderOptions options, int level) + { + var builder = new StringBuilder(); + builder.Append("{"); + + var isIndentedFormatting = options.Formatting == Formatting.Indented; + string valueSeparator; + if (isIndentedFormatting) + { + builder.AppendLine(); + valueSeparator = ": "; + } + else + valueSeparator = ":"; + + var separator = String.Empty; + foreach (var propertyValue in inputObject.GetPropertyValues()) + { + var queryBuilderParameter = propertyValue.Value as QueryBuilderParameter; + var value = + queryBuilderParameter?.Name != null + ? $"${queryBuilderParameter.Name}" + : BuildArgumentValue(queryBuilderParameter == null ? propertyValue.Value : queryBuilderParameter.Value, propertyValue.FormatMask, options, level); + + builder.Append(isIndentedFormatting ? GetIndentation(level, options.IndentationSize) : separator); + builder.Append(propertyValue.Name); + builder.Append(valueSeparator); + builder.Append(value); + + separator = ","; + + if (isIndentedFormatting) + builder.AppendLine(); + } + + if (isIndentedFormatting) + builder.Append(GetIndentation(level - 1, options.IndentationSize)); + + builder.Append("}"); + + return builder.ToString(); + } + + public static string BuildDirective(GraphQlDirective directive, GraphQlBuilderOptions options, int level) + { + if (directive == null) + return String.Empty; + + var isIndentedFormatting = options.Formatting == Formatting.Indented; + var indentationSpace = isIndentedFormatting ? " " : String.Empty; + var builder = new StringBuilder(); + builder.Append(indentationSpace); + builder.Append("@"); + builder.Append(directive.Name); + builder.Append("("); + + string separator = null; + foreach (var kvp in directive.Arguments) + { + var argumentName = kvp.Key; + var argument = kvp.Value; + + builder.Append(separator); + builder.Append(argumentName); + builder.Append(":"); + builder.Append(indentationSpace); + + if (argument.Name == null) + builder.Append(BuildArgumentValue(argument.Value, null, options, level)); + else + { + builder.Append("$"); + builder.Append(argument.Name); + } + + separator = isIndentedFormatting ? ", " : ","; + } + + builder.Append(")"); + return builder.ToString(); + } + + public static void ValidateGraphQlIdentifier(string name, string identifier) + { + if (identifier != null && !RegexGraphQlIdentifier.IsMatch(identifier)) + throw new ArgumentException("value must match " + RegexGraphQlIdentifier, name); + } + + private static string ConvertEnumToString(Enum @enum) + { + var enumMember = @enum.GetType().GetField(@enum.ToString()); + if (enumMember == null) + throw new InvalidOperationException("enum member resolution failed"); + + var enumMemberAttribute = (EnumMemberAttribute)enumMember.GetCustomAttribute(typeof(EnumMemberAttribute)); + + return enumMemberAttribute == null + ? @enum.ToString() + : enumMemberAttribute.Value; + } + } + + public interface IGraphQlArgumentBuilder + { + bool TryBuild(GraphQlArgumentBuilderContext context, out string graphQlString); + } + + public class GraphQlArgumentBuilderContext + { + public object Value { get; set; } + public string FormatMask { get; set; } + public GraphQlBuilderOptions Options { get; set; } + public int Level { get; set; } + } + + public class DefaultGraphQlArgumentBuilder : IGraphQlArgumentBuilder + { + private static readonly Regex RegexWhiteSpace = new Regex(@"\s", RegexOptions.Compiled); + + public static readonly DefaultGraphQlArgumentBuilder Instance = new(); + + public bool TryBuild(GraphQlArgumentBuilderContext context, out string graphQlString) + { + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + if (context.Value is JValue jValue) + { + switch (jValue.Type) + { + case JTokenType.Null: + graphQlString = "null"; + return true; + + case JTokenType.Integer: + case JTokenType.Float: + case JTokenType.Boolean: + graphQlString = GraphQlQueryHelper.BuildArgumentValue(jValue.Value, null, context.Options, context.Level); + return true; + + case JTokenType.String: + graphQlString = $"\"{GraphQlQueryHelper.EscapeGraphQlStringValue((string)jValue.Value)}\""; + return true; + + default: + graphQlString = $"\"{jValue.Value}\""; + return true; + } + } + + if (context.Value is JProperty jProperty) + { + if (RegexWhiteSpace.IsMatch(jProperty.Name)) + throw new ArgumentException($"JSON object keys used as GraphQL arguments must not contain whitespace; key: {jProperty.Name}"); + + graphQlString = $"{jProperty.Name}:{(context.Options.Formatting == Formatting.Indented ? " " : null)}{GraphQlQueryHelper.BuildArgumentValue(jProperty.Value, null, context.Options, context.Level)}"; + return true; + } + + if (context.Value is JObject jObject) + { + graphQlString = GraphQlQueryHelper.BuildEnumerableArgument(jObject, null, context.Options, context.Level + 1, '{', '}'); + return true; + } + #endif + + graphQlString = null; + return false; + } + } + + internal struct InputPropertyInfo + { + public string Name { get; set; } + public object Value { get; set; } + public string FormatMask { get; set; } + } + + internal interface IGraphQlInputObject + { + IEnumerable GetPropertyValues(); + } + + public interface IGraphQlQueryBuilder + { + void Clear(); + void IncludeAllFields(); + string Build(Formatting formatting = Formatting.None, byte indentationSize = 2); + } + + public struct QueryBuilderArgumentInfo + { + public string ArgumentName { get; set; } + public QueryBuilderParameter ArgumentValue { get; set; } + public string FormatMask { get; set; } + } + + public abstract class QueryBuilderParameter + { + private string _name; + + internal string GraphQlTypeName { get; } + internal object Value { get; set; } + + public string Name + { + get => _name; + set + { + GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(Name), value); + _name = value; + } + } + + protected QueryBuilderParameter(string name, string graphQlTypeName, object value) + { + Name = name?.Trim(); + GraphQlTypeName = graphQlTypeName?.Replace(" ", null).Replace("\t", null).Replace("\n", null).Replace("\r", null); + Value = value; + } + + protected QueryBuilderParameter(object value) => Value = value; + } + + public class QueryBuilderParameter : QueryBuilderParameter + { + public new T Value + { + get => base.Value == null ? default : (T)base.Value; + set => base.Value = value; + } + + protected QueryBuilderParameter(string name, string graphQlTypeName, T value) : base(name, graphQlTypeName, value) + { + EnsureGraphQlTypeName(graphQlTypeName); + } + + protected QueryBuilderParameter(string name, string graphQlTypeName) : base(name, graphQlTypeName, null) + { + EnsureGraphQlTypeName(graphQlTypeName); + } + + private QueryBuilderParameter(T value) : base(value) + { + } + + public void ResetValue() => base.Value = null; + + public static implicit operator QueryBuilderParameter(T value) => new QueryBuilderParameter(value); + + public static implicit operator T(QueryBuilderParameter parameter) => parameter.Value; + + private static void EnsureGraphQlTypeName(string graphQlTypeName) + { + if (String.IsNullOrWhiteSpace(graphQlTypeName)) + throw new ArgumentException("value required", nameof(graphQlTypeName)); + } + } + + public class GraphQlQueryParameter : QueryBuilderParameter + { + private string _formatMask; + + public string FormatMask + { + get => _formatMask; + set => _formatMask = + typeof(IFormattable).IsAssignableFrom(typeof(T)) + ? value + : throw new InvalidOperationException($"Value must be of {nameof(IFormattable)} type. "); + } + + public GraphQlQueryParameter(string name, string graphQlTypeName = null) + : base(name, graphQlTypeName ?? GetGraphQlTypeName(typeof(T))) + { + } + + public GraphQlQueryParameter(string name, string graphQlTypeName, T defaultValue) + : base(name, graphQlTypeName, defaultValue) + { + } + + public GraphQlQueryParameter(string name, T defaultValue, bool isNullable = true) + : base(name, GetGraphQlTypeName(typeof(T), isNullable), defaultValue) + { + } + + private static string GetGraphQlTypeName(global::System.Type valueType, bool isNullable) + { + var graphQlTypeName = GetGraphQlTypeName(valueType); + if (!isNullable) + graphQlTypeName += "!"; + + return graphQlTypeName; + } + + private static string GetGraphQlTypeName(global::System.Type valueType) + { + var nullableUnderlyingType = Nullable.GetUnderlyingType(valueType); + valueType = nullableUnderlyingType ?? valueType; + + if (valueType.IsArray) + { + var arrayItemType = GetGraphQlTypeName(valueType.GetElementType()); + return arrayItemType == null ? null : "[" + arrayItemType + "]"; + } + + if (typeof(IEnumerable).IsAssignableFrom(valueType)) + { + var genericArguments = valueType.GetGenericArguments(); + if (genericArguments.Length == 1) + { + var listItemType = GetGraphQlTypeName(valueType.GetGenericArguments()[0]); + return listItemType == null ? null : "[" + listItemType + "]"; + } + } + + if (GraphQlTypes.ReverseMapping.TryGetValue(valueType, out var graphQlTypeName)) + return graphQlTypeName; + + if (valueType == typeof(string)) + return "String"; + + var nullableSuffix = nullableUnderlyingType == null ? null : "?"; + graphQlTypeName = GetValueTypeGraphQlTypeName(valueType); + return graphQlTypeName == null ? null : graphQlTypeName + nullableSuffix; + } + + private static string GetValueTypeGraphQlTypeName(global::System.Type valueType) + { + if (valueType == typeof(bool)) + return "Boolean"; + + if (valueType == typeof(float) || valueType == typeof(double) || valueType == typeof(decimal)) + return "Float"; + + if (valueType == typeof(Guid)) + return "ID"; + + if (valueType == typeof(sbyte) || valueType == typeof(byte) || valueType == typeof(short) || valueType == typeof(ushort) || valueType == typeof(int) || valueType == typeof(uint) || + valueType == typeof(long) || valueType == typeof(ulong)) + return "Int"; + + return null; + } + } + + public abstract class GraphQlDirective + { + private readonly Dictionary _arguments = new Dictionary(); + + internal IEnumerable> Arguments => _arguments; + + public string Name { get; } + + protected GraphQlDirective(string name) + { + GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(name), name); + Name = name; + } + + protected void AddArgument(string name, QueryBuilderParameter value) + { + if (value != null) + _arguments[name] = value; + } + } + + public class GraphQlBuilderOptions + { + public Formatting Formatting { get; set; } + public byte IndentationSize { get; set; } = 2; + public IGraphQlArgumentBuilder ArgumentBuilder { get; set; } + } + + public abstract partial class GraphQlQueryBuilder : IGraphQlQueryBuilder + { + private readonly Dictionary _fieldCriteria = new Dictionary(); + + private readonly string _operationType; + private readonly string _operationName; + private Dictionary _fragments; + private List _queryParameters; + + protected abstract string TypeName { get; } + + public abstract IReadOnlyList AllFields { get; } + + protected GraphQlQueryBuilder(string operationType, string operationName) + { + GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(operationName), operationName); + _operationType = operationType; + _operationName = operationName; + } + + public virtual void Clear() + { + _fieldCriteria.Clear(); + _fragments?.Clear(); + _queryParameters?.Clear(); + } + + void IGraphQlQueryBuilder.IncludeAllFields() + { + IncludeAllFields(); + } + + public string Build(Formatting formatting = Formatting.None, byte indentationSize = 2) + { + return Build(new GraphQlBuilderOptions { Formatting = formatting, IndentationSize = indentationSize }); + } + + public string Build(GraphQlBuilderOptions options) + { + return Build(options, 1); + } + + protected void IncludeAllFields() + { + IncludeFields(AllFields.Where(f => !f.RequiresParameters)); + } + + protected virtual string Build(GraphQlBuilderOptions options, int level) + { + var isIndentedFormatting = options.Formatting == Formatting.Indented; + var separator = String.Empty; + var indentationSpace = isIndentedFormatting ? " " : String.Empty; + var builder = new StringBuilder(); + + BuildOperationSignature(builder, options, indentationSpace, level); + + if (builder.Length > 0 || level > 1) + builder.Append(indentationSpace); + + builder.Append("{"); + + if (isIndentedFormatting) + builder.AppendLine(); + + separator = String.Empty; + + foreach (var criteria in _fieldCriteria.Values.Concat(_fragments?.Values ?? Enumerable.Empty())) + { + var fieldCriteria = criteria.Build(options, level); + if (isIndentedFormatting) + builder.AppendLine(fieldCriteria); + else if (!String.IsNullOrEmpty(fieldCriteria)) + { + builder.Append(separator); + builder.Append(fieldCriteria); + } + + separator = ","; + } + + if (isIndentedFormatting) + builder.Append(GraphQlQueryHelper.GetIndentation(level - 1, options.IndentationSize)); + + builder.Append("}"); + + return builder.ToString(); + } + + private void BuildOperationSignature(StringBuilder builder, GraphQlBuilderOptions options, string indentationSpace, int level) + { + if (String.IsNullOrEmpty(_operationType)) + return; + + builder.Append(_operationType); + + if (!String.IsNullOrEmpty(_operationName)) + { + builder.Append(" "); + builder.Append(_operationName); + } + + if (_queryParameters?.Count > 0) + { + builder.Append(indentationSpace); + builder.Append("("); + + var separator = String.Empty; + var isIndentedFormatting = options.Formatting == Formatting.Indented; + + foreach (var queryParameterInfo in _queryParameters) + { + if (isIndentedFormatting) + { + builder.AppendLine(separator); + builder.Append(GraphQlQueryHelper.GetIndentation(level, options.IndentationSize)); + } + else + builder.Append(separator); + + builder.Append("$"); + builder.Append(queryParameterInfo.ArgumentValue.Name); + builder.Append(":"); + builder.Append(indentationSpace); + + builder.Append(queryParameterInfo.ArgumentValue.GraphQlTypeName); + + if (!queryParameterInfo.ArgumentValue.GraphQlTypeName.EndsWith("!") && queryParameterInfo.ArgumentValue.Value is not null) + { + builder.Append(indentationSpace); + builder.Append("="); + builder.Append(indentationSpace); + builder.Append(GraphQlQueryHelper.BuildArgumentValue(queryParameterInfo.ArgumentValue.Value, queryParameterInfo.FormatMask, options, 0)); + } + + if (!isIndentedFormatting) + separator = ","; + } + + builder.Append(")"); + } + } + + protected void IncludeScalarField(string fieldName, string alias, IList args, GraphQlDirective[] directives) + { + _fieldCriteria[alias ?? fieldName] = new GraphQlScalarFieldCriteria(fieldName, alias, args, directives); + } + + protected void IncludeObjectField(string fieldName, string alias, GraphQlQueryBuilder objectFieldQueryBuilder, IList args, GraphQlDirective[] directives) + { + _fieldCriteria[alias ?? fieldName] = new GraphQlObjectFieldCriteria(fieldName, alias, objectFieldQueryBuilder, args, directives); + } + + protected void IncludeFragment(GraphQlQueryBuilder objectFieldQueryBuilder, GraphQlDirective[] directives) + { + _fragments = _fragments ?? new Dictionary(); + _fragments[objectFieldQueryBuilder.TypeName] = new GraphQlFragmentCriteria(objectFieldQueryBuilder, directives); + } + + protected void ExcludeField(string fieldName) + { + if (fieldName == null) + throw new ArgumentNullException(nameof(fieldName)); + + _fieldCriteria.Remove(fieldName); + } + + protected void IncludeFields(IEnumerable fields) + { + IncludeFields(fields, 0, new Dictionary()); + } + + private void IncludeFields(IEnumerable fields, int level, Dictionary parentTypeLevel) + { + global::System.Type builderType = null; + + foreach (var field in fields) + { + if (field.QueryBuilderType == null) + IncludeScalarField(field.Name, field.DefaultAlias, null, null); + else + { + if (_operationType != null && GetType() == field.QueryBuilderType || + parentTypeLevel.TryGetValue(field.QueryBuilderType, out var parentLevel) && parentLevel < level) + continue; + + if (builderType is null) + { + builderType = GetType(); + parentLevel = parentTypeLevel.TryGetValue(builderType, out parentLevel) ? parentLevel : level; + parentTypeLevel[builderType] = Math.Min(level, parentLevel); + } + + var queryBuilder = InitializeChildQueryBuilder(builderType, field.QueryBuilderType, level, parentTypeLevel); + + var includeFragmentMethods = field.QueryBuilderType.GetMethods().Where(IsIncludeFragmentMethod); + + foreach (var includeFragmentMethod in includeFragmentMethods) + includeFragmentMethod.Invoke( + queryBuilder, + new object[] { InitializeChildQueryBuilder(builderType, includeFragmentMethod.GetParameters()[0].ParameterType, level, parentTypeLevel) }); + + if (queryBuilder._fieldCriteria.Count > 0 || queryBuilder._fragments != null) + IncludeObjectField(field.Name, field.DefaultAlias, queryBuilder, null, null); + } + } + } + + private static GraphQlQueryBuilder InitializeChildQueryBuilder(global::System.Type parentQueryBuilderType, global::System.Type queryBuilderType, int level, Dictionary parentTypeLevel) + { + var queryBuilder = (GraphQlQueryBuilder)Activator.CreateInstance(queryBuilderType); + queryBuilder.IncludeFields( + queryBuilder.AllFields.Where(f => !f.RequiresParameters), + level + 1, + parentTypeLevel); + + return queryBuilder; + } + + private static bool IsIncludeFragmentMethod(MethodInfo methodInfo) + { + if (!methodInfo.Name.StartsWith("With") || !methodInfo.Name.EndsWith("Fragment")) + return false; + + var parameters = methodInfo.GetParameters(); + return parameters.Length == 1 && parameters[0].ParameterType.IsSubclassOf(typeof(GraphQlQueryBuilder)); + } + + protected void AddParameter(GraphQlQueryParameter parameter) + { + if (_queryParameters == null) + _queryParameters = new List(); + + _queryParameters.Add(new QueryBuilderArgumentInfo { ArgumentValue = parameter, FormatMask = parameter.FormatMask }); + } + + private abstract class GraphQlFieldCriteria + { + private readonly IList _args; + private readonly GraphQlDirective[] _directives; + + protected readonly string FieldName; + protected readonly string Alias; + + protected static string GetIndentation(Formatting formatting, int level, byte indentationSize) => + formatting == Formatting.Indented ? GraphQlQueryHelper.GetIndentation(level, indentationSize) : null; + + protected GraphQlFieldCriteria(string fieldName, string alias, IList args, GraphQlDirective[] directives) + { + GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(alias), alias); + FieldName = fieldName; + Alias = alias; + _args = args; + _directives = directives; + } + + public abstract string Build(GraphQlBuilderOptions options, int level); + + protected string BuildArgumentClause(GraphQlBuilderOptions options, int level) + { + var separator = options.Formatting == Formatting.Indented ? " " : null; + var argumentCount = _args?.Count ?? 0; + if (argumentCount == 0) + return String.Empty; + + var arguments = + _args.Select( + a => $"{a.ArgumentName}:{separator}{(a.ArgumentValue.Name == null ? GraphQlQueryHelper.BuildArgumentValue(a.ArgumentValue.Value, a.FormatMask, options, level) : $"${a.ArgumentValue.Name}")}"); + + return $"({String.Join($",{separator}", arguments)})"; + } + + protected string BuildDirectiveClause(GraphQlBuilderOptions options, int level) => + _directives == null ? null : String.Concat(_directives.Select(d => d == null ? null : GraphQlQueryHelper.BuildDirective(d, options, level))); + + protected static string BuildAliasPrefix(string alias, Formatting formatting) + { + var separator = formatting == Formatting.Indented ? " " : String.Empty; + return String.IsNullOrWhiteSpace(alias) ? null : $"{alias}:{separator}"; + } + } + + private class GraphQlScalarFieldCriteria : GraphQlFieldCriteria + { + public GraphQlScalarFieldCriteria(string fieldName, string alias, IList args, GraphQlDirective[] directives) + : base(fieldName, alias, args, directives) + { + } + + public override string Build(GraphQlBuilderOptions options, int level) => + GetIndentation(options.Formatting, level, options.IndentationSize) + + BuildAliasPrefix(Alias, options.Formatting) + + FieldName + + BuildArgumentClause(options, level) + + BuildDirectiveClause(options, level); + } + + private class GraphQlObjectFieldCriteria : GraphQlFieldCriteria + { + private readonly GraphQlQueryBuilder _objectQueryBuilder; + + public GraphQlObjectFieldCriteria(string fieldName, string alias, GraphQlQueryBuilder objectQueryBuilder, IList args, GraphQlDirective[] directives) + : base(fieldName, alias, args, directives) + { + _objectQueryBuilder = objectQueryBuilder; + } + + public override string Build(GraphQlBuilderOptions options, int level) => + _objectQueryBuilder._fieldCriteria.Count > 0 || _objectQueryBuilder._fragments?.Count > 0 + ? GetIndentation(options.Formatting, level, options.IndentationSize) + BuildAliasPrefix(Alias, options.Formatting) + FieldName + + BuildArgumentClause(options, level) + BuildDirectiveClause(options, level) + _objectQueryBuilder.Build(options, level + 1) + : null; + } + + private class GraphQlFragmentCriteria : GraphQlFieldCriteria + { + private readonly GraphQlQueryBuilder _objectQueryBuilder; + + public GraphQlFragmentCriteria(GraphQlQueryBuilder objectQueryBuilder, GraphQlDirective[] directives) : base(objectQueryBuilder.TypeName, null, null, directives) + { + _objectQueryBuilder = objectQueryBuilder; + } + + public override string Build(GraphQlBuilderOptions options, int level) => + _objectQueryBuilder._fieldCriteria.Count == 0 + ? null + : GetIndentation(options.Formatting, level, options.IndentationSize) + "..." + (options.Formatting == Formatting.Indented ? " " : null) + "on " + + FieldName + BuildArgumentClause(options, level) + BuildDirectiveClause(options, level) + _objectQueryBuilder.Build(options, level + 1); + } + } + + public abstract partial class GraphQlQueryBuilder : GraphQlQueryBuilder where TQueryBuilder : GraphQlQueryBuilder + { + protected GraphQlQueryBuilder(string operationType = null, string operationName = null) : base(operationType, operationName) + { + } + + /// + /// Includes all fields that don't require parameters into the query. + /// + public TQueryBuilder WithAllFields() + { + IncludeAllFields(); + return (TQueryBuilder)this; + } + + /// + /// Includes all scalar fields that don't require parameters into the query. + /// + public TQueryBuilder WithAllScalarFields() + { + IncludeFields(AllFields.Where(f => !f.IsComplex && !f.RequiresParameters)); + return (TQueryBuilder)this; + } + + public TQueryBuilder ExceptField(string fieldName) + { + ExcludeField(fieldName); + return (TQueryBuilder)this; + } + + /// + /// Includes "__typename" field; included automatically for interface and union types. + /// + public TQueryBuilder WithTypeName(string alias = null, params GraphQlDirective[] directives) + { + IncludeScalarField("__typename", alias, null, directives); + return (TQueryBuilder)this; + } + + protected TQueryBuilder WithScalarField(string fieldName, string alias, GraphQlDirective[] directives, IList args = null) + { + IncludeScalarField(fieldName, alias, args, directives); + return (TQueryBuilder)this; + } + + protected TQueryBuilder WithObjectField(string fieldName, string alias, GraphQlQueryBuilder queryBuilder, GraphQlDirective[] directives, IList args = null) + { + IncludeObjectField(fieldName, alias, queryBuilder, args, directives); + return (TQueryBuilder)this; + } + + protected TQueryBuilder WithFragment(GraphQlQueryBuilder queryBuilder, GraphQlDirective[] directives) + { + IncludeFragment(queryBuilder, directives); + return (TQueryBuilder)this; + } + + protected TQueryBuilder WithParameterInternal(GraphQlQueryParameter parameter) + { + AddParameter(parameter); + return (TQueryBuilder)this; + } + } + + public abstract class GraphQlResponse + { + public TDataContract Data { get; set; } + public ICollection Errors { get; set; } + } + + public class GraphQlQueryError + { + public string Message { get; set; } + public ICollection Locations { get; set; } + } + + public class GraphQlErrorLocation + { + public int Line { get; set; } + public int Column { get; set; } + } + #endregion + + #region GraphQL type helpers + public static class GraphQlTypes + { + public const string Boolean = "Boolean"; + public const string DateTime = "DateTime"; + public const string EmailAddress = "EmailAddress"; + public const string Id = "ID"; + public const string Int = "Int"; + public const string String = "String"; + public const string Uuid = "UUID"; + + public const string UserRole = "UserRole"; + + public const string AuthenticationError = "AuthenticationError"; + public const string Checkpoint = "Checkpoint"; + public const string LiveDoc = "LiveDoc"; + public const string LiveDocPullBulk = "LiveDocPullBulk"; + public const string Mutation = "Mutation"; + public const string PushLiveDocPayload = "PushLiveDocPayload"; + public const string PushUserPayload = "PushUserPayload"; + public const string PushWorkspacePayload = "PushWorkspacePayload"; + public const string Query = "Query"; + public const string Subscription = "Subscription"; + public const string UnauthorizedAccessError = "UnauthorizedAccessError"; + public const string User = "User"; + public const string UserPullBulk = "UserPullBulk"; + public const string Workspace = "Workspace"; + public const string WorkspacePullBulk = "WorkspacePullBulk"; + + public const string BooleanOperationFilterInput = "BooleanOperationFilterInput"; + public const string DateTimeOperationFilterInput = "DateTimeOperationFilterInput"; + public const string ListStringOperationFilterInput = "ListStringOperationFilterInput"; + public const string LiveDocFilterInput = "LiveDocFilterInput"; + public const string LiveDocInput = "LiveDocInput"; + public const string LiveDocInputCheckpoint = "LiveDocInputCheckpoint"; + public const string LiveDocInputHeaders = "LiveDocInputHeaders"; + public const string LiveDocInputPushRow = "LiveDocInputPushRow"; + public const string PushLiveDocInput = "PushLiveDocInput"; + public const string PushUserInput = "PushUserInput"; + public const string PushWorkspaceInput = "PushWorkspaceInput"; + public const string StringOperationFilterInput = "StringOperationFilterInput"; + public const string UserFilterInput = "UserFilterInput"; + public const string UserInput = "UserInput"; + public const string UserInputCheckpoint = "UserInputCheckpoint"; + public const string UserInputHeaders = "UserInputHeaders"; + public const string UserInputPushRow = "UserInputPushRow"; + public const string UserRoleOperationFilterInput = "UserRoleOperationFilterInput"; + public const string UuidOperationFilterInput = "UuidOperationFilterInput"; + public const string WorkspaceFilterInput = "WorkspaceFilterInput"; + public const string WorkspaceInput = "WorkspaceInput"; + public const string WorkspaceInputCheckpoint = "WorkspaceInputCheckpoint"; + public const string WorkspaceInputHeaders = "WorkspaceInputHeaders"; + public const string WorkspaceInputPushRow = "WorkspaceInputPushRow"; + + public const string PushLiveDocError = "PushLiveDocError"; + public const string PushUserError = "PushUserError"; + public const string PushWorkspaceError = "PushWorkspaceError"; + + public const string Error = "Error"; + + public static readonly IReadOnlyDictionary ReverseMapping = + new Dictionary + { + { typeof(string), "String" }, + { typeof(Guid), "UUID" }, + { typeof(DateTimeOffset), "DateTime" }, + { typeof(bool), "Boolean" }, + { typeof(BooleanOperationFilterInputGql), "BooleanOperationFilterInput" }, + { typeof(DateTimeOperationFilterInputGql), "DateTimeOperationFilterInput" }, + { typeof(ListStringOperationFilterInputGql), "ListStringOperationFilterInput" }, + { typeof(LiveDocFilterInputGql), "LiveDocFilterInput" }, + { typeof(LiveDocInputGql), "LiveDocInput" }, + { typeof(LiveDocInputCheckpointGql), "LiveDocInputCheckpoint" }, + { typeof(LiveDocInputHeadersGql), "LiveDocInputHeaders" }, + { typeof(LiveDocInputPushRowGql), "LiveDocInputPushRow" }, + { typeof(PushLiveDocInputGql), "PushLiveDocInput" }, + { typeof(PushUserInputGql), "PushUserInput" }, + { typeof(PushWorkspaceInputGql), "PushWorkspaceInput" }, + { typeof(StringOperationFilterInputGql), "StringOperationFilterInput" }, + { typeof(UserFilterInputGql), "UserFilterInput" }, + { typeof(UserInputGql), "UserInput" }, + { typeof(UserInputCheckpointGql), "UserInputCheckpoint" }, + { typeof(UserInputHeadersGql), "UserInputHeaders" }, + { typeof(UserInputPushRowGql), "UserInputPushRow" }, + { typeof(UserRoleOperationFilterInputGql), "UserRoleOperationFilterInput" }, + { typeof(UuidOperationFilterInputGql), "UuidOperationFilterInput" }, + { typeof(WorkspaceFilterInputGql), "WorkspaceFilterInput" }, + { typeof(WorkspaceInputGql), "WorkspaceInput" }, + { typeof(WorkspaceInputCheckpointGql), "WorkspaceInputCheckpoint" }, + { typeof(WorkspaceInputHeadersGql), "WorkspaceInputHeaders" }, + { typeof(WorkspaceInputPushRowGql), "WorkspaceInputPushRow" } + }; +} + #endregion + + #region enums + public enum UserRoleGql + { + StandardUser, + WorkspaceAdmin, + SystemAdmin + } + #endregion + + #nullable enable + #region directives + public class SkipDirective : GraphQlDirective + { + public SkipDirective(QueryBuilderParameter @if) : base("skip") + { + AddArgument("if", @if); + } + } + + public class IncludeDirective : GraphQlDirective + { + public IncludeDirective(QueryBuilderParameter @if) : base("include") + { + AddArgument("if", @if); + } + } + #endregion + + #region builder classes + public partial class UserPullBulkQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(UserQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "UserPullBulk"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public UserPullBulkQueryBuilderGql WithDocuments(UserQueryBuilderGql userQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, userQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public UserPullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); + + public UserPullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public UserPullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); + } + + public partial class WorkspacePullBulkQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(WorkspaceQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "WorkspacePullBulk"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public WorkspacePullBulkQueryBuilderGql WithDocuments(WorkspaceQueryBuilderGql workspaceQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, workspaceQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public WorkspacePullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); + + public WorkspacePullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public WorkspacePullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); + } + + public partial class LiveDocPullBulkQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(LiveDocQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "LiveDocPullBulk"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public LiveDocPullBulkQueryBuilderGql WithDocuments(LiveDocQueryBuilderGql liveDocQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, liveDocQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public LiveDocPullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); + + public LiveDocPullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public LiveDocPullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); + } + + public partial class QueryQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "pullUser", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(UserPullBulkQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "pullWorkspace", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(WorkspacePullBulkQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "pullLiveDoc", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(LiveDocPullBulkQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "Query"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public QueryQueryBuilderGql(string? operationName = null) : base("query", operationName) + { + } + + public QueryQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); + + public QueryQueryBuilderGql WithPullUser(UserPullBulkQueryBuilderGql userPullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (checkpoint != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); + + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); + if (where != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); + + return WithObjectField("pullUser", alias, userPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public QueryQueryBuilderGql ExceptPullUser() => ExceptField("pullUser"); + + public QueryQueryBuilderGql WithPullWorkspace(WorkspacePullBulkQueryBuilderGql workspacePullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (checkpoint != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); + + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); + if (where != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); + + return WithObjectField("pullWorkspace", alias, workspacePullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public QueryQueryBuilderGql ExceptPullWorkspace() => ExceptField("pullWorkspace"); + + public QueryQueryBuilderGql WithPullLiveDoc(LiveDocPullBulkQueryBuilderGql liveDocPullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (checkpoint != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); + + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); + if (where != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); + + return WithObjectField("pullLiveDoc", alias, liveDocPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public QueryQueryBuilderGql ExceptPullLiveDoc() => ExceptField("pullLiveDoc"); + } + + public partial class MutationQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "pushUser", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushUserPayloadQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "pushWorkspace", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushWorkspacePayloadQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "pushLiveDoc", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushLiveDocPayloadQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "Mutation"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public MutationQueryBuilderGql(string? operationName = null) : base("mutation", operationName) + { + } + + public MutationQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); + + public MutationQueryBuilderGql WithPushUser(PushUserPayloadQueryBuilderGql pushUserPayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); + return WithObjectField("pushUser", alias, pushUserPayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public MutationQueryBuilderGql ExceptPushUser() => ExceptField("pushUser"); + + public MutationQueryBuilderGql WithPushWorkspace(PushWorkspacePayloadQueryBuilderGql pushWorkspacePayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); + return WithObjectField("pushWorkspace", alias, pushWorkspacePayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public MutationQueryBuilderGql ExceptPushWorkspace() => ExceptField("pushWorkspace"); + + public MutationQueryBuilderGql WithPushLiveDoc(PushLiveDocPayloadQueryBuilderGql pushLiveDocPayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); + return WithObjectField("pushLiveDoc", alias, pushLiveDocPayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public MutationQueryBuilderGql ExceptPushLiveDoc() => ExceptField("pushLiveDoc"); + } + + public partial class SubscriptionQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "streamUser", IsComplex = true, QueryBuilderType = typeof(UserPullBulkQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "streamWorkspace", IsComplex = true, QueryBuilderType = typeof(WorkspacePullBulkQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "streamLiveDoc", IsComplex = true, QueryBuilderType = typeof(LiveDocPullBulkQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "Subscription"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public SubscriptionQueryBuilderGql(string? operationName = null) : base("subscription", operationName) + { + } + + public SubscriptionQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); + + public SubscriptionQueryBuilderGql WithStreamUser(UserPullBulkQueryBuilderGql userPullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (headers != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); + + if (topics != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); + + return WithObjectField("streamUser", alias, userPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public SubscriptionQueryBuilderGql ExceptStreamUser() => ExceptField("streamUser"); + + public SubscriptionQueryBuilderGql WithStreamWorkspace(WorkspacePullBulkQueryBuilderGql workspacePullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (headers != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); + + if (topics != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); + + return WithObjectField("streamWorkspace", alias, workspacePullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public SubscriptionQueryBuilderGql ExceptStreamWorkspace() => ExceptField("streamWorkspace"); + + public SubscriptionQueryBuilderGql WithStreamLiveDoc(LiveDocPullBulkQueryBuilderGql liveDocPullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (headers != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); + + if (topics != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); + + return WithObjectField("streamLiveDoc", alias, liveDocPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public SubscriptionQueryBuilderGql ExceptStreamLiveDoc() => ExceptField("streamLiveDoc"); + } + + public partial class UserQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "firstName" }, + new GraphQlFieldMetadata { Name = "lastName" }, + new GraphQlFieldMetadata { Name = "fullName" }, + new GraphQlFieldMetadata { Name = "email" }, + new GraphQlFieldMetadata { Name = "role" }, + new GraphQlFieldMetadata { Name = "jwtAccessToken" }, + new GraphQlFieldMetadata { Name = "workspaceId" }, + new GraphQlFieldMetadata { Name = "id" }, + new GraphQlFieldMetadata { Name = "isDeleted" }, + new GraphQlFieldMetadata { Name = "updatedAt" }, + new GraphQlFieldMetadata { Name = "topics", IsComplex = true } + }; + + protected override string TypeName { get; } = "User"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public UserQueryBuilderGql WithFirstName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("firstName", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptFirstName() => ExceptField("firstName"); + + public UserQueryBuilderGql WithLastName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("lastName", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptLastName() => ExceptField("lastName"); + + public UserQueryBuilderGql WithFullName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("fullName", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptFullName() => ExceptField("fullName"); + + public UserQueryBuilderGql WithEmail(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("email", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptEmail() => ExceptField("email"); + + public UserQueryBuilderGql WithRole(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("role", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptRole() => ExceptField("role"); + + public UserQueryBuilderGql WithJwtAccessToken(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("jwtAccessToken", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptJwtAccessToken() => ExceptField("jwtAccessToken"); + + public UserQueryBuilderGql WithWorkspaceId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("workspaceId", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptWorkspaceId() => ExceptField("workspaceId"); + + public UserQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptId() => ExceptField("id"); + + public UserQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); + + public UserQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); + + public UserQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptTopics() => ExceptField("topics"); + } + + public partial class CheckpointQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "lastDocumentId" }, + new GraphQlFieldMetadata { Name = "updatedAt" } + }; + + protected override string TypeName { get; } = "Checkpoint"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public CheckpointQueryBuilderGql WithLastDocumentId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("lastDocumentId", alias, new GraphQlDirective?[] { skip, include }); + + public CheckpointQueryBuilderGql ExceptLastDocumentId() => ExceptField("lastDocumentId"); + + public CheckpointQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); + + public CheckpointQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); + } + + public partial class AuthenticationErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "message" } + }; + + protected override string TypeName { get; } = "AuthenticationError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public AuthenticationErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); + + public AuthenticationErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); + } + + public partial class UnauthorizedAccessErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "message" } + }; + + protected override string TypeName { get; } = "UnauthorizedAccessError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public UnauthorizedAccessErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); + + public UnauthorizedAccessErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); + } + + public partial class WorkspaceQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "name" }, + new GraphQlFieldMetadata { Name = "id" }, + new GraphQlFieldMetadata { Name = "isDeleted" }, + new GraphQlFieldMetadata { Name = "updatedAt" }, + new GraphQlFieldMetadata { Name = "topics", IsComplex = true } + }; + + protected override string TypeName { get; } = "Workspace"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public WorkspaceQueryBuilderGql WithName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("name", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptName() => ExceptField("name"); + + public WorkspaceQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptId() => ExceptField("id"); + + public WorkspaceQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); + + public WorkspaceQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); + + public WorkspaceQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptTopics() => ExceptField("topics"); + } + + public partial class LiveDocQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "content" }, + new GraphQlFieldMetadata { Name = "ownerId" }, + new GraphQlFieldMetadata { Name = "workspaceId" }, + new GraphQlFieldMetadata { Name = "id" }, + new GraphQlFieldMetadata { Name = "isDeleted" }, + new GraphQlFieldMetadata { Name = "updatedAt" }, + new GraphQlFieldMetadata { Name = "topics", IsComplex = true } + }; + + protected override string TypeName { get; } = "LiveDoc"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public LiveDocQueryBuilderGql WithContent(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("content", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptContent() => ExceptField("content"); + + public LiveDocQueryBuilderGql WithOwnerId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("ownerId", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptOwnerId() => ExceptField("ownerId"); + + public LiveDocQueryBuilderGql WithWorkspaceId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("workspaceId", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptWorkspaceId() => ExceptField("workspaceId"); + + public LiveDocQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptId() => ExceptField("id"); + + public LiveDocQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); + + public LiveDocQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); + + public LiveDocQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptTopics() => ExceptField("topics"); + } + + public partial class ErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "message" } + }; + + public ErrorQueryBuilderGql() => WithTypeName(); + + protected override string TypeName { get; } = "Error"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public ErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); + + public ErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); + + public ErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public ErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + } + + public partial class PushUserErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); + + public PushUserErrorQueryBuilderGql() => WithTypeName(); + + protected override string TypeName { get; } = "PushUserError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushUserErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushUserErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + } + + public partial class PushUserPayloadQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "user", IsComplex = true, QueryBuilderType = typeof(UserQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushUserErrorQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "PushUserPayload"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushUserPayloadQueryBuilderGql WithUser(UserQueryBuilderGql userQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("user", alias, userQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushUserPayloadQueryBuilderGql ExceptUser() => ExceptField("user"); + + public PushUserPayloadQueryBuilderGql WithErrors(PushUserErrorQueryBuilderGql pushUserErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushUserErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushUserPayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); + } + + public partial class PushWorkspaceErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); + + public PushWorkspaceErrorQueryBuilderGql() => WithTypeName(); + + protected override string TypeName { get; } = "PushWorkspaceError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushWorkspaceErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushWorkspaceErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + } + + public partial class PushWorkspacePayloadQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "workspace", IsComplex = true, QueryBuilderType = typeof(WorkspaceQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushWorkspaceErrorQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "PushWorkspacePayload"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushWorkspacePayloadQueryBuilderGql WithWorkspace(WorkspaceQueryBuilderGql workspaceQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("workspace", alias, workspaceQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushWorkspacePayloadQueryBuilderGql ExceptWorkspace() => ExceptField("workspace"); + + public PushWorkspacePayloadQueryBuilderGql WithErrors(PushWorkspaceErrorQueryBuilderGql pushWorkspaceErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushWorkspaceErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushWorkspacePayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); + } + + public partial class PushLiveDocErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); + + public PushLiveDocErrorQueryBuilderGql() => WithTypeName(); + + protected override string TypeName { get; } = "PushLiveDocError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushLiveDocErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushLiveDocErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + } + + public partial class PushLiveDocPayloadQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "liveDoc", IsComplex = true, QueryBuilderType = typeof(LiveDocQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushLiveDocErrorQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "PushLiveDocPayload"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushLiveDocPayloadQueryBuilderGql WithLiveDoc(LiveDocQueryBuilderGql liveDocQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("liveDoc", alias, liveDocQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushLiveDocPayloadQueryBuilderGql ExceptLiveDoc() => ExceptField("liveDoc"); + + public PushLiveDocPayloadQueryBuilderGql WithErrors(PushLiveDocErrorQueryBuilderGql pushLiveDocErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushLiveDocErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushLiveDocPayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); + } + #endregion + + #region input classes + public partial class UserInputCheckpointGql : IGraphQlInputObject + { + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _lastDocumentId; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastDocumentId + { + get => (QueryBuilderParameter?)_lastDocumentId.Value; + set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_updatedAt.Name != null) yield return _updatedAt; + if (_lastDocumentId.Name != null) yield return _lastDocumentId; + } + } + + public partial class UserInputPushRowGql : IGraphQlInputObject + { + private InputPropertyInfo _assumedMasterState; + private InputPropertyInfo _newDocumentState; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? AssumedMasterState + { + get => (QueryBuilderParameter?)_assumedMasterState.Value; + set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NewDocumentState + { + get => (QueryBuilderParameter?)_newDocumentState.Value; + set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_assumedMasterState.Name != null) yield return _assumedMasterState; + if (_newDocumentState.Name != null) yield return _newDocumentState; + } + } + + public partial class WorkspaceInputCheckpointGql : IGraphQlInputObject + { + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _lastDocumentId; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastDocumentId + { + get => (QueryBuilderParameter?)_lastDocumentId.Value; + set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_updatedAt.Name != null) yield return _updatedAt; + if (_lastDocumentId.Name != null) yield return _lastDocumentId; + } + } + + public partial class WorkspaceInputPushRowGql : IGraphQlInputObject + { + private InputPropertyInfo _assumedMasterState; + private InputPropertyInfo _newDocumentState; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? AssumedMasterState + { + get => (QueryBuilderParameter?)_assumedMasterState.Value; + set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NewDocumentState + { + get => (QueryBuilderParameter?)_newDocumentState.Value; + set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_assumedMasterState.Name != null) yield return _assumedMasterState; + if (_newDocumentState.Name != null) yield return _newDocumentState; + } + } + + public partial class LiveDocInputCheckpointGql : IGraphQlInputObject + { + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _lastDocumentId; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastDocumentId + { + get => (QueryBuilderParameter?)_lastDocumentId.Value; + set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_updatedAt.Name != null) yield return _updatedAt; + if (_lastDocumentId.Name != null) yield return _lastDocumentId; + } + } + + public partial class LiveDocInputPushRowGql : IGraphQlInputObject + { + private InputPropertyInfo _assumedMasterState; + private InputPropertyInfo _newDocumentState; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? AssumedMasterState + { + get => (QueryBuilderParameter?)_assumedMasterState.Value; + set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NewDocumentState + { + get => (QueryBuilderParameter?)_newDocumentState.Value; + set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_assumedMasterState.Name != null) yield return _assumedMasterState; + if (_newDocumentState.Name != null) yield return _newDocumentState; + } + } + + public partial class UserFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _and; + private InputPropertyInfo _or; + private InputPropertyInfo _firstName; + private InputPropertyInfo _lastName; + private InputPropertyInfo _fullName; + private InputPropertyInfo _email; + private InputPropertyInfo _role; + private InputPropertyInfo _jwtAccessToken; + private InputPropertyInfo _workspaceId; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? And + { + get => (QueryBuilderParameter?>?)_and.Value; + set => _and = new InputPropertyInfo { Name = "and", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Or + { + get => (QueryBuilderParameter?>?)_or.Value; + set => _or = new InputPropertyInfo { Name = "or", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FirstName + { + get => (QueryBuilderParameter?)_firstName.Value; + set => _firstName = new InputPropertyInfo { Name = "firstName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastName + { + get => (QueryBuilderParameter?)_lastName.Value; + set => _lastName = new InputPropertyInfo { Name = "lastName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FullName + { + get => (QueryBuilderParameter?)_fullName.Value; + set => _fullName = new InputPropertyInfo { Name = "fullName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Email + { + get => (QueryBuilderParameter?)_email.Value; + set => _email = new InputPropertyInfo { Name = "email", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Role + { + get => (QueryBuilderParameter?)_role.Value; + set => _role = new InputPropertyInfo { Name = "role", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? JwtAccessToken + { + get => (QueryBuilderParameter?)_jwtAccessToken.Value; + set => _jwtAccessToken = new InputPropertyInfo { Name = "jwtAccessToken", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? WorkspaceId + { + get => (QueryBuilderParameter?)_workspaceId.Value; + set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Topics + { + get => (QueryBuilderParameter?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_and.Name != null) yield return _and; + if (_or.Name != null) yield return _or; + if (_firstName.Name != null) yield return _firstName; + if (_lastName.Name != null) yield return _lastName; + if (_fullName.Name != null) yield return _fullName; + if (_email.Name != null) yield return _email; + if (_role.Name != null) yield return _role; + if (_jwtAccessToken.Name != null) yield return _jwtAccessToken; + if (_workspaceId.Name != null) yield return _workspaceId; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class UserInputGql : IGraphQlInputObject + { + private InputPropertyInfo _firstName; + private InputPropertyInfo _lastName; + private InputPropertyInfo _fullName; + private InputPropertyInfo _email; + private InputPropertyInfo _role; + private InputPropertyInfo _jwtAccessToken; + private InputPropertyInfo _workspaceId; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FirstName + { + get => (QueryBuilderParameter?)_firstName.Value; + set => _firstName = new InputPropertyInfo { Name = "firstName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastName + { + get => (QueryBuilderParameter?)_lastName.Value; + set => _lastName = new InputPropertyInfo { Name = "lastName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FullName + { + get => (QueryBuilderParameter?)_fullName.Value; + set => _fullName = new InputPropertyInfo { Name = "fullName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Email + { + get => (QueryBuilderParameter?)_email.Value; + set => _email = new InputPropertyInfo { Name = "email", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Role + { + get => (QueryBuilderParameter?)_role.Value; + set => _role = new InputPropertyInfo { Name = "role", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? JwtAccessToken + { + get => (QueryBuilderParameter?)_jwtAccessToken.Value; + set => _jwtAccessToken = new InputPropertyInfo { Name = "jwtAccessToken", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? WorkspaceId + { + get => (QueryBuilderParameter?)_workspaceId.Value; + set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Topics + { + get => (QueryBuilderParameter?>?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_firstName.Name != null) yield return _firstName; + if (_lastName.Name != null) yield return _lastName; + if (_fullName.Name != null) yield return _fullName; + if (_email.Name != null) yield return _email; + if (_role.Name != null) yield return _role; + if (_jwtAccessToken.Name != null) yield return _jwtAccessToken; + if (_workspaceId.Name != null) yield return _workspaceId; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class UserInputHeadersGql : IGraphQlInputObject + { + private InputPropertyInfo _authorization; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Authorization + { + get => (QueryBuilderParameter?)_authorization.Value; + set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_authorization.Name != null) yield return _authorization; + } + } + + public partial class WorkspaceFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _and; + private InputPropertyInfo _or; + private InputPropertyInfo _name; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? And + { + get => (QueryBuilderParameter?>?)_and.Value; + set => _and = new InputPropertyInfo { Name = "and", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Or + { + get => (QueryBuilderParameter?>?)_or.Value; + set => _or = new InputPropertyInfo { Name = "or", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Name + { + get => (QueryBuilderParameter?)_name.Value; + set => _name = new InputPropertyInfo { Name = "name", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Topics + { + get => (QueryBuilderParameter?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_and.Name != null) yield return _and; + if (_or.Name != null) yield return _or; + if (_name.Name != null) yield return _name; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class WorkspaceInputGql : IGraphQlInputObject + { + private InputPropertyInfo _name; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Name + { + get => (QueryBuilderParameter?)_name.Value; + set => _name = new InputPropertyInfo { Name = "name", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Topics + { + get => (QueryBuilderParameter?>?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_name.Name != null) yield return _name; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class WorkspaceInputHeadersGql : IGraphQlInputObject + { + private InputPropertyInfo _authorization; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Authorization + { + get => (QueryBuilderParameter?)_authorization.Value; + set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_authorization.Name != null) yield return _authorization; + } + } + + public partial class LiveDocFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _and; + private InputPropertyInfo _or; + private InputPropertyInfo _content; + private InputPropertyInfo _ownerId; + private InputPropertyInfo _workspaceId; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? And + { + get => (QueryBuilderParameter?>?)_and.Value; + set => _and = new InputPropertyInfo { Name = "and", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Or + { + get => (QueryBuilderParameter?>?)_or.Value; + set => _or = new InputPropertyInfo { Name = "or", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Content + { + get => (QueryBuilderParameter?)_content.Value; + set => _content = new InputPropertyInfo { Name = "content", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? OwnerId + { + get => (QueryBuilderParameter?)_ownerId.Value; + set => _ownerId = new InputPropertyInfo { Name = "ownerId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? WorkspaceId + { + get => (QueryBuilderParameter?)_workspaceId.Value; + set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Topics + { + get => (QueryBuilderParameter?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_and.Name != null) yield return _and; + if (_or.Name != null) yield return _or; + if (_content.Name != null) yield return _content; + if (_ownerId.Name != null) yield return _ownerId; + if (_workspaceId.Name != null) yield return _workspaceId; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class LiveDocInputGql : IGraphQlInputObject + { + private InputPropertyInfo _content; + private InputPropertyInfo _ownerId; + private InputPropertyInfo _workspaceId; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Content + { + get => (QueryBuilderParameter?)_content.Value; + set => _content = new InputPropertyInfo { Name = "content", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? OwnerId + { + get => (QueryBuilderParameter?)_ownerId.Value; + set => _ownerId = new InputPropertyInfo { Name = "ownerId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? WorkspaceId + { + get => (QueryBuilderParameter?)_workspaceId.Value; + set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Topics + { + get => (QueryBuilderParameter?>?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_content.Name != null) yield return _content; + if (_ownerId.Name != null) yield return _ownerId; + if (_workspaceId.Name != null) yield return _workspaceId; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class LiveDocInputHeadersGql : IGraphQlInputObject + { + private InputPropertyInfo _authorization; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Authorization + { + get => (QueryBuilderParameter?)_authorization.Value; + set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_authorization.Name != null) yield return _authorization; + } + } + + public partial class StringOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _and; + private InputPropertyInfo _or; + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + private InputPropertyInfo _contains; + private InputPropertyInfo _ncontains; + private InputPropertyInfo _in; + private InputPropertyInfo _nin; + private InputPropertyInfo _startsWith; + private InputPropertyInfo _nstartsWith; + private InputPropertyInfo _endsWith; + private InputPropertyInfo _nendsWith; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? And + { + get => (QueryBuilderParameter?>?)_and.Value; + set => _and = new InputPropertyInfo { Name = "and", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Or + { + get => (QueryBuilderParameter?>?)_or.Value; + set => _or = new InputPropertyInfo { Name = "or", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Contains + { + get => (QueryBuilderParameter?)_contains.Value; + set => _contains = new InputPropertyInfo { Name = "contains", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ncontains + { + get => (QueryBuilderParameter?)_ncontains.Value; + set => _ncontains = new InputPropertyInfo { Name = "ncontains", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? In + { + get => (QueryBuilderParameter?>?)_in.Value; + set => _in = new InputPropertyInfo { Name = "in", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Nin + { + get => (QueryBuilderParameter?>?)_nin.Value; + set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? StartsWith + { + get => (QueryBuilderParameter?)_startsWith.Value; + set => _startsWith = new InputPropertyInfo { Name = "startsWith", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NstartsWith + { + get => (QueryBuilderParameter?)_nstartsWith.Value; + set => _nstartsWith = new InputPropertyInfo { Name = "nstartsWith", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? EndsWith + { + get => (QueryBuilderParameter?)_endsWith.Value; + set => _endsWith = new InputPropertyInfo { Name = "endsWith", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NendsWith + { + get => (QueryBuilderParameter?)_nendsWith.Value; + set => _nendsWith = new InputPropertyInfo { Name = "nendsWith", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_and.Name != null) yield return _and; + if (_or.Name != null) yield return _or; + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + if (_contains.Name != null) yield return _contains; + if (_ncontains.Name != null) yield return _ncontains; + if (_in.Name != null) yield return _in; + if (_nin.Name != null) yield return _nin; + if (_startsWith.Name != null) yield return _startsWith; + if (_nstartsWith.Name != null) yield return _nstartsWith; + if (_endsWith.Name != null) yield return _endsWith; + if (_nendsWith.Name != null) yield return _nendsWith; + } + } + + public partial class UserRoleOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + private InputPropertyInfo _in; + private InputPropertyInfo _nin; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? In + { + get => (QueryBuilderParameter?>?)_in.Value; + set => _in = new InputPropertyInfo { Name = "in", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Nin + { + get => (QueryBuilderParameter?>?)_nin.Value; + set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + if (_in.Name != null) yield return _in; + if (_nin.Name != null) yield return _nin; + } + } + + public partial class UuidOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + private InputPropertyInfo _in; + private InputPropertyInfo _nin; + private InputPropertyInfo _gt; + private InputPropertyInfo _ngt; + private InputPropertyInfo _gte; + private InputPropertyInfo _ngte; + private InputPropertyInfo _lt; + private InputPropertyInfo _nlt; + private InputPropertyInfo _lte; + private InputPropertyInfo _nlte; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? In + { + get => (QueryBuilderParameter?>?)_in.Value; + set => _in = new InputPropertyInfo { Name = "in", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Nin + { + get => (QueryBuilderParameter?>?)_nin.Value; + set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Gt + { + get => (QueryBuilderParameter?)_gt.Value; + set => _gt = new InputPropertyInfo { Name = "gt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ngt + { + get => (QueryBuilderParameter?)_ngt.Value; + set => _ngt = new InputPropertyInfo { Name = "ngt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Gte + { + get => (QueryBuilderParameter?)_gte.Value; + set => _gte = new InputPropertyInfo { Name = "gte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ngte + { + get => (QueryBuilderParameter?)_ngte.Value; + set => _ngte = new InputPropertyInfo { Name = "ngte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Lt + { + get => (QueryBuilderParameter?)_lt.Value; + set => _lt = new InputPropertyInfo { Name = "lt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Nlt + { + get => (QueryBuilderParameter?)_nlt.Value; + set => _nlt = new InputPropertyInfo { Name = "nlt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Lte + { + get => (QueryBuilderParameter?)_lte.Value; + set => _lte = new InputPropertyInfo { Name = "lte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Nlte + { + get => (QueryBuilderParameter?)_nlte.Value; + set => _nlte = new InputPropertyInfo { Name = "nlte", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + if (_in.Name != null) yield return _in; + if (_nin.Name != null) yield return _nin; + if (_gt.Name != null) yield return _gt; + if (_ngt.Name != null) yield return _ngt; + if (_gte.Name != null) yield return _gte; + if (_ngte.Name != null) yield return _ngte; + if (_lt.Name != null) yield return _lt; + if (_nlt.Name != null) yield return _nlt; + if (_lte.Name != null) yield return _lte; + if (_nlte.Name != null) yield return _nlte; + } + } + + public partial class BooleanOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + } + } + + public partial class DateTimeOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + private InputPropertyInfo _in; + private InputPropertyInfo _nin; + private InputPropertyInfo _gt; + private InputPropertyInfo _ngt; + private InputPropertyInfo _gte; + private InputPropertyInfo _ngte; + private InputPropertyInfo _lt; + private InputPropertyInfo _nlt; + private InputPropertyInfo _lte; + private InputPropertyInfo _nlte; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? In + { + get => (QueryBuilderParameter?>?)_in.Value; + set => _in = new InputPropertyInfo { Name = "in", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Nin + { + get => (QueryBuilderParameter?>?)_nin.Value; + set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Gt + { + get => (QueryBuilderParameter?)_gt.Value; + set => _gt = new InputPropertyInfo { Name = "gt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ngt + { + get => (QueryBuilderParameter?)_ngt.Value; + set => _ngt = new InputPropertyInfo { Name = "ngt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Gte + { + get => (QueryBuilderParameter?)_gte.Value; + set => _gte = new InputPropertyInfo { Name = "gte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ngte + { + get => (QueryBuilderParameter?)_ngte.Value; + set => _ngte = new InputPropertyInfo { Name = "ngte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Lt + { + get => (QueryBuilderParameter?)_lt.Value; + set => _lt = new InputPropertyInfo { Name = "lt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Nlt + { + get => (QueryBuilderParameter?)_nlt.Value; + set => _nlt = new InputPropertyInfo { Name = "nlt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Lte + { + get => (QueryBuilderParameter?)_lte.Value; + set => _lte = new InputPropertyInfo { Name = "lte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Nlte + { + get => (QueryBuilderParameter?)_nlte.Value; + set => _nlte = new InputPropertyInfo { Name = "nlte", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + if (_in.Name != null) yield return _in; + if (_nin.Name != null) yield return _nin; + if (_gt.Name != null) yield return _gt; + if (_ngt.Name != null) yield return _ngt; + if (_gte.Name != null) yield return _gte; + if (_ngte.Name != null) yield return _ngte; + if (_lt.Name != null) yield return _lt; + if (_nlt.Name != null) yield return _nlt; + if (_lte.Name != null) yield return _lte; + if (_nlte.Name != null) yield return _nlte; + } + } + + public partial class ListStringOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _all; + private InputPropertyInfo _none; + private InputPropertyInfo _some; + private InputPropertyInfo _any; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? All + { + get => (QueryBuilderParameter?)_all.Value; + set => _all = new InputPropertyInfo { Name = "all", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? None + { + get => (QueryBuilderParameter?)_none.Value; + set => _none = new InputPropertyInfo { Name = "none", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Some + { + get => (QueryBuilderParameter?)_some.Value; + set => _some = new InputPropertyInfo { Name = "some", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Any + { + get => (QueryBuilderParameter?)_any.Value; + set => _any = new InputPropertyInfo { Name = "any", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_all.Name != null) yield return _all; + if (_none.Name != null) yield return _none; + if (_some.Name != null) yield return _some; + if (_any.Name != null) yield return _any; + } + } + + public partial class PushUserInputGql : IGraphQlInputObject + { + private InputPropertyInfo _userPushRow; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? UserPushRow + { + get => (QueryBuilderParameter?>?)_userPushRow.Value; + set => _userPushRow = new InputPropertyInfo { Name = "userPushRow", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_userPushRow.Name != null) yield return _userPushRow; + } + } + + public partial class PushWorkspaceInputGql : IGraphQlInputObject + { + private InputPropertyInfo _workspacePushRow; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? WorkspacePushRow + { + get => (QueryBuilderParameter?>?)_workspacePushRow.Value; + set => _workspacePushRow = new InputPropertyInfo { Name = "workspacePushRow", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_workspacePushRow.Name != null) yield return _workspacePushRow; + } + } + + public partial class PushLiveDocInputGql : IGraphQlInputObject + { + private InputPropertyInfo _liveDocPushRow; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? LiveDocPushRow + { + get => (QueryBuilderParameter?>?)_liveDocPushRow.Value; + set => _liveDocPushRow = new InputPropertyInfo { Name = "liveDocPushRow", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_liveDocPushRow.Name != null) yield return _liveDocPushRow; + } + } + #endregion + + #region data classes + public partial class UserPullBulkGql + { + public ICollection? Documents { get; set; } + public CheckpointGql? Checkpoint { get; set; } + } + + public partial class WorkspacePullBulkGql + { + public ICollection? Documents { get; set; } + public CheckpointGql? Checkpoint { get; set; } + } + + public partial class LiveDocPullBulkGql + { + public ICollection? Documents { get; set; } + public CheckpointGql? Checkpoint { get; set; } + } + + public partial class QueryGql + { + public UserPullBulkGql? PullUser { get; set; } + public WorkspacePullBulkGql? PullWorkspace { get; set; } + public LiveDocPullBulkGql? PullLiveDoc { get; set; } + } + + public partial class MutationGql + { + public PushUserPayloadGql? PushUser { get; set; } + public PushWorkspacePayloadGql? PushWorkspace { get; set; } + public PushLiveDocPayloadGql? PushLiveDoc { get; set; } + } + + public partial class SubscriptionGql + { + public UserPullBulkGql? StreamUser { get; set; } + public WorkspacePullBulkGql? StreamWorkspace { get; set; } + public LiveDocPullBulkGql? StreamLiveDoc { get; set; } + } + + public partial class UserGql + { + public string FirstName { get; set; } + public string LastName { get; set; } + public string? FullName { get; set; } + public string? Email { get; set; } + public LiveDocs.GraphQLApi.Security.UserRole Role { get; set; } + public string? JwtAccessToken { get; set; } + public Guid WorkspaceId { get; set; } + public Guid Id { get; set; } + public bool IsDeleted { get; set; } + public DateTimeOffset UpdatedAt { get; set; } + public ICollection? Topics { get; set; } + } + + public partial class CheckpointGql + { + public Guid? LastDocumentId { get; set; } + public DateTimeOffset? UpdatedAt { get; set; } + } + + [GraphQlObjectType("AuthenticationError")] + public partial class AuthenticationErrorGql : IPushUserErrorGql, IPushWorkspaceErrorGql, IPushLiveDocErrorGql, IErrorGql + { + public string Message { get; set; } + } + + [GraphQlObjectType("UnauthorizedAccessError")] + public partial class UnauthorizedAccessErrorGql : IPushUserErrorGql, IPushWorkspaceErrorGql, IPushLiveDocErrorGql, IErrorGql + { + public string Message { get; set; } + } + + public partial class WorkspaceGql + { + public string Name { get; set; } + public Guid Id { get; set; } + public bool IsDeleted { get; set; } + public DateTimeOffset UpdatedAt { get; set; } + public ICollection? Topics { get; set; } + } + + public partial class LiveDocGql + { + public string Content { get; set; } + public Guid OwnerId { get; set; } + public Guid WorkspaceId { get; set; } + public Guid Id { get; set; } + public bool IsDeleted { get; set; } + public DateTimeOffset UpdatedAt { get; set; } + public ICollection? Topics { get; set; } + } + + public partial interface IErrorGql + { + string Message { get; set; } + } + + public partial interface IPushUserErrorGql + { + } + + public partial class PushUserPayloadGql + { + public ICollection? User { get; set; } + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] + #endif + public ICollection? Errors { get; set; } + } + + public partial interface IPushWorkspaceErrorGql + { + } + + public partial class PushWorkspacePayloadGql + { + public ICollection? Workspace { get; set; } + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] + #endif + public ICollection? Errors { get; set; } + } + + public partial interface IPushLiveDocErrorGql + { + } + + public partial class PushLiveDocPayloadGql + { + public ICollection? LiveDoc { get; set; } + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] + #endif + public ICollection? Errors { get; set; } + } + #endregion + #nullable restore +} diff --git a/tests/RxDBDotNet.Tests/MutationConventions/BookMutations.cs b/tests/RxDBDotNet.Tests/MutationConventions/BookMutations.cs index 1e3752a..b144228 100644 --- a/tests/RxDBDotNet.Tests/MutationConventions/BookMutations.cs +++ b/tests/RxDBDotNet.Tests/MutationConventions/BookMutations.cs @@ -1,6 +1,9 @@ // tests\RxDBDotNet.Tests\MutationConventions\BookMutations.cs #pragma warning disable CA1822 +using System; +using System.Threading.Tasks; using HotChocolate.Types; +using RxDBDotNet.Extensions; namespace RxDBDotNet.Tests.MutationConventions; diff --git a/tests/RxDBDotNet.Tests/MutationConventions/MutationConventionTests.cs b/tests/RxDBDotNet.Tests/MutationConventions/MutationConventionTests.cs index 566e07a..62bebea 100644 --- a/tests/RxDBDotNet.Tests/MutationConventions/MutationConventionTests.cs +++ b/tests/RxDBDotNet.Tests/MutationConventions/MutationConventionTests.cs @@ -1,7 +1,16 @@ // tests\RxDBDotNet.Tests\MutationConventions\MutationConventionTests.cs + +using System; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using FluentAssertions; using GraphQlClientGenerator; using HotChocolate.Subscriptions; +using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; +using RxDBDotNet.Extensions; +using RxDBDotNet.Tests.Setup; using StackExchange.Redis; namespace RxDBDotNet.Tests.MutationConventions; diff --git a/tests/RxDBDotNet.Tests/PullDocumentsTests.cs b/tests/RxDBDotNet.Tests/PullDocumentsTests.cs index 5f3cdfb..4751807 100644 --- a/tests/RxDBDotNet.Tests/PullDocumentsTests.cs +++ b/tests/RxDBDotNet.Tests/PullDocumentsTests.cs @@ -1,5 +1,10 @@ // tests\RxDBDotNet.Tests\PullDocumentsTests.cs + +using System; +using System.Threading.Tasks; +using FluentAssertions; using RxDBDotNet.Tests.Model; +using RxDBDotNet.Tests.Setup; using RxDBDotNet.Tests.Utils; namespace RxDBDotNet.Tests; diff --git a/tests/RxDBDotNet.Tests/PushDocumentsTests.cs b/tests/RxDBDotNet.Tests/PushDocumentsTests.cs index 64a153b..a1a9d1d 100644 --- a/tests/RxDBDotNet.Tests/PushDocumentsTests.cs +++ b/tests/RxDBDotNet.Tests/PushDocumentsTests.cs @@ -1,5 +1,13 @@ // tests\RxDBDotNet.Tests\PushDocumentsTests.cs + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using RT.Comb; using RxDBDotNet.Tests.Model; +using RxDBDotNet.Tests.Setup; using RxDBDotNet.Tests.Utils; namespace RxDBDotNet.Tests; diff --git a/tests/RxDBDotNet.Tests/RxDBDotNet.Tests.csproj b/tests/RxDBDotNet.Tests/RxDBDotNet.Tests.csproj index 9407702..7b0bc4f 100644 --- a/tests/RxDBDotNet.Tests/RxDBDotNet.Tests.csproj +++ b/tests/RxDBDotNet.Tests/RxDBDotNet.Tests.csproj @@ -15,7 +15,7 @@ true true $(NoWarn);CA2007;CA1707;MA0051;MA0004;CA2234;MA0009;CA1054;CA1711;CA1062;MA0006;CA1812;CA1852 - enable + false true diff --git a/tests/RxDBDotNet.Tests/SchemaGenerationTests.cs b/tests/RxDBDotNet.Tests/SchemaGenerationTests.cs index a3be845..afcee72 100644 --- a/tests/RxDBDotNet.Tests/SchemaGenerationTests.cs +++ b/tests/RxDBDotNet.Tests/SchemaGenerationTests.cs @@ -1,6 +1,12 @@ // tests\RxDBDotNet.Tests\SchemaGenerationTests.cs + +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using FluentAssertions; using GraphQlClientGenerator; using Newtonsoft.Json; +using RxDBDotNet.Tests.Setup; namespace RxDBDotNet.Tests; diff --git a/tests/RxDBDotNet.Tests/SecurityTests.cs b/tests/RxDBDotNet.Tests/SecurityTests.cs index 856d708..f3d26f1 100644 --- a/tests/RxDBDotNet.Tests/SecurityTests.cs +++ b/tests/RxDBDotNet.Tests/SecurityTests.cs @@ -1,7 +1,16 @@ // tests\RxDBDotNet.Tests\SecurityTests.cs + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using LiveDocs.GraphQLApi.Models.Replication; using LiveDocs.GraphQLApi.Security; +using RT.Comb; using RxDBDotNet.Security; using RxDBDotNet.Tests.Model; +using RxDBDotNet.Tests.Setup; using RxDBDotNet.Tests.Utils; using static RxDBDotNet.Tests.Setup.Strings; diff --git a/tests/RxDBDotNet.Tests/SubscriptionTests.cs b/tests/RxDBDotNet.Tests/SubscriptionTests.cs index 3cc97d0..13c7eb3 100644 --- a/tests/RxDBDotNet.Tests/SubscriptionTests.cs +++ b/tests/RxDBDotNet.Tests/SubscriptionTests.cs @@ -1,19 +1,31 @@ // tests\RxDBDotNet.Tests\SubscriptionTests.cs + +using System; +using System.Collections.Generic; using System.Diagnostics; using System.IdentityModel.Tokens.Jwt; +using System.IO; +using System.Linq; using System.Security.Claims; using System.Security.Cryptography; +using System.Threading; +using System.Threading.Tasks; +using FluentAssertions; using HotChocolate.Execution; using HotChocolate.Subscriptions; +using LiveDocs.GraphQLApi.Models.Replication; using LiveDocs.GraphQLApi.Security; using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.IdentityModel.Protocols.OpenIdConnect; using Microsoft.IdentityModel.Protocols; using Microsoft.IdentityModel.Tokens; using Moq; +using RT.Comb; using RxDBDotNet.Models; using RxDBDotNet.Tests.Model; +using RxDBDotNet.Tests.Setup; using RxDBDotNet.Tests.Utils; using static RxDBDotNet.Tests.Setup.Strings; diff --git a/tests/RxDBDotNet.Tests/Utils/DateTimeOffsetExtensions.cs b/tests/RxDBDotNet.Tests/Utils/DateTimeOffsetExtensions.cs index b3c4520..652b478 100644 --- a/tests/RxDBDotNet.Tests/Utils/DateTimeOffsetExtensions.cs +++ b/tests/RxDBDotNet.Tests/Utils/DateTimeOffsetExtensions.cs @@ -1,4 +1,7 @@ // tests\RxDBDotNet.Tests\Utils\DateTimeOffsetExtensions.cs + +using System; + namespace RxDBDotNet.Tests.Utils; public static class DateTimeOffsetExtensions diff --git a/tests/RxDBDotNet.Tests/Utils/DockerSetupCollection.cs b/tests/RxDBDotNet.Tests/Utils/DockerSetupCollection.cs index ae79177..89d0c54 100644 --- a/tests/RxDBDotNet.Tests/Utils/DockerSetupCollection.cs +++ b/tests/RxDBDotNet.Tests/Utils/DockerSetupCollection.cs @@ -1,4 +1,7 @@ // tests\RxDBDotNet.Tests\Utils\DockerSetupCollection.cs + +using RxDBDotNet.Tests.Setup; + namespace RxDBDotNet.Tests.Utils; [CollectionDefinition("DockerSetup")] diff --git a/tests/RxDBDotNet.Tests/Utils/GraphQLSubscriptionClient.cs b/tests/RxDBDotNet.Tests/Utils/GraphQLSubscriptionClient.cs index 49fe627..15ecaaa 100644 --- a/tests/RxDBDotNet.Tests/Utils/GraphQLSubscriptionClient.cs +++ b/tests/RxDBDotNet.Tests/Utils/GraphQLSubscriptionClient.cs @@ -1,7 +1,15 @@ // tests\RxDBDotNet.Tests\Utils\GraphQLSubscriptionClient.cs + +using System; +using System.Collections.Generic; +using System.IO; using System.Net.WebSockets; +using System.Runtime.CompilerServices; +using System.Text; using System.Text.Json; using System.Text.Json.Nodes; +using System.Threading; +using System.Threading.Tasks; using RxDBDotNet.Security; namespace RxDBDotNet.Tests.Utils; diff --git a/tests/RxDBDotNet.Tests/Utils/HttpClientExtensions.cs b/tests/RxDBDotNet.Tests/Utils/HttpClientExtensions.cs index 017e7c2..ab18f3a 100644 --- a/tests/RxDBDotNet.Tests/Utils/HttpClientExtensions.cs +++ b/tests/RxDBDotNet.Tests/Utils/HttpClientExtensions.cs @@ -1,5 +1,11 @@ // tests\RxDBDotNet.Tests\Utils\HttpClientExtensions.cs + +using System; +using System.Net.Http; using System.Net.Http.Headers; +using System.Text; +using System.Threading; +using System.Threading.Tasks; using Newtonsoft.Json; using RxDBDotNet.Tests.Model; using static RxDBDotNet.Tests.Utils.SerializationUtils; diff --git a/tests/RxDBDotNet.Tests/Utils/TestUtils.cs b/tests/RxDBDotNet.Tests/Utils/TestUtils.cs index 743c449..530c31e 100644 --- a/tests/RxDBDotNet.Tests/Utils/TestUtils.cs +++ b/tests/RxDBDotNet.Tests/Utils/TestUtils.cs @@ -1,9 +1,21 @@ // tests\RxDBDotNet.Tests\Utils\TestUtils.cs + +using System; +using System.Collections.Generic; using System.Diagnostics; +using System.Linq; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using FluentAssertions; using LiveDocs.GraphQLApi.Data; using LiveDocs.GraphQLApi.Models.Entities; +using LiveDocs.GraphQLApi.Models.Replication; using LiveDocs.GraphQLApi.Security; +using Microsoft.Extensions.DependencyInjection; +using RT.Comb; using RxDBDotNet.Tests.Model; +using RxDBDotNet.Tests.Setup; using static RxDBDotNet.Tests.Setup.Strings; namespace RxDBDotNet.Tests.Utils; diff --git a/tests/RxDBDotNet.Tests/Utils/WebApplicationFactoryExtensions.cs b/tests/RxDBDotNet.Tests/Utils/WebApplicationFactoryExtensions.cs index f250cfe..1ccc7af 100644 --- a/tests/RxDBDotNet.Tests/Utils/WebApplicationFactoryExtensions.cs +++ b/tests/RxDBDotNet.Tests/Utils/WebApplicationFactoryExtensions.cs @@ -1,4 +1,8 @@ // tests\RxDBDotNet.Tests\Utils\WebApplicationFactoryExtensions.cs + +using System; +using System.Threading; +using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Testing; namespace RxDBDotNet.Tests.Utils; From f6ba1541be5c4745d127c5f19cece82a48328d05 Mon Sep 17 00:00:00 2001 From: Richard Beauchamp Date: Sun, 6 Oct 2024 16:12:20 -0700 Subject: [PATCH 3/5] sp --- example/LiveDocs.AppHost/Program.cs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/example/LiveDocs.AppHost/Program.cs b/example/LiveDocs.AppHost/Program.cs index 61471e8..9f56e45 100644 --- a/example/LiveDocs.AppHost/Program.cs +++ b/example/LiveDocs.AppHost/Program.cs @@ -1,6 +1,5 @@ // example/LiveDocs.AppHost/Program.cs using System; -using System.Runtime.InteropServices; using Aspire.Hosting; using Projects; @@ -11,21 +10,23 @@ .WithImageTag("latest") .WithEndpoint(port: 6380, targetPort: 6379, name: "redis-endpoint"); -// Detect OS and architecture -var isArm64 = RuntimeInformation.ProcessArchitecture == Architecture.Arm64; -var sqlServerImage = isArm64 - ? "azure-sql-edge" - : "mssql/server"; -var sqlServerTag = isArm64 - ? "latest" - : "2022-latest"; +// // See https://github.com/dotnet/aspire/issues/1023 for macOs related issues +// // Detect OS and architecture +// var isArm64 = RuntimeInformation.ProcessArchitecture != Architecture.Arm64; +// var sqlServerImage = isArm64 +// ? "azure-sql-edge" +// : "mssql/server"; +// var sqlServerTag = isArm64 +// ? "latest" +// : "2022-latest"; // Add SQL Server var password = builder.AddParameter("sqlpassword", secret: true); var sqlDb = builder.AddSqlServer("sql", password: password, port: 1433) - .WithImage(sqlServerImage) - .WithImageTag(sqlServerTag) + .WithImage("azure-sql-edge") + .WithImageTag("latest") .WithEnvironment("ACCEPT_EULA", "Y") + .WithEnvironment("MSSQL_SA_PASSWORD", "Admin123!") .WithVolume("livedocs-sql-data", "/var/opt/mssql") .WithEndpoint(port: 1146, targetPort: 1433, name: "sql-endpoint") .AddDatabase("sqldata", databaseName: "LiveDocsDb"); From b107e1e9d0deb254aaeba7dcffe0d3806af824e3 Mon Sep 17 00:00:00 2001 From: Richard Beauchamp Date: Mon, 7 Oct 2024 07:09:33 -0700 Subject: [PATCH 4/5] sp --- example/LiveDocs.AppHost/Program.cs | 15 +- .../Infrastructure/LiveDocsDbInitializer.cs | 33 +- .../Model/GraphQLTestModel.cs | 6688 ++++++++--------- 3 files changed, 3370 insertions(+), 3366 deletions(-) diff --git a/example/LiveDocs.AppHost/Program.cs b/example/LiveDocs.AppHost/Program.cs index 9f56e45..cc82c96 100644 --- a/example/LiveDocs.AppHost/Program.cs +++ b/example/LiveDocs.AppHost/Program.cs @@ -10,23 +10,14 @@ .WithImageTag("latest") .WithEndpoint(port: 6380, targetPort: 6379, name: "redis-endpoint"); -// // See https://github.com/dotnet/aspire/issues/1023 for macOs related issues -// // Detect OS and architecture -// var isArm64 = RuntimeInformation.ProcessArchitecture != Architecture.Arm64; -// var sqlServerImage = isArm64 -// ? "azure-sql-edge" -// : "mssql/server"; -// var sqlServerTag = isArm64 -// ? "latest" -// : "2022-latest"; - // Add SQL Server var password = builder.AddParameter("sqlpassword", secret: true); var sqlDb = builder.AddSqlServer("sql", password: password, port: 1433) - .WithImage("azure-sql-edge") - .WithImageTag("latest") + .WithImage("mssql/server") + .WithImageTag("2022-latest") .WithEnvironment("ACCEPT_EULA", "Y") .WithEnvironment("MSSQL_SA_PASSWORD", "Admin123!") + // this is here to preserve the data across restarts .WithVolume("livedocs-sql-data", "/var/opt/mssql") .WithEndpoint(port: 1146, targetPort: 1433, name: "sql-endpoint") .AddDatabase("sqldata", databaseName: "LiveDocsDb"); diff --git a/example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs b/example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs index 33d70e5..2531e1b 100644 --- a/example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs +++ b/example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs @@ -16,21 +16,34 @@ public static async Task InitializeAsync() { await using var dbContext = new LiveDocsDbContext(); - try - { - await dbContext.Database.EnsureCreatedAsync(); - } - catch - { - // ignore this error; the db exists - } + // See https://github.com/dotnet/aspire/issues/1023#issuecomment-2156120941 + // for macOS related issues + var strategy = new SqlServerRetryingExecutionStrategy( + dbContext, + maxRetryCount: 10, + TimeSpan.FromSeconds(5), + RetryIntervals); - if (!await dbContext.Workspaces.AnyAsync()) + await strategy.ExecuteAsync(async () => { - await SeedDataAsync(dbContext); + try + { + await dbContext.Database.EnsureCreatedAsync(); + } + catch + { + // ignore this error; the db exists + } + + if (!await dbContext.Workspaces.AnyAsync()) + { + await SeedDataAsync(dbContext); } + }); } + private static readonly int[] RetryIntervals = { 0 }; + private static async Task SeedDataAsync(LiveDocsDbContext dbContext) { var rootWorkspace = new Workspace diff --git a/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs b/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs index 08daaad..9cb1064 100644 --- a/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs +++ b/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs @@ -1,6 +1,6 @@ -// This file has been auto generated. -#pragma warning disable 8618 - +// This file has been auto generated. +#pragma warning disable 8618 + using System; using System.Collections; using System.Collections.Generic; @@ -15,3344 +15,3344 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; #endif - -namespace RxDBDotNet.Tests.Model -{ - #region base classes - public struct GraphQlFieldMetadata - { - public string Name { get; set; } - public string DefaultAlias { get; set; } - public bool IsComplex { get; set; } - public bool RequiresParameters { get; set; } - public global::System.Type QueryBuilderType { get; set; } - } - - public enum Formatting - { - None, - Indented - } - - public class GraphQlObjectTypeAttribute : global::System.Attribute - { - public string TypeName { get; } - - public GraphQlObjectTypeAttribute(string typeName) => TypeName = typeName; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - public class QueryBuilderParameterConverter : global::Newtonsoft.Json.JsonConverter - { - public override object ReadJson(JsonReader reader, global::System.Type objectType, object existingValue, JsonSerializer serializer) - { - switch (reader.TokenType) - { - case JsonToken.Null: - return null; - - default: - return (QueryBuilderParameter)(T)serializer.Deserialize(reader, typeof(T)); - } - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - if (value == null) - writer.WriteNull(); - else - serializer.Serialize(writer, ((QueryBuilderParameter)value).Value, typeof(T)); - } - - public override bool CanConvert(global::System.Type objectType) => objectType.IsSubclassOf(typeof(QueryBuilderParameter)); - } - - public class GraphQlInterfaceJsonConverter : global::Newtonsoft.Json.JsonConverter - { - private const string FieldNameType = "__typename"; - - private static readonly Dictionary InterfaceTypeMapping = - typeof(GraphQlInterfaceJsonConverter).Assembly.GetTypes() - .Select(t => new { Type = t, Attribute = t.GetCustomAttribute() }) - .Where(x => x.Attribute != null && x.Type.Namespace == typeof(GraphQlInterfaceJsonConverter).Namespace) - .ToDictionary(x => x.Attribute.TypeName, x => x.Type); - - public override bool CanConvert(global::System.Type objectType) => objectType.IsInterface || objectType.IsArray; - - public override object ReadJson(JsonReader reader, global::System.Type objectType, object existingValue, JsonSerializer serializer) - { - while (reader.TokenType == JsonToken.Comment) - reader.Read(); - - switch (reader.TokenType) - { - case JsonToken.Null: - return null; - - case JsonToken.StartObject: - var jObject = JObject.Load(reader); - if (!jObject.TryGetValue(FieldNameType, out var token) || token.Type != JTokenType.String) - throw CreateJsonReaderException(reader, $"\"{GetType().FullName}\" requires JSON object to contain \"{FieldNameType}\" field with type name"); - - var typeName = token.Value(); - if (!InterfaceTypeMapping.TryGetValue(typeName, out var type)) - throw CreateJsonReaderException(reader, $"type \"{typeName}\" not found"); - - using (reader = CloneReader(jObject, reader)) - return serializer.Deserialize(reader, type); - - case JsonToken.StartArray: - var elementType = GetElementType(objectType); - if (elementType == null) - throw CreateJsonReaderException(reader, $"array element type could not be resolved for type \"{objectType.FullName}\""); - - return ReadArray(reader, objectType, elementType, serializer); - - default: - throw CreateJsonReaderException(reader, $"unrecognized token: {reader.TokenType}"); - } - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) => serializer.Serialize(writer, value); - - private static JsonReader CloneReader(JToken jToken, JsonReader reader) - { - var jObjectReader = jToken.CreateReader(); - jObjectReader.Culture = reader.Culture; - jObjectReader.CloseInput = reader.CloseInput; - jObjectReader.SupportMultipleContent = reader.SupportMultipleContent; - jObjectReader.DateTimeZoneHandling = reader.DateTimeZoneHandling; - jObjectReader.FloatParseHandling = reader.FloatParseHandling; - jObjectReader.DateFormatString = reader.DateFormatString; - jObjectReader.DateParseHandling = reader.DateParseHandling; - return jObjectReader; - } - - private static JsonReaderException CreateJsonReaderException(JsonReader reader, string message) - { - if (reader is IJsonLineInfo lineInfo && lineInfo.HasLineInfo()) - return new JsonReaderException(message, reader.Path, lineInfo.LineNumber, lineInfo.LinePosition, null); - - return new JsonReaderException(message); - } - - private static global::System.Type GetElementType(global::System.Type arrayOrGenericContainer) => - arrayOrGenericContainer.IsArray ? arrayOrGenericContainer.GetElementType() : arrayOrGenericContainer.GenericTypeArguments.FirstOrDefault(); - - private IList ReadArray(JsonReader reader, global::System.Type targetType, global::System.Type elementType, JsonSerializer serializer) - { - var list = CreateCompatibleList(targetType, elementType); - while (reader.Read() && reader.TokenType != JsonToken.EndArray) - list.Add(ReadJson(reader, elementType, null, serializer)); - - if (!targetType.IsArray) - return list; - - var array = Array.CreateInstance(elementType, list.Count); - list.CopyTo(array, 0); - return array; - } - - private static IList CreateCompatibleList(global::System.Type targetContainerType, global::System.Type elementType) => - (IList)Activator.CreateInstance(targetContainerType.IsArray || targetContainerType.IsAbstract ? typeof(List<>).MakeGenericType(elementType) : targetContainerType); - } - #endif - - internal static class GraphQlQueryHelper - { - private static readonly Regex RegexGraphQlIdentifier = new Regex(@"^[_A-Za-z][_0-9A-Za-z]*$", RegexOptions.Compiled); - private static readonly Regex RegexEscapeGraphQlString = new Regex(@"[\\\""/\b\f\n\r\t]", RegexOptions.Compiled); - - public static string GetIndentation(int level, byte indentationSize) - { - return new String(' ', level * indentationSize); - } - - public static string EscapeGraphQlStringValue(string value) - { - return RegexEscapeGraphQlString.Replace(value, m => @$"\{GetEscapeSequence(m.Value)}"); - } - - private static string GetEscapeSequence(string input) - { - switch (input) - { - case "\\": - return "\\"; - case "\"": - return "\""; - case "/": - return "/"; - case "\b": - return "b"; - case "\f": - return "f"; - case "\n": - return "n"; - case "\r": - return "r"; - case "\t": - return "t"; - default: - throw new InvalidOperationException($"invalid character: {input}"); - } - } - - public static string BuildArgumentValue(object value, string formatMask, GraphQlBuilderOptions options, int level) - { - var serializer = options.ArgumentBuilder ?? DefaultGraphQlArgumentBuilder.Instance; - if (serializer.TryBuild(new GraphQlArgumentBuilderContext { Value = value, FormatMask = formatMask, Options = options, Level = level }, out var serializedValue)) - return serializedValue; - - if (value is null) - return "null"; - - var enumerable = value as IEnumerable; - if (!String.IsNullOrEmpty(formatMask) && enumerable == null) - return - value is IFormattable formattable - ? $"\"{EscapeGraphQlStringValue(formattable.ToString(formatMask, CultureInfo.InvariantCulture))}\"" - : throw new ArgumentException($"Value must implement {nameof(IFormattable)} interface to use a format mask. ", nameof(value)); - - if (value is Enum @enum) - return ConvertEnumToString(@enum); - - if (value is bool @bool) - return @bool ? "true" : "false"; - - if (value is DateTime dateTime) - return $"\"{dateTime.ToString("O")}\""; - - if (value is DateTimeOffset dateTimeOffset) - return $"\"{dateTimeOffset.ToString("O")}\""; - - if (value is IGraphQlInputObject inputObject) - return BuildInputObject(inputObject, options, level + 2); - - if (value is Guid) - return $"\"{value}\""; - - if (value is String @string) - return $"\"{EscapeGraphQlStringValue(@string)}\""; - - if (enumerable != null) - return BuildEnumerableArgument(enumerable, formatMask, options, level, '[', ']'); - - if (value is short || value is ushort || value is byte || value is int || value is uint || value is long || value is ulong || value is float || value is double || value is decimal) - return Convert.ToString(value, CultureInfo.InvariantCulture); - - var argumentValue = EscapeGraphQlStringValue(Convert.ToString(value, CultureInfo.InvariantCulture)); - return $"\"{argumentValue}\""; - } - - public static string BuildEnumerableArgument(IEnumerable enumerable, string formatMask, GraphQlBuilderOptions options, int level, char openingSymbol, char closingSymbol) - { - var builder = new StringBuilder(); - builder.Append(openingSymbol); - var delimiter = String.Empty; - foreach (var item in enumerable) - { - builder.Append(delimiter); - - if (options.Formatting == Formatting.Indented) - { - builder.AppendLine(); - builder.Append(GetIndentation(level + 1, options.IndentationSize)); - } - - builder.Append(BuildArgumentValue(item, formatMask, options, level)); - delimiter = ","; - } - - builder.Append(closingSymbol); - return builder.ToString(); - } - - public static string BuildInputObject(IGraphQlInputObject inputObject, GraphQlBuilderOptions options, int level) - { - var builder = new StringBuilder(); - builder.Append("{"); - - var isIndentedFormatting = options.Formatting == Formatting.Indented; - string valueSeparator; - if (isIndentedFormatting) - { - builder.AppendLine(); - valueSeparator = ": "; - } - else - valueSeparator = ":"; - - var separator = String.Empty; - foreach (var propertyValue in inputObject.GetPropertyValues()) - { - var queryBuilderParameter = propertyValue.Value as QueryBuilderParameter; - var value = - queryBuilderParameter?.Name != null - ? $"${queryBuilderParameter.Name}" - : BuildArgumentValue(queryBuilderParameter == null ? propertyValue.Value : queryBuilderParameter.Value, propertyValue.FormatMask, options, level); - - builder.Append(isIndentedFormatting ? GetIndentation(level, options.IndentationSize) : separator); - builder.Append(propertyValue.Name); - builder.Append(valueSeparator); - builder.Append(value); - - separator = ","; - - if (isIndentedFormatting) - builder.AppendLine(); - } - - if (isIndentedFormatting) - builder.Append(GetIndentation(level - 1, options.IndentationSize)); - - builder.Append("}"); - - return builder.ToString(); - } - - public static string BuildDirective(GraphQlDirective directive, GraphQlBuilderOptions options, int level) - { - if (directive == null) - return String.Empty; - - var isIndentedFormatting = options.Formatting == Formatting.Indented; - var indentationSpace = isIndentedFormatting ? " " : String.Empty; - var builder = new StringBuilder(); - builder.Append(indentationSpace); - builder.Append("@"); - builder.Append(directive.Name); - builder.Append("("); - - string separator = null; - foreach (var kvp in directive.Arguments) - { - var argumentName = kvp.Key; - var argument = kvp.Value; - - builder.Append(separator); - builder.Append(argumentName); - builder.Append(":"); - builder.Append(indentationSpace); - - if (argument.Name == null) - builder.Append(BuildArgumentValue(argument.Value, null, options, level)); - else - { - builder.Append("$"); - builder.Append(argument.Name); - } - - separator = isIndentedFormatting ? ", " : ","; - } - - builder.Append(")"); - return builder.ToString(); - } - - public static void ValidateGraphQlIdentifier(string name, string identifier) - { - if (identifier != null && !RegexGraphQlIdentifier.IsMatch(identifier)) - throw new ArgumentException("value must match " + RegexGraphQlIdentifier, name); - } - - private static string ConvertEnumToString(Enum @enum) - { - var enumMember = @enum.GetType().GetField(@enum.ToString()); - if (enumMember == null) - throw new InvalidOperationException("enum member resolution failed"); - - var enumMemberAttribute = (EnumMemberAttribute)enumMember.GetCustomAttribute(typeof(EnumMemberAttribute)); - - return enumMemberAttribute == null - ? @enum.ToString() - : enumMemberAttribute.Value; - } - } - - public interface IGraphQlArgumentBuilder - { - bool TryBuild(GraphQlArgumentBuilderContext context, out string graphQlString); - } - - public class GraphQlArgumentBuilderContext - { - public object Value { get; set; } - public string FormatMask { get; set; } - public GraphQlBuilderOptions Options { get; set; } - public int Level { get; set; } - } - - public class DefaultGraphQlArgumentBuilder : IGraphQlArgumentBuilder - { - private static readonly Regex RegexWhiteSpace = new Regex(@"\s", RegexOptions.Compiled); - - public static readonly DefaultGraphQlArgumentBuilder Instance = new(); - - public bool TryBuild(GraphQlArgumentBuilderContext context, out string graphQlString) - { - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - if (context.Value is JValue jValue) - { - switch (jValue.Type) - { - case JTokenType.Null: - graphQlString = "null"; - return true; - - case JTokenType.Integer: - case JTokenType.Float: - case JTokenType.Boolean: - graphQlString = GraphQlQueryHelper.BuildArgumentValue(jValue.Value, null, context.Options, context.Level); - return true; - - case JTokenType.String: - graphQlString = $"\"{GraphQlQueryHelper.EscapeGraphQlStringValue((string)jValue.Value)}\""; - return true; - - default: - graphQlString = $"\"{jValue.Value}\""; - return true; - } - } - - if (context.Value is JProperty jProperty) - { - if (RegexWhiteSpace.IsMatch(jProperty.Name)) - throw new ArgumentException($"JSON object keys used as GraphQL arguments must not contain whitespace; key: {jProperty.Name}"); - - graphQlString = $"{jProperty.Name}:{(context.Options.Formatting == Formatting.Indented ? " " : null)}{GraphQlQueryHelper.BuildArgumentValue(jProperty.Value, null, context.Options, context.Level)}"; - return true; - } - - if (context.Value is JObject jObject) - { - graphQlString = GraphQlQueryHelper.BuildEnumerableArgument(jObject, null, context.Options, context.Level + 1, '{', '}'); - return true; - } - #endif - - graphQlString = null; - return false; - } - } - - internal struct InputPropertyInfo - { - public string Name { get; set; } - public object Value { get; set; } - public string FormatMask { get; set; } - } - - internal interface IGraphQlInputObject - { - IEnumerable GetPropertyValues(); - } - - public interface IGraphQlQueryBuilder - { - void Clear(); - void IncludeAllFields(); - string Build(Formatting formatting = Formatting.None, byte indentationSize = 2); - } - - public struct QueryBuilderArgumentInfo - { - public string ArgumentName { get; set; } - public QueryBuilderParameter ArgumentValue { get; set; } - public string FormatMask { get; set; } - } - - public abstract class QueryBuilderParameter - { - private string _name; - - internal string GraphQlTypeName { get; } - internal object Value { get; set; } - - public string Name - { - get => _name; - set - { - GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(Name), value); - _name = value; - } - } - - protected QueryBuilderParameter(string name, string graphQlTypeName, object value) - { - Name = name?.Trim(); - GraphQlTypeName = graphQlTypeName?.Replace(" ", null).Replace("\t", null).Replace("\n", null).Replace("\r", null); - Value = value; - } - - protected QueryBuilderParameter(object value) => Value = value; - } - - public class QueryBuilderParameter : QueryBuilderParameter - { - public new T Value - { - get => base.Value == null ? default : (T)base.Value; - set => base.Value = value; - } - - protected QueryBuilderParameter(string name, string graphQlTypeName, T value) : base(name, graphQlTypeName, value) - { - EnsureGraphQlTypeName(graphQlTypeName); - } - - protected QueryBuilderParameter(string name, string graphQlTypeName) : base(name, graphQlTypeName, null) - { - EnsureGraphQlTypeName(graphQlTypeName); - } - - private QueryBuilderParameter(T value) : base(value) - { - } - - public void ResetValue() => base.Value = null; - - public static implicit operator QueryBuilderParameter(T value) => new QueryBuilderParameter(value); - - public static implicit operator T(QueryBuilderParameter parameter) => parameter.Value; - - private static void EnsureGraphQlTypeName(string graphQlTypeName) - { - if (String.IsNullOrWhiteSpace(graphQlTypeName)) - throw new ArgumentException("value required", nameof(graphQlTypeName)); - } - } - - public class GraphQlQueryParameter : QueryBuilderParameter - { - private string _formatMask; - - public string FormatMask - { - get => _formatMask; - set => _formatMask = - typeof(IFormattable).IsAssignableFrom(typeof(T)) - ? value - : throw new InvalidOperationException($"Value must be of {nameof(IFormattable)} type. "); - } - - public GraphQlQueryParameter(string name, string graphQlTypeName = null) - : base(name, graphQlTypeName ?? GetGraphQlTypeName(typeof(T))) - { - } - - public GraphQlQueryParameter(string name, string graphQlTypeName, T defaultValue) - : base(name, graphQlTypeName, defaultValue) - { - } - - public GraphQlQueryParameter(string name, T defaultValue, bool isNullable = true) - : base(name, GetGraphQlTypeName(typeof(T), isNullable), defaultValue) - { - } - - private static string GetGraphQlTypeName(global::System.Type valueType, bool isNullable) - { - var graphQlTypeName = GetGraphQlTypeName(valueType); - if (!isNullable) - graphQlTypeName += "!"; - - return graphQlTypeName; - } - - private static string GetGraphQlTypeName(global::System.Type valueType) - { - var nullableUnderlyingType = Nullable.GetUnderlyingType(valueType); - valueType = nullableUnderlyingType ?? valueType; - - if (valueType.IsArray) - { - var arrayItemType = GetGraphQlTypeName(valueType.GetElementType()); - return arrayItemType == null ? null : "[" + arrayItemType + "]"; - } - - if (typeof(IEnumerable).IsAssignableFrom(valueType)) - { - var genericArguments = valueType.GetGenericArguments(); - if (genericArguments.Length == 1) - { - var listItemType = GetGraphQlTypeName(valueType.GetGenericArguments()[0]); - return listItemType == null ? null : "[" + listItemType + "]"; - } - } - - if (GraphQlTypes.ReverseMapping.TryGetValue(valueType, out var graphQlTypeName)) - return graphQlTypeName; - - if (valueType == typeof(string)) - return "String"; - - var nullableSuffix = nullableUnderlyingType == null ? null : "?"; - graphQlTypeName = GetValueTypeGraphQlTypeName(valueType); - return graphQlTypeName == null ? null : graphQlTypeName + nullableSuffix; - } - - private static string GetValueTypeGraphQlTypeName(global::System.Type valueType) - { - if (valueType == typeof(bool)) - return "Boolean"; - - if (valueType == typeof(float) || valueType == typeof(double) || valueType == typeof(decimal)) - return "Float"; - - if (valueType == typeof(Guid)) - return "ID"; - - if (valueType == typeof(sbyte) || valueType == typeof(byte) || valueType == typeof(short) || valueType == typeof(ushort) || valueType == typeof(int) || valueType == typeof(uint) || - valueType == typeof(long) || valueType == typeof(ulong)) - return "Int"; - - return null; - } - } - - public abstract class GraphQlDirective - { - private readonly Dictionary _arguments = new Dictionary(); - - internal IEnumerable> Arguments => _arguments; - - public string Name { get; } - - protected GraphQlDirective(string name) - { - GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(name), name); - Name = name; - } - - protected void AddArgument(string name, QueryBuilderParameter value) - { - if (value != null) - _arguments[name] = value; - } - } - - public class GraphQlBuilderOptions - { - public Formatting Formatting { get; set; } - public byte IndentationSize { get; set; } = 2; - public IGraphQlArgumentBuilder ArgumentBuilder { get; set; } - } - - public abstract partial class GraphQlQueryBuilder : IGraphQlQueryBuilder - { - private readonly Dictionary _fieldCriteria = new Dictionary(); - - private readonly string _operationType; - private readonly string _operationName; - private Dictionary _fragments; - private List _queryParameters; - - protected abstract string TypeName { get; } - - public abstract IReadOnlyList AllFields { get; } - - protected GraphQlQueryBuilder(string operationType, string operationName) - { - GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(operationName), operationName); - _operationType = operationType; - _operationName = operationName; - } - - public virtual void Clear() - { - _fieldCriteria.Clear(); - _fragments?.Clear(); - _queryParameters?.Clear(); - } - - void IGraphQlQueryBuilder.IncludeAllFields() - { - IncludeAllFields(); - } - - public string Build(Formatting formatting = Formatting.None, byte indentationSize = 2) - { - return Build(new GraphQlBuilderOptions { Formatting = formatting, IndentationSize = indentationSize }); - } - - public string Build(GraphQlBuilderOptions options) - { - return Build(options, 1); - } - - protected void IncludeAllFields() - { - IncludeFields(AllFields.Where(f => !f.RequiresParameters)); - } - - protected virtual string Build(GraphQlBuilderOptions options, int level) - { - var isIndentedFormatting = options.Formatting == Formatting.Indented; - var separator = String.Empty; - var indentationSpace = isIndentedFormatting ? " " : String.Empty; - var builder = new StringBuilder(); - - BuildOperationSignature(builder, options, indentationSpace, level); - - if (builder.Length > 0 || level > 1) - builder.Append(indentationSpace); - - builder.Append("{"); - - if (isIndentedFormatting) - builder.AppendLine(); - - separator = String.Empty; - - foreach (var criteria in _fieldCriteria.Values.Concat(_fragments?.Values ?? Enumerable.Empty())) - { - var fieldCriteria = criteria.Build(options, level); - if (isIndentedFormatting) - builder.AppendLine(fieldCriteria); - else if (!String.IsNullOrEmpty(fieldCriteria)) - { - builder.Append(separator); - builder.Append(fieldCriteria); - } - - separator = ","; - } - - if (isIndentedFormatting) - builder.Append(GraphQlQueryHelper.GetIndentation(level - 1, options.IndentationSize)); - - builder.Append("}"); - - return builder.ToString(); - } - - private void BuildOperationSignature(StringBuilder builder, GraphQlBuilderOptions options, string indentationSpace, int level) - { - if (String.IsNullOrEmpty(_operationType)) - return; - - builder.Append(_operationType); - - if (!String.IsNullOrEmpty(_operationName)) - { - builder.Append(" "); - builder.Append(_operationName); - } - - if (_queryParameters?.Count > 0) - { - builder.Append(indentationSpace); - builder.Append("("); - - var separator = String.Empty; - var isIndentedFormatting = options.Formatting == Formatting.Indented; - - foreach (var queryParameterInfo in _queryParameters) - { - if (isIndentedFormatting) - { - builder.AppendLine(separator); - builder.Append(GraphQlQueryHelper.GetIndentation(level, options.IndentationSize)); - } - else - builder.Append(separator); - - builder.Append("$"); - builder.Append(queryParameterInfo.ArgumentValue.Name); - builder.Append(":"); - builder.Append(indentationSpace); - - builder.Append(queryParameterInfo.ArgumentValue.GraphQlTypeName); - - if (!queryParameterInfo.ArgumentValue.GraphQlTypeName.EndsWith("!") && queryParameterInfo.ArgumentValue.Value is not null) - { - builder.Append(indentationSpace); - builder.Append("="); - builder.Append(indentationSpace); - builder.Append(GraphQlQueryHelper.BuildArgumentValue(queryParameterInfo.ArgumentValue.Value, queryParameterInfo.FormatMask, options, 0)); - } - - if (!isIndentedFormatting) - separator = ","; - } - - builder.Append(")"); - } - } - - protected void IncludeScalarField(string fieldName, string alias, IList args, GraphQlDirective[] directives) - { - _fieldCriteria[alias ?? fieldName] = new GraphQlScalarFieldCriteria(fieldName, alias, args, directives); - } - - protected void IncludeObjectField(string fieldName, string alias, GraphQlQueryBuilder objectFieldQueryBuilder, IList args, GraphQlDirective[] directives) - { - _fieldCriteria[alias ?? fieldName] = new GraphQlObjectFieldCriteria(fieldName, alias, objectFieldQueryBuilder, args, directives); - } - - protected void IncludeFragment(GraphQlQueryBuilder objectFieldQueryBuilder, GraphQlDirective[] directives) - { - _fragments = _fragments ?? new Dictionary(); - _fragments[objectFieldQueryBuilder.TypeName] = new GraphQlFragmentCriteria(objectFieldQueryBuilder, directives); - } - - protected void ExcludeField(string fieldName) - { - if (fieldName == null) - throw new ArgumentNullException(nameof(fieldName)); - - _fieldCriteria.Remove(fieldName); - } - - protected void IncludeFields(IEnumerable fields) - { - IncludeFields(fields, 0, new Dictionary()); - } - - private void IncludeFields(IEnumerable fields, int level, Dictionary parentTypeLevel) - { - global::System.Type builderType = null; - - foreach (var field in fields) - { - if (field.QueryBuilderType == null) - IncludeScalarField(field.Name, field.DefaultAlias, null, null); - else - { - if (_operationType != null && GetType() == field.QueryBuilderType || - parentTypeLevel.TryGetValue(field.QueryBuilderType, out var parentLevel) && parentLevel < level) - continue; - - if (builderType is null) - { - builderType = GetType(); - parentLevel = parentTypeLevel.TryGetValue(builderType, out parentLevel) ? parentLevel : level; - parentTypeLevel[builderType] = Math.Min(level, parentLevel); - } - - var queryBuilder = InitializeChildQueryBuilder(builderType, field.QueryBuilderType, level, parentTypeLevel); - - var includeFragmentMethods = field.QueryBuilderType.GetMethods().Where(IsIncludeFragmentMethod); - - foreach (var includeFragmentMethod in includeFragmentMethods) - includeFragmentMethod.Invoke( - queryBuilder, - new object[] { InitializeChildQueryBuilder(builderType, includeFragmentMethod.GetParameters()[0].ParameterType, level, parentTypeLevel) }); - - if (queryBuilder._fieldCriteria.Count > 0 || queryBuilder._fragments != null) - IncludeObjectField(field.Name, field.DefaultAlias, queryBuilder, null, null); - } - } - } - - private static GraphQlQueryBuilder InitializeChildQueryBuilder(global::System.Type parentQueryBuilderType, global::System.Type queryBuilderType, int level, Dictionary parentTypeLevel) - { - var queryBuilder = (GraphQlQueryBuilder)Activator.CreateInstance(queryBuilderType); - queryBuilder.IncludeFields( - queryBuilder.AllFields.Where(f => !f.RequiresParameters), - level + 1, - parentTypeLevel); - - return queryBuilder; - } - - private static bool IsIncludeFragmentMethod(MethodInfo methodInfo) - { - if (!methodInfo.Name.StartsWith("With") || !methodInfo.Name.EndsWith("Fragment")) - return false; - - var parameters = methodInfo.GetParameters(); - return parameters.Length == 1 && parameters[0].ParameterType.IsSubclassOf(typeof(GraphQlQueryBuilder)); - } - - protected void AddParameter(GraphQlQueryParameter parameter) - { - if (_queryParameters == null) - _queryParameters = new List(); - - _queryParameters.Add(new QueryBuilderArgumentInfo { ArgumentValue = parameter, FormatMask = parameter.FormatMask }); - } - - private abstract class GraphQlFieldCriteria - { - private readonly IList _args; - private readonly GraphQlDirective[] _directives; - - protected readonly string FieldName; - protected readonly string Alias; - - protected static string GetIndentation(Formatting formatting, int level, byte indentationSize) => - formatting == Formatting.Indented ? GraphQlQueryHelper.GetIndentation(level, indentationSize) : null; - - protected GraphQlFieldCriteria(string fieldName, string alias, IList args, GraphQlDirective[] directives) - { - GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(alias), alias); - FieldName = fieldName; - Alias = alias; - _args = args; - _directives = directives; - } - - public abstract string Build(GraphQlBuilderOptions options, int level); - - protected string BuildArgumentClause(GraphQlBuilderOptions options, int level) - { - var separator = options.Formatting == Formatting.Indented ? " " : null; - var argumentCount = _args?.Count ?? 0; - if (argumentCount == 0) - return String.Empty; - - var arguments = - _args.Select( - a => $"{a.ArgumentName}:{separator}{(a.ArgumentValue.Name == null ? GraphQlQueryHelper.BuildArgumentValue(a.ArgumentValue.Value, a.FormatMask, options, level) : $"${a.ArgumentValue.Name}")}"); - - return $"({String.Join($",{separator}", arguments)})"; - } - - protected string BuildDirectiveClause(GraphQlBuilderOptions options, int level) => - _directives == null ? null : String.Concat(_directives.Select(d => d == null ? null : GraphQlQueryHelper.BuildDirective(d, options, level))); - - protected static string BuildAliasPrefix(string alias, Formatting formatting) - { - var separator = formatting == Formatting.Indented ? " " : String.Empty; - return String.IsNullOrWhiteSpace(alias) ? null : $"{alias}:{separator}"; - } - } - - private class GraphQlScalarFieldCriteria : GraphQlFieldCriteria - { - public GraphQlScalarFieldCriteria(string fieldName, string alias, IList args, GraphQlDirective[] directives) - : base(fieldName, alias, args, directives) - { - } - - public override string Build(GraphQlBuilderOptions options, int level) => - GetIndentation(options.Formatting, level, options.IndentationSize) + - BuildAliasPrefix(Alias, options.Formatting) + - FieldName + - BuildArgumentClause(options, level) + - BuildDirectiveClause(options, level); - } - - private class GraphQlObjectFieldCriteria : GraphQlFieldCriteria - { - private readonly GraphQlQueryBuilder _objectQueryBuilder; - - public GraphQlObjectFieldCriteria(string fieldName, string alias, GraphQlQueryBuilder objectQueryBuilder, IList args, GraphQlDirective[] directives) - : base(fieldName, alias, args, directives) - { - _objectQueryBuilder = objectQueryBuilder; - } - - public override string Build(GraphQlBuilderOptions options, int level) => - _objectQueryBuilder._fieldCriteria.Count > 0 || _objectQueryBuilder._fragments?.Count > 0 - ? GetIndentation(options.Formatting, level, options.IndentationSize) + BuildAliasPrefix(Alias, options.Formatting) + FieldName + - BuildArgumentClause(options, level) + BuildDirectiveClause(options, level) + _objectQueryBuilder.Build(options, level + 1) - : null; - } - - private class GraphQlFragmentCriteria : GraphQlFieldCriteria - { - private readonly GraphQlQueryBuilder _objectQueryBuilder; - - public GraphQlFragmentCriteria(GraphQlQueryBuilder objectQueryBuilder, GraphQlDirective[] directives) : base(objectQueryBuilder.TypeName, null, null, directives) - { - _objectQueryBuilder = objectQueryBuilder; - } - - public override string Build(GraphQlBuilderOptions options, int level) => - _objectQueryBuilder._fieldCriteria.Count == 0 - ? null - : GetIndentation(options.Formatting, level, options.IndentationSize) + "..." + (options.Formatting == Formatting.Indented ? " " : null) + "on " + - FieldName + BuildArgumentClause(options, level) + BuildDirectiveClause(options, level) + _objectQueryBuilder.Build(options, level + 1); - } - } - - public abstract partial class GraphQlQueryBuilder : GraphQlQueryBuilder where TQueryBuilder : GraphQlQueryBuilder - { - protected GraphQlQueryBuilder(string operationType = null, string operationName = null) : base(operationType, operationName) - { - } - - /// - /// Includes all fields that don't require parameters into the query. - /// - public TQueryBuilder WithAllFields() - { - IncludeAllFields(); - return (TQueryBuilder)this; - } - - /// - /// Includes all scalar fields that don't require parameters into the query. - /// - public TQueryBuilder WithAllScalarFields() - { - IncludeFields(AllFields.Where(f => !f.IsComplex && !f.RequiresParameters)); - return (TQueryBuilder)this; - } - - public TQueryBuilder ExceptField(string fieldName) - { - ExcludeField(fieldName); - return (TQueryBuilder)this; - } - - /// - /// Includes "__typename" field; included automatically for interface and union types. - /// - public TQueryBuilder WithTypeName(string alias = null, params GraphQlDirective[] directives) - { - IncludeScalarField("__typename", alias, null, directives); - return (TQueryBuilder)this; - } - - protected TQueryBuilder WithScalarField(string fieldName, string alias, GraphQlDirective[] directives, IList args = null) - { - IncludeScalarField(fieldName, alias, args, directives); - return (TQueryBuilder)this; - } - - protected TQueryBuilder WithObjectField(string fieldName, string alias, GraphQlQueryBuilder queryBuilder, GraphQlDirective[] directives, IList args = null) - { - IncludeObjectField(fieldName, alias, queryBuilder, args, directives); - return (TQueryBuilder)this; - } - - protected TQueryBuilder WithFragment(GraphQlQueryBuilder queryBuilder, GraphQlDirective[] directives) - { - IncludeFragment(queryBuilder, directives); - return (TQueryBuilder)this; - } - - protected TQueryBuilder WithParameterInternal(GraphQlQueryParameter parameter) - { - AddParameter(parameter); - return (TQueryBuilder)this; - } - } - - public abstract class GraphQlResponse - { - public TDataContract Data { get; set; } - public ICollection Errors { get; set; } - } - - public class GraphQlQueryError - { - public string Message { get; set; } - public ICollection Locations { get; set; } - } - - public class GraphQlErrorLocation - { - public int Line { get; set; } - public int Column { get; set; } - } - #endregion - - #region GraphQL type helpers - public static class GraphQlTypes - { - public const string Boolean = "Boolean"; - public const string DateTime = "DateTime"; - public const string EmailAddress = "EmailAddress"; - public const string Id = "ID"; - public const string Int = "Int"; - public const string String = "String"; - public const string Uuid = "UUID"; - - public const string UserRole = "UserRole"; - - public const string AuthenticationError = "AuthenticationError"; - public const string Checkpoint = "Checkpoint"; - public const string LiveDoc = "LiveDoc"; - public const string LiveDocPullBulk = "LiveDocPullBulk"; - public const string Mutation = "Mutation"; - public const string PushLiveDocPayload = "PushLiveDocPayload"; - public const string PushUserPayload = "PushUserPayload"; - public const string PushWorkspacePayload = "PushWorkspacePayload"; - public const string Query = "Query"; - public const string Subscription = "Subscription"; - public const string UnauthorizedAccessError = "UnauthorizedAccessError"; - public const string User = "User"; - public const string UserPullBulk = "UserPullBulk"; - public const string Workspace = "Workspace"; - public const string WorkspacePullBulk = "WorkspacePullBulk"; - - public const string BooleanOperationFilterInput = "BooleanOperationFilterInput"; - public const string DateTimeOperationFilterInput = "DateTimeOperationFilterInput"; - public const string ListStringOperationFilterInput = "ListStringOperationFilterInput"; - public const string LiveDocFilterInput = "LiveDocFilterInput"; - public const string LiveDocInput = "LiveDocInput"; - public const string LiveDocInputCheckpoint = "LiveDocInputCheckpoint"; - public const string LiveDocInputHeaders = "LiveDocInputHeaders"; - public const string LiveDocInputPushRow = "LiveDocInputPushRow"; - public const string PushLiveDocInput = "PushLiveDocInput"; - public const string PushUserInput = "PushUserInput"; - public const string PushWorkspaceInput = "PushWorkspaceInput"; - public const string StringOperationFilterInput = "StringOperationFilterInput"; - public const string UserFilterInput = "UserFilterInput"; - public const string UserInput = "UserInput"; - public const string UserInputCheckpoint = "UserInputCheckpoint"; - public const string UserInputHeaders = "UserInputHeaders"; - public const string UserInputPushRow = "UserInputPushRow"; - public const string UserRoleOperationFilterInput = "UserRoleOperationFilterInput"; - public const string UuidOperationFilterInput = "UuidOperationFilterInput"; - public const string WorkspaceFilterInput = "WorkspaceFilterInput"; - public const string WorkspaceInput = "WorkspaceInput"; - public const string WorkspaceInputCheckpoint = "WorkspaceInputCheckpoint"; - public const string WorkspaceInputHeaders = "WorkspaceInputHeaders"; - public const string WorkspaceInputPushRow = "WorkspaceInputPushRow"; - - public const string PushLiveDocError = "PushLiveDocError"; - public const string PushUserError = "PushUserError"; - public const string PushWorkspaceError = "PushWorkspaceError"; - - public const string Error = "Error"; - - public static readonly IReadOnlyDictionary ReverseMapping = - new Dictionary - { - { typeof(string), "String" }, - { typeof(Guid), "UUID" }, - { typeof(DateTimeOffset), "DateTime" }, - { typeof(bool), "Boolean" }, - { typeof(BooleanOperationFilterInputGql), "BooleanOperationFilterInput" }, - { typeof(DateTimeOperationFilterInputGql), "DateTimeOperationFilterInput" }, - { typeof(ListStringOperationFilterInputGql), "ListStringOperationFilterInput" }, - { typeof(LiveDocFilterInputGql), "LiveDocFilterInput" }, - { typeof(LiveDocInputGql), "LiveDocInput" }, - { typeof(LiveDocInputCheckpointGql), "LiveDocInputCheckpoint" }, - { typeof(LiveDocInputHeadersGql), "LiveDocInputHeaders" }, - { typeof(LiveDocInputPushRowGql), "LiveDocInputPushRow" }, - { typeof(PushLiveDocInputGql), "PushLiveDocInput" }, - { typeof(PushUserInputGql), "PushUserInput" }, - { typeof(PushWorkspaceInputGql), "PushWorkspaceInput" }, - { typeof(StringOperationFilterInputGql), "StringOperationFilterInput" }, - { typeof(UserFilterInputGql), "UserFilterInput" }, - { typeof(UserInputGql), "UserInput" }, - { typeof(UserInputCheckpointGql), "UserInputCheckpoint" }, - { typeof(UserInputHeadersGql), "UserInputHeaders" }, - { typeof(UserInputPushRowGql), "UserInputPushRow" }, - { typeof(UserRoleOperationFilterInputGql), "UserRoleOperationFilterInput" }, - { typeof(UuidOperationFilterInputGql), "UuidOperationFilterInput" }, - { typeof(WorkspaceFilterInputGql), "WorkspaceFilterInput" }, - { typeof(WorkspaceInputGql), "WorkspaceInput" }, - { typeof(WorkspaceInputCheckpointGql), "WorkspaceInputCheckpoint" }, - { typeof(WorkspaceInputHeadersGql), "WorkspaceInputHeaders" }, - { typeof(WorkspaceInputPushRowGql), "WorkspaceInputPushRow" } - }; -} - #endregion - - #region enums - public enum UserRoleGql - { - StandardUser, - WorkspaceAdmin, - SystemAdmin - } - #endregion - - #nullable enable - #region directives - public class SkipDirective : GraphQlDirective - { - public SkipDirective(QueryBuilderParameter @if) : base("skip") - { - AddArgument("if", @if); - } - } - - public class IncludeDirective : GraphQlDirective - { - public IncludeDirective(QueryBuilderParameter @if) : base("include") - { - AddArgument("if", @if); - } - } - #endregion - - #region builder classes - public partial class UserPullBulkQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(UserQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "UserPullBulk"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public UserPullBulkQueryBuilderGql WithDocuments(UserQueryBuilderGql userQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, userQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public UserPullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); - - public UserPullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public UserPullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); - } - - public partial class WorkspacePullBulkQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(WorkspaceQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "WorkspacePullBulk"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public WorkspacePullBulkQueryBuilderGql WithDocuments(WorkspaceQueryBuilderGql workspaceQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, workspaceQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public WorkspacePullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); - - public WorkspacePullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public WorkspacePullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); - } - - public partial class LiveDocPullBulkQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(LiveDocQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "LiveDocPullBulk"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public LiveDocPullBulkQueryBuilderGql WithDocuments(LiveDocQueryBuilderGql liveDocQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, liveDocQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public LiveDocPullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); - - public LiveDocPullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public LiveDocPullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); - } - - public partial class QueryQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "pullUser", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(UserPullBulkQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "pullWorkspace", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(WorkspacePullBulkQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "pullLiveDoc", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(LiveDocPullBulkQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "Query"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public QueryQueryBuilderGql(string? operationName = null) : base("query", operationName) - { - } - - public QueryQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); - - public QueryQueryBuilderGql WithPullUser(UserPullBulkQueryBuilderGql userPullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (checkpoint != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); - - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); - if (where != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); - - return WithObjectField("pullUser", alias, userPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public QueryQueryBuilderGql ExceptPullUser() => ExceptField("pullUser"); - - public QueryQueryBuilderGql WithPullWorkspace(WorkspacePullBulkQueryBuilderGql workspacePullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (checkpoint != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); - - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); - if (where != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); - - return WithObjectField("pullWorkspace", alias, workspacePullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public QueryQueryBuilderGql ExceptPullWorkspace() => ExceptField("pullWorkspace"); - - public QueryQueryBuilderGql WithPullLiveDoc(LiveDocPullBulkQueryBuilderGql liveDocPullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (checkpoint != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); - - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); - if (where != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); - - return WithObjectField("pullLiveDoc", alias, liveDocPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public QueryQueryBuilderGql ExceptPullLiveDoc() => ExceptField("pullLiveDoc"); - } - - public partial class MutationQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "pushUser", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushUserPayloadQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "pushWorkspace", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushWorkspacePayloadQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "pushLiveDoc", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushLiveDocPayloadQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "Mutation"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public MutationQueryBuilderGql(string? operationName = null) : base("mutation", operationName) - { - } - - public MutationQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); - - public MutationQueryBuilderGql WithPushUser(PushUserPayloadQueryBuilderGql pushUserPayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); - return WithObjectField("pushUser", alias, pushUserPayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public MutationQueryBuilderGql ExceptPushUser() => ExceptField("pushUser"); - - public MutationQueryBuilderGql WithPushWorkspace(PushWorkspacePayloadQueryBuilderGql pushWorkspacePayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); - return WithObjectField("pushWorkspace", alias, pushWorkspacePayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public MutationQueryBuilderGql ExceptPushWorkspace() => ExceptField("pushWorkspace"); - - public MutationQueryBuilderGql WithPushLiveDoc(PushLiveDocPayloadQueryBuilderGql pushLiveDocPayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); - return WithObjectField("pushLiveDoc", alias, pushLiveDocPayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public MutationQueryBuilderGql ExceptPushLiveDoc() => ExceptField("pushLiveDoc"); - } - - public partial class SubscriptionQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "streamUser", IsComplex = true, QueryBuilderType = typeof(UserPullBulkQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "streamWorkspace", IsComplex = true, QueryBuilderType = typeof(WorkspacePullBulkQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "streamLiveDoc", IsComplex = true, QueryBuilderType = typeof(LiveDocPullBulkQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "Subscription"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public SubscriptionQueryBuilderGql(string? operationName = null) : base("subscription", operationName) - { - } - - public SubscriptionQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); - - public SubscriptionQueryBuilderGql WithStreamUser(UserPullBulkQueryBuilderGql userPullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (headers != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); - - if (topics != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); - - return WithObjectField("streamUser", alias, userPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public SubscriptionQueryBuilderGql ExceptStreamUser() => ExceptField("streamUser"); - - public SubscriptionQueryBuilderGql WithStreamWorkspace(WorkspacePullBulkQueryBuilderGql workspacePullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (headers != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); - - if (topics != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); - - return WithObjectField("streamWorkspace", alias, workspacePullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public SubscriptionQueryBuilderGql ExceptStreamWorkspace() => ExceptField("streamWorkspace"); - - public SubscriptionQueryBuilderGql WithStreamLiveDoc(LiveDocPullBulkQueryBuilderGql liveDocPullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (headers != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); - - if (topics != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); - - return WithObjectField("streamLiveDoc", alias, liveDocPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public SubscriptionQueryBuilderGql ExceptStreamLiveDoc() => ExceptField("streamLiveDoc"); - } - - public partial class UserQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "firstName" }, - new GraphQlFieldMetadata { Name = "lastName" }, - new GraphQlFieldMetadata { Name = "fullName" }, - new GraphQlFieldMetadata { Name = "email" }, - new GraphQlFieldMetadata { Name = "role" }, - new GraphQlFieldMetadata { Name = "jwtAccessToken" }, - new GraphQlFieldMetadata { Name = "workspaceId" }, - new GraphQlFieldMetadata { Name = "id" }, - new GraphQlFieldMetadata { Name = "isDeleted" }, - new GraphQlFieldMetadata { Name = "updatedAt" }, - new GraphQlFieldMetadata { Name = "topics", IsComplex = true } - }; - - protected override string TypeName { get; } = "User"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public UserQueryBuilderGql WithFirstName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("firstName", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptFirstName() => ExceptField("firstName"); - - public UserQueryBuilderGql WithLastName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("lastName", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptLastName() => ExceptField("lastName"); - - public UserQueryBuilderGql WithFullName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("fullName", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptFullName() => ExceptField("fullName"); - - public UserQueryBuilderGql WithEmail(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("email", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptEmail() => ExceptField("email"); - - public UserQueryBuilderGql WithRole(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("role", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptRole() => ExceptField("role"); - - public UserQueryBuilderGql WithJwtAccessToken(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("jwtAccessToken", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptJwtAccessToken() => ExceptField("jwtAccessToken"); - - public UserQueryBuilderGql WithWorkspaceId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("workspaceId", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptWorkspaceId() => ExceptField("workspaceId"); - - public UserQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptId() => ExceptField("id"); - - public UserQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); - - public UserQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); - - public UserQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptTopics() => ExceptField("topics"); - } - - public partial class CheckpointQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "lastDocumentId" }, - new GraphQlFieldMetadata { Name = "updatedAt" } - }; - - protected override string TypeName { get; } = "Checkpoint"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public CheckpointQueryBuilderGql WithLastDocumentId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("lastDocumentId", alias, new GraphQlDirective?[] { skip, include }); - - public CheckpointQueryBuilderGql ExceptLastDocumentId() => ExceptField("lastDocumentId"); - - public CheckpointQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); - - public CheckpointQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); - } - - public partial class AuthenticationErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "message" } - }; - - protected override string TypeName { get; } = "AuthenticationError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public AuthenticationErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); - - public AuthenticationErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); - } - - public partial class UnauthorizedAccessErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "message" } - }; - - protected override string TypeName { get; } = "UnauthorizedAccessError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public UnauthorizedAccessErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); - - public UnauthorizedAccessErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); - } - - public partial class WorkspaceQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "name" }, - new GraphQlFieldMetadata { Name = "id" }, - new GraphQlFieldMetadata { Name = "isDeleted" }, - new GraphQlFieldMetadata { Name = "updatedAt" }, - new GraphQlFieldMetadata { Name = "topics", IsComplex = true } - }; - - protected override string TypeName { get; } = "Workspace"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public WorkspaceQueryBuilderGql WithName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("name", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptName() => ExceptField("name"); - - public WorkspaceQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptId() => ExceptField("id"); - - public WorkspaceQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); - - public WorkspaceQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); - - public WorkspaceQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptTopics() => ExceptField("topics"); - } - - public partial class LiveDocQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "content" }, - new GraphQlFieldMetadata { Name = "ownerId" }, - new GraphQlFieldMetadata { Name = "workspaceId" }, - new GraphQlFieldMetadata { Name = "id" }, - new GraphQlFieldMetadata { Name = "isDeleted" }, - new GraphQlFieldMetadata { Name = "updatedAt" }, - new GraphQlFieldMetadata { Name = "topics", IsComplex = true } - }; - - protected override string TypeName { get; } = "LiveDoc"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public LiveDocQueryBuilderGql WithContent(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("content", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptContent() => ExceptField("content"); - - public LiveDocQueryBuilderGql WithOwnerId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("ownerId", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptOwnerId() => ExceptField("ownerId"); - - public LiveDocQueryBuilderGql WithWorkspaceId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("workspaceId", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptWorkspaceId() => ExceptField("workspaceId"); - - public LiveDocQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptId() => ExceptField("id"); - - public LiveDocQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); - - public LiveDocQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); - - public LiveDocQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptTopics() => ExceptField("topics"); - } - - public partial class ErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "message" } - }; - - public ErrorQueryBuilderGql() => WithTypeName(); - - protected override string TypeName { get; } = "Error"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public ErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); - - public ErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); - - public ErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public ErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - } - - public partial class PushUserErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); - - public PushUserErrorQueryBuilderGql() => WithTypeName(); - - protected override string TypeName { get; } = "PushUserError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushUserErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushUserErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - } - - public partial class PushUserPayloadQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "user", IsComplex = true, QueryBuilderType = typeof(UserQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushUserErrorQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "PushUserPayload"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushUserPayloadQueryBuilderGql WithUser(UserQueryBuilderGql userQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("user", alias, userQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushUserPayloadQueryBuilderGql ExceptUser() => ExceptField("user"); - - public PushUserPayloadQueryBuilderGql WithErrors(PushUserErrorQueryBuilderGql pushUserErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushUserErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushUserPayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); - } - - public partial class PushWorkspaceErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); - - public PushWorkspaceErrorQueryBuilderGql() => WithTypeName(); - - protected override string TypeName { get; } = "PushWorkspaceError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushWorkspaceErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushWorkspaceErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - } - - public partial class PushWorkspacePayloadQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "workspace", IsComplex = true, QueryBuilderType = typeof(WorkspaceQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushWorkspaceErrorQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "PushWorkspacePayload"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushWorkspacePayloadQueryBuilderGql WithWorkspace(WorkspaceQueryBuilderGql workspaceQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("workspace", alias, workspaceQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushWorkspacePayloadQueryBuilderGql ExceptWorkspace() => ExceptField("workspace"); - - public PushWorkspacePayloadQueryBuilderGql WithErrors(PushWorkspaceErrorQueryBuilderGql pushWorkspaceErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushWorkspaceErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushWorkspacePayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); - } - - public partial class PushLiveDocErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); - - public PushLiveDocErrorQueryBuilderGql() => WithTypeName(); - - protected override string TypeName { get; } = "PushLiveDocError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushLiveDocErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushLiveDocErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - } - - public partial class PushLiveDocPayloadQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "liveDoc", IsComplex = true, QueryBuilderType = typeof(LiveDocQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushLiveDocErrorQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "PushLiveDocPayload"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushLiveDocPayloadQueryBuilderGql WithLiveDoc(LiveDocQueryBuilderGql liveDocQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("liveDoc", alias, liveDocQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushLiveDocPayloadQueryBuilderGql ExceptLiveDoc() => ExceptField("liveDoc"); - - public PushLiveDocPayloadQueryBuilderGql WithErrors(PushLiveDocErrorQueryBuilderGql pushLiveDocErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushLiveDocErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushLiveDocPayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); - } - #endregion - - #region input classes - public partial class UserInputCheckpointGql : IGraphQlInputObject - { - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _lastDocumentId; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastDocumentId - { - get => (QueryBuilderParameter?)_lastDocumentId.Value; - set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_updatedAt.Name != null) yield return _updatedAt; - if (_lastDocumentId.Name != null) yield return _lastDocumentId; - } - } - - public partial class UserInputPushRowGql : IGraphQlInputObject - { - private InputPropertyInfo _assumedMasterState; - private InputPropertyInfo _newDocumentState; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? AssumedMasterState - { - get => (QueryBuilderParameter?)_assumedMasterState.Value; - set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NewDocumentState - { - get => (QueryBuilderParameter?)_newDocumentState.Value; - set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_assumedMasterState.Name != null) yield return _assumedMasterState; - if (_newDocumentState.Name != null) yield return _newDocumentState; - } - } - - public partial class WorkspaceInputCheckpointGql : IGraphQlInputObject - { - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _lastDocumentId; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastDocumentId - { - get => (QueryBuilderParameter?)_lastDocumentId.Value; - set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_updatedAt.Name != null) yield return _updatedAt; - if (_lastDocumentId.Name != null) yield return _lastDocumentId; - } - } - - public partial class WorkspaceInputPushRowGql : IGraphQlInputObject - { - private InputPropertyInfo _assumedMasterState; - private InputPropertyInfo _newDocumentState; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? AssumedMasterState - { - get => (QueryBuilderParameter?)_assumedMasterState.Value; - set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NewDocumentState - { - get => (QueryBuilderParameter?)_newDocumentState.Value; - set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_assumedMasterState.Name != null) yield return _assumedMasterState; - if (_newDocumentState.Name != null) yield return _newDocumentState; - } - } - - public partial class LiveDocInputCheckpointGql : IGraphQlInputObject - { - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _lastDocumentId; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastDocumentId - { - get => (QueryBuilderParameter?)_lastDocumentId.Value; - set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_updatedAt.Name != null) yield return _updatedAt; - if (_lastDocumentId.Name != null) yield return _lastDocumentId; - } - } - - public partial class LiveDocInputPushRowGql : IGraphQlInputObject - { - private InputPropertyInfo _assumedMasterState; - private InputPropertyInfo _newDocumentState; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? AssumedMasterState - { - get => (QueryBuilderParameter?)_assumedMasterState.Value; - set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NewDocumentState - { - get => (QueryBuilderParameter?)_newDocumentState.Value; - set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_assumedMasterState.Name != null) yield return _assumedMasterState; - if (_newDocumentState.Name != null) yield return _newDocumentState; - } - } - - public partial class UserFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _and; - private InputPropertyInfo _or; - private InputPropertyInfo _firstName; - private InputPropertyInfo _lastName; - private InputPropertyInfo _fullName; - private InputPropertyInfo _email; - private InputPropertyInfo _role; - private InputPropertyInfo _jwtAccessToken; - private InputPropertyInfo _workspaceId; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? And - { - get => (QueryBuilderParameter?>?)_and.Value; - set => _and = new InputPropertyInfo { Name = "and", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Or - { - get => (QueryBuilderParameter?>?)_or.Value; - set => _or = new InputPropertyInfo { Name = "or", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? FirstName - { - get => (QueryBuilderParameter?)_firstName.Value; - set => _firstName = new InputPropertyInfo { Name = "firstName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastName - { - get => (QueryBuilderParameter?)_lastName.Value; - set => _lastName = new InputPropertyInfo { Name = "lastName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? FullName - { - get => (QueryBuilderParameter?)_fullName.Value; - set => _fullName = new InputPropertyInfo { Name = "fullName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Email - { - get => (QueryBuilderParameter?)_email.Value; - set => _email = new InputPropertyInfo { Name = "email", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Role - { - get => (QueryBuilderParameter?)_role.Value; - set => _role = new InputPropertyInfo { Name = "role", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? JwtAccessToken - { - get => (QueryBuilderParameter?)_jwtAccessToken.Value; - set => _jwtAccessToken = new InputPropertyInfo { Name = "jwtAccessToken", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? WorkspaceId - { - get => (QueryBuilderParameter?)_workspaceId.Value; - set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Topics - { - get => (QueryBuilderParameter?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_and.Name != null) yield return _and; - if (_or.Name != null) yield return _or; - if (_firstName.Name != null) yield return _firstName; - if (_lastName.Name != null) yield return _lastName; - if (_fullName.Name != null) yield return _fullName; - if (_email.Name != null) yield return _email; - if (_role.Name != null) yield return _role; - if (_jwtAccessToken.Name != null) yield return _jwtAccessToken; - if (_workspaceId.Name != null) yield return _workspaceId; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class UserInputGql : IGraphQlInputObject - { - private InputPropertyInfo _firstName; - private InputPropertyInfo _lastName; - private InputPropertyInfo _fullName; - private InputPropertyInfo _email; - private InputPropertyInfo _role; - private InputPropertyInfo _jwtAccessToken; - private InputPropertyInfo _workspaceId; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? FirstName - { - get => (QueryBuilderParameter?)_firstName.Value; - set => _firstName = new InputPropertyInfo { Name = "firstName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastName - { - get => (QueryBuilderParameter?)_lastName.Value; - set => _lastName = new InputPropertyInfo { Name = "lastName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? FullName - { - get => (QueryBuilderParameter?)_fullName.Value; - set => _fullName = new InputPropertyInfo { Name = "fullName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Email - { - get => (QueryBuilderParameter?)_email.Value; - set => _email = new InputPropertyInfo { Name = "email", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Role - { - get => (QueryBuilderParameter?)_role.Value; - set => _role = new InputPropertyInfo { Name = "role", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? JwtAccessToken - { - get => (QueryBuilderParameter?)_jwtAccessToken.Value; - set => _jwtAccessToken = new InputPropertyInfo { Name = "jwtAccessToken", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? WorkspaceId - { - get => (QueryBuilderParameter?)_workspaceId.Value; - set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Topics - { - get => (QueryBuilderParameter?>?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_firstName.Name != null) yield return _firstName; - if (_lastName.Name != null) yield return _lastName; - if (_fullName.Name != null) yield return _fullName; - if (_email.Name != null) yield return _email; - if (_role.Name != null) yield return _role; - if (_jwtAccessToken.Name != null) yield return _jwtAccessToken; - if (_workspaceId.Name != null) yield return _workspaceId; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class UserInputHeadersGql : IGraphQlInputObject - { - private InputPropertyInfo _authorization; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Authorization - { - get => (QueryBuilderParameter?)_authorization.Value; - set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_authorization.Name != null) yield return _authorization; - } - } - - public partial class WorkspaceFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _and; - private InputPropertyInfo _or; - private InputPropertyInfo _name; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? And - { - get => (QueryBuilderParameter?>?)_and.Value; - set => _and = new InputPropertyInfo { Name = "and", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Or - { - get => (QueryBuilderParameter?>?)_or.Value; - set => _or = new InputPropertyInfo { Name = "or", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Name - { - get => (QueryBuilderParameter?)_name.Value; - set => _name = new InputPropertyInfo { Name = "name", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Topics - { - get => (QueryBuilderParameter?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_and.Name != null) yield return _and; - if (_or.Name != null) yield return _or; - if (_name.Name != null) yield return _name; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class WorkspaceInputGql : IGraphQlInputObject - { - private InputPropertyInfo _name; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Name - { - get => (QueryBuilderParameter?)_name.Value; - set => _name = new InputPropertyInfo { Name = "name", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Topics - { - get => (QueryBuilderParameter?>?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_name.Name != null) yield return _name; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class WorkspaceInputHeadersGql : IGraphQlInputObject - { - private InputPropertyInfo _authorization; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Authorization - { - get => (QueryBuilderParameter?)_authorization.Value; - set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_authorization.Name != null) yield return _authorization; - } - } - - public partial class LiveDocFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _and; - private InputPropertyInfo _or; - private InputPropertyInfo _content; - private InputPropertyInfo _ownerId; - private InputPropertyInfo _workspaceId; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? And - { - get => (QueryBuilderParameter?>?)_and.Value; - set => _and = new InputPropertyInfo { Name = "and", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Or - { - get => (QueryBuilderParameter?>?)_or.Value; - set => _or = new InputPropertyInfo { Name = "or", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Content - { - get => (QueryBuilderParameter?)_content.Value; - set => _content = new InputPropertyInfo { Name = "content", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? OwnerId - { - get => (QueryBuilderParameter?)_ownerId.Value; - set => _ownerId = new InputPropertyInfo { Name = "ownerId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? WorkspaceId - { - get => (QueryBuilderParameter?)_workspaceId.Value; - set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Topics - { - get => (QueryBuilderParameter?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_and.Name != null) yield return _and; - if (_or.Name != null) yield return _or; - if (_content.Name != null) yield return _content; - if (_ownerId.Name != null) yield return _ownerId; - if (_workspaceId.Name != null) yield return _workspaceId; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class LiveDocInputGql : IGraphQlInputObject - { - private InputPropertyInfo _content; - private InputPropertyInfo _ownerId; - private InputPropertyInfo _workspaceId; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Content - { - get => (QueryBuilderParameter?)_content.Value; - set => _content = new InputPropertyInfo { Name = "content", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? OwnerId - { - get => (QueryBuilderParameter?)_ownerId.Value; - set => _ownerId = new InputPropertyInfo { Name = "ownerId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? WorkspaceId - { - get => (QueryBuilderParameter?)_workspaceId.Value; - set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Topics - { - get => (QueryBuilderParameter?>?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_content.Name != null) yield return _content; - if (_ownerId.Name != null) yield return _ownerId; - if (_workspaceId.Name != null) yield return _workspaceId; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class LiveDocInputHeadersGql : IGraphQlInputObject - { - private InputPropertyInfo _authorization; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Authorization - { - get => (QueryBuilderParameter?)_authorization.Value; - set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_authorization.Name != null) yield return _authorization; - } - } - - public partial class StringOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _and; - private InputPropertyInfo _or; - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - private InputPropertyInfo _contains; - private InputPropertyInfo _ncontains; - private InputPropertyInfo _in; - private InputPropertyInfo _nin; - private InputPropertyInfo _startsWith; - private InputPropertyInfo _nstartsWith; - private InputPropertyInfo _endsWith; - private InputPropertyInfo _nendsWith; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? And - { - get => (QueryBuilderParameter?>?)_and.Value; - set => _and = new InputPropertyInfo { Name = "and", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Or - { - get => (QueryBuilderParameter?>?)_or.Value; - set => _or = new InputPropertyInfo { Name = "or", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Contains - { - get => (QueryBuilderParameter?)_contains.Value; - set => _contains = new InputPropertyInfo { Name = "contains", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ncontains - { - get => (QueryBuilderParameter?)_ncontains.Value; - set => _ncontains = new InputPropertyInfo { Name = "ncontains", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? In - { - get => (QueryBuilderParameter?>?)_in.Value; - set => _in = new InputPropertyInfo { Name = "in", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Nin - { - get => (QueryBuilderParameter?>?)_nin.Value; - set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? StartsWith - { - get => (QueryBuilderParameter?)_startsWith.Value; - set => _startsWith = new InputPropertyInfo { Name = "startsWith", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NstartsWith - { - get => (QueryBuilderParameter?)_nstartsWith.Value; - set => _nstartsWith = new InputPropertyInfo { Name = "nstartsWith", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? EndsWith - { - get => (QueryBuilderParameter?)_endsWith.Value; - set => _endsWith = new InputPropertyInfo { Name = "endsWith", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NendsWith - { - get => (QueryBuilderParameter?)_nendsWith.Value; - set => _nendsWith = new InputPropertyInfo { Name = "nendsWith", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_and.Name != null) yield return _and; - if (_or.Name != null) yield return _or; - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - if (_contains.Name != null) yield return _contains; - if (_ncontains.Name != null) yield return _ncontains; - if (_in.Name != null) yield return _in; - if (_nin.Name != null) yield return _nin; - if (_startsWith.Name != null) yield return _startsWith; - if (_nstartsWith.Name != null) yield return _nstartsWith; - if (_endsWith.Name != null) yield return _endsWith; - if (_nendsWith.Name != null) yield return _nendsWith; - } - } - - public partial class UserRoleOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - private InputPropertyInfo _in; - private InputPropertyInfo _nin; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? In - { - get => (QueryBuilderParameter?>?)_in.Value; - set => _in = new InputPropertyInfo { Name = "in", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Nin - { - get => (QueryBuilderParameter?>?)_nin.Value; - set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - if (_in.Name != null) yield return _in; - if (_nin.Name != null) yield return _nin; - } - } - - public partial class UuidOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - private InputPropertyInfo _in; - private InputPropertyInfo _nin; - private InputPropertyInfo _gt; - private InputPropertyInfo _ngt; - private InputPropertyInfo _gte; - private InputPropertyInfo _ngte; - private InputPropertyInfo _lt; - private InputPropertyInfo _nlt; - private InputPropertyInfo _lte; - private InputPropertyInfo _nlte; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? In - { - get => (QueryBuilderParameter?>?)_in.Value; - set => _in = new InputPropertyInfo { Name = "in", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Nin - { - get => (QueryBuilderParameter?>?)_nin.Value; - set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Gt - { - get => (QueryBuilderParameter?)_gt.Value; - set => _gt = new InputPropertyInfo { Name = "gt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ngt - { - get => (QueryBuilderParameter?)_ngt.Value; - set => _ngt = new InputPropertyInfo { Name = "ngt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Gte - { - get => (QueryBuilderParameter?)_gte.Value; - set => _gte = new InputPropertyInfo { Name = "gte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ngte - { - get => (QueryBuilderParameter?)_ngte.Value; - set => _ngte = new InputPropertyInfo { Name = "ngte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Lt - { - get => (QueryBuilderParameter?)_lt.Value; - set => _lt = new InputPropertyInfo { Name = "lt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Nlt - { - get => (QueryBuilderParameter?)_nlt.Value; - set => _nlt = new InputPropertyInfo { Name = "nlt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Lte - { - get => (QueryBuilderParameter?)_lte.Value; - set => _lte = new InputPropertyInfo { Name = "lte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Nlte - { - get => (QueryBuilderParameter?)_nlte.Value; - set => _nlte = new InputPropertyInfo { Name = "nlte", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - if (_in.Name != null) yield return _in; - if (_nin.Name != null) yield return _nin; - if (_gt.Name != null) yield return _gt; - if (_ngt.Name != null) yield return _ngt; - if (_gte.Name != null) yield return _gte; - if (_ngte.Name != null) yield return _ngte; - if (_lt.Name != null) yield return _lt; - if (_nlt.Name != null) yield return _nlt; - if (_lte.Name != null) yield return _lte; - if (_nlte.Name != null) yield return _nlte; - } - } - - public partial class BooleanOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - } - } - - public partial class DateTimeOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - private InputPropertyInfo _in; - private InputPropertyInfo _nin; - private InputPropertyInfo _gt; - private InputPropertyInfo _ngt; - private InputPropertyInfo _gte; - private InputPropertyInfo _ngte; - private InputPropertyInfo _lt; - private InputPropertyInfo _nlt; - private InputPropertyInfo _lte; - private InputPropertyInfo _nlte; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? In - { - get => (QueryBuilderParameter?>?)_in.Value; - set => _in = new InputPropertyInfo { Name = "in", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Nin - { - get => (QueryBuilderParameter?>?)_nin.Value; - set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Gt - { - get => (QueryBuilderParameter?)_gt.Value; - set => _gt = new InputPropertyInfo { Name = "gt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ngt - { - get => (QueryBuilderParameter?)_ngt.Value; - set => _ngt = new InputPropertyInfo { Name = "ngt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Gte - { - get => (QueryBuilderParameter?)_gte.Value; - set => _gte = new InputPropertyInfo { Name = "gte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ngte - { - get => (QueryBuilderParameter?)_ngte.Value; - set => _ngte = new InputPropertyInfo { Name = "ngte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Lt - { - get => (QueryBuilderParameter?)_lt.Value; - set => _lt = new InputPropertyInfo { Name = "lt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Nlt - { - get => (QueryBuilderParameter?)_nlt.Value; - set => _nlt = new InputPropertyInfo { Name = "nlt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Lte - { - get => (QueryBuilderParameter?)_lte.Value; - set => _lte = new InputPropertyInfo { Name = "lte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Nlte - { - get => (QueryBuilderParameter?)_nlte.Value; - set => _nlte = new InputPropertyInfo { Name = "nlte", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - if (_in.Name != null) yield return _in; - if (_nin.Name != null) yield return _nin; - if (_gt.Name != null) yield return _gt; - if (_ngt.Name != null) yield return _ngt; - if (_gte.Name != null) yield return _gte; - if (_ngte.Name != null) yield return _ngte; - if (_lt.Name != null) yield return _lt; - if (_nlt.Name != null) yield return _nlt; - if (_lte.Name != null) yield return _lte; - if (_nlte.Name != null) yield return _nlte; - } - } - - public partial class ListStringOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _all; - private InputPropertyInfo _none; - private InputPropertyInfo _some; - private InputPropertyInfo _any; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? All - { - get => (QueryBuilderParameter?)_all.Value; - set => _all = new InputPropertyInfo { Name = "all", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? None - { - get => (QueryBuilderParameter?)_none.Value; - set => _none = new InputPropertyInfo { Name = "none", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Some - { - get => (QueryBuilderParameter?)_some.Value; - set => _some = new InputPropertyInfo { Name = "some", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Any - { - get => (QueryBuilderParameter?)_any.Value; - set => _any = new InputPropertyInfo { Name = "any", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_all.Name != null) yield return _all; - if (_none.Name != null) yield return _none; - if (_some.Name != null) yield return _some; - if (_any.Name != null) yield return _any; - } - } - - public partial class PushUserInputGql : IGraphQlInputObject - { - private InputPropertyInfo _userPushRow; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? UserPushRow - { - get => (QueryBuilderParameter?>?)_userPushRow.Value; - set => _userPushRow = new InputPropertyInfo { Name = "userPushRow", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_userPushRow.Name != null) yield return _userPushRow; - } - } - - public partial class PushWorkspaceInputGql : IGraphQlInputObject - { - private InputPropertyInfo _workspacePushRow; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? WorkspacePushRow - { - get => (QueryBuilderParameter?>?)_workspacePushRow.Value; - set => _workspacePushRow = new InputPropertyInfo { Name = "workspacePushRow", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_workspacePushRow.Name != null) yield return _workspacePushRow; - } - } - - public partial class PushLiveDocInputGql : IGraphQlInputObject - { - private InputPropertyInfo _liveDocPushRow; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? LiveDocPushRow - { - get => (QueryBuilderParameter?>?)_liveDocPushRow.Value; - set => _liveDocPushRow = new InputPropertyInfo { Name = "liveDocPushRow", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_liveDocPushRow.Name != null) yield return _liveDocPushRow; - } - } - #endregion - - #region data classes - public partial class UserPullBulkGql - { - public ICollection? Documents { get; set; } - public CheckpointGql? Checkpoint { get; set; } - } - - public partial class WorkspacePullBulkGql - { - public ICollection? Documents { get; set; } - public CheckpointGql? Checkpoint { get; set; } - } - - public partial class LiveDocPullBulkGql - { - public ICollection? Documents { get; set; } - public CheckpointGql? Checkpoint { get; set; } - } - - public partial class QueryGql - { - public UserPullBulkGql? PullUser { get; set; } - public WorkspacePullBulkGql? PullWorkspace { get; set; } - public LiveDocPullBulkGql? PullLiveDoc { get; set; } - } - - public partial class MutationGql - { - public PushUserPayloadGql? PushUser { get; set; } - public PushWorkspacePayloadGql? PushWorkspace { get; set; } - public PushLiveDocPayloadGql? PushLiveDoc { get; set; } - } - - public partial class SubscriptionGql - { - public UserPullBulkGql? StreamUser { get; set; } - public WorkspacePullBulkGql? StreamWorkspace { get; set; } - public LiveDocPullBulkGql? StreamLiveDoc { get; set; } - } - - public partial class UserGql - { - public string FirstName { get; set; } - public string LastName { get; set; } - public string? FullName { get; set; } - public string? Email { get; set; } - public LiveDocs.GraphQLApi.Security.UserRole Role { get; set; } - public string? JwtAccessToken { get; set; } - public Guid WorkspaceId { get; set; } - public Guid Id { get; set; } - public bool IsDeleted { get; set; } - public DateTimeOffset UpdatedAt { get; set; } - public ICollection? Topics { get; set; } - } - - public partial class CheckpointGql - { - public Guid? LastDocumentId { get; set; } - public DateTimeOffset? UpdatedAt { get; set; } - } - - [GraphQlObjectType("AuthenticationError")] - public partial class AuthenticationErrorGql : IPushUserErrorGql, IPushWorkspaceErrorGql, IPushLiveDocErrorGql, IErrorGql - { - public string Message { get; set; } - } - - [GraphQlObjectType("UnauthorizedAccessError")] - public partial class UnauthorizedAccessErrorGql : IPushUserErrorGql, IPushWorkspaceErrorGql, IPushLiveDocErrorGql, IErrorGql - { - public string Message { get; set; } - } - - public partial class WorkspaceGql - { - public string Name { get; set; } - public Guid Id { get; set; } - public bool IsDeleted { get; set; } - public DateTimeOffset UpdatedAt { get; set; } - public ICollection? Topics { get; set; } - } - - public partial class LiveDocGql - { - public string Content { get; set; } - public Guid OwnerId { get; set; } - public Guid WorkspaceId { get; set; } - public Guid Id { get; set; } - public bool IsDeleted { get; set; } - public DateTimeOffset UpdatedAt { get; set; } - public ICollection? Topics { get; set; } - } - - public partial interface IErrorGql - { - string Message { get; set; } - } - - public partial interface IPushUserErrorGql - { - } - - public partial class PushUserPayloadGql - { - public ICollection? User { get; set; } - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] - #endif - public ICollection? Errors { get; set; } - } - - public partial interface IPushWorkspaceErrorGql - { - } - - public partial class PushWorkspacePayloadGql - { - public ICollection? Workspace { get; set; } - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] - #endif - public ICollection? Errors { get; set; } - } - - public partial interface IPushLiveDocErrorGql - { - } - - public partial class PushLiveDocPayloadGql - { - public ICollection? LiveDoc { get; set; } - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] - #endif - public ICollection? Errors { get; set; } - } - #endregion - #nullable restore -} + +namespace RxDBDotNet.Tests.Model +{ + #region base classes + public struct GraphQlFieldMetadata + { + public string Name { get; set; } + public string DefaultAlias { get; set; } + public bool IsComplex { get; set; } + public bool RequiresParameters { get; set; } + public global::System.Type QueryBuilderType { get; set; } + } + + public enum Formatting + { + None, + Indented + } + + public class GraphQlObjectTypeAttribute : global::System.Attribute + { + public string TypeName { get; } + + public GraphQlObjectTypeAttribute(string typeName) => TypeName = typeName; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + public class QueryBuilderParameterConverter : global::Newtonsoft.Json.JsonConverter + { + public override object ReadJson(JsonReader reader, global::System.Type objectType, object existingValue, JsonSerializer serializer) + { + switch (reader.TokenType) + { + case JsonToken.Null: + return null; + + default: + return (QueryBuilderParameter)(T)serializer.Deserialize(reader, typeof(T)); + } + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + if (value == null) + writer.WriteNull(); + else + serializer.Serialize(writer, ((QueryBuilderParameter)value).Value, typeof(T)); + } + + public override bool CanConvert(global::System.Type objectType) => objectType.IsSubclassOf(typeof(QueryBuilderParameter)); + } + + public class GraphQlInterfaceJsonConverter : global::Newtonsoft.Json.JsonConverter + { + private const string FieldNameType = "__typename"; + + private static readonly Dictionary InterfaceTypeMapping = + typeof(GraphQlInterfaceJsonConverter).Assembly.GetTypes() + .Select(t => new { Type = t, Attribute = t.GetCustomAttribute() }) + .Where(x => x.Attribute != null && x.Type.Namespace == typeof(GraphQlInterfaceJsonConverter).Namespace) + .ToDictionary(x => x.Attribute.TypeName, x => x.Type); + + public override bool CanConvert(global::System.Type objectType) => objectType.IsInterface || objectType.IsArray; + + public override object ReadJson(JsonReader reader, global::System.Type objectType, object existingValue, JsonSerializer serializer) + { + while (reader.TokenType == JsonToken.Comment) + reader.Read(); + + switch (reader.TokenType) + { + case JsonToken.Null: + return null; + + case JsonToken.StartObject: + var jObject = JObject.Load(reader); + if (!jObject.TryGetValue(FieldNameType, out var token) || token.Type != JTokenType.String) + throw CreateJsonReaderException(reader, $"\"{GetType().FullName}\" requires JSON object to contain \"{FieldNameType}\" field with type name"); + + var typeName = token.Value(); + if (!InterfaceTypeMapping.TryGetValue(typeName, out var type)) + throw CreateJsonReaderException(reader, $"type \"{typeName}\" not found"); + + using (reader = CloneReader(jObject, reader)) + return serializer.Deserialize(reader, type); + + case JsonToken.StartArray: + var elementType = GetElementType(objectType); + if (elementType == null) + throw CreateJsonReaderException(reader, $"array element type could not be resolved for type \"{objectType.FullName}\""); + + return ReadArray(reader, objectType, elementType, serializer); + + default: + throw CreateJsonReaderException(reader, $"unrecognized token: {reader.TokenType}"); + } + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) => serializer.Serialize(writer, value); + + private static JsonReader CloneReader(JToken jToken, JsonReader reader) + { + var jObjectReader = jToken.CreateReader(); + jObjectReader.Culture = reader.Culture; + jObjectReader.CloseInput = reader.CloseInput; + jObjectReader.SupportMultipleContent = reader.SupportMultipleContent; + jObjectReader.DateTimeZoneHandling = reader.DateTimeZoneHandling; + jObjectReader.FloatParseHandling = reader.FloatParseHandling; + jObjectReader.DateFormatString = reader.DateFormatString; + jObjectReader.DateParseHandling = reader.DateParseHandling; + return jObjectReader; + } + + private static JsonReaderException CreateJsonReaderException(JsonReader reader, string message) + { + if (reader is IJsonLineInfo lineInfo && lineInfo.HasLineInfo()) + return new JsonReaderException(message, reader.Path, lineInfo.LineNumber, lineInfo.LinePosition, null); + + return new JsonReaderException(message); + } + + private static global::System.Type GetElementType(global::System.Type arrayOrGenericContainer) => + arrayOrGenericContainer.IsArray ? arrayOrGenericContainer.GetElementType() : arrayOrGenericContainer.GenericTypeArguments.FirstOrDefault(); + + private IList ReadArray(JsonReader reader, global::System.Type targetType, global::System.Type elementType, JsonSerializer serializer) + { + var list = CreateCompatibleList(targetType, elementType); + while (reader.Read() && reader.TokenType != JsonToken.EndArray) + list.Add(ReadJson(reader, elementType, null, serializer)); + + if (!targetType.IsArray) + return list; + + var array = Array.CreateInstance(elementType, list.Count); + list.CopyTo(array, 0); + return array; + } + + private static IList CreateCompatibleList(global::System.Type targetContainerType, global::System.Type elementType) => + (IList)Activator.CreateInstance(targetContainerType.IsArray || targetContainerType.IsAbstract ? typeof(List<>).MakeGenericType(elementType) : targetContainerType); + } + #endif + + internal static class GraphQlQueryHelper + { + private static readonly Regex RegexGraphQlIdentifier = new Regex(@"^[_A-Za-z][_0-9A-Za-z]*$", RegexOptions.Compiled); + private static readonly Regex RegexEscapeGraphQlString = new Regex(@"[\\\""/\b\f\n\r\t]", RegexOptions.Compiled); + + public static string GetIndentation(int level, byte indentationSize) + { + return new String(' ', level * indentationSize); + } + + public static string EscapeGraphQlStringValue(string value) + { + return RegexEscapeGraphQlString.Replace(value, m => @$"\{GetEscapeSequence(m.Value)}"); + } + + private static string GetEscapeSequence(string input) + { + switch (input) + { + case "\\": + return "\\"; + case "\"": + return "\""; + case "/": + return "/"; + case "\b": + return "b"; + case "\f": + return "f"; + case "\n": + return "n"; + case "\r": + return "r"; + case "\t": + return "t"; + default: + throw new InvalidOperationException($"invalid character: {input}"); + } + } + + public static string BuildArgumentValue(object value, string formatMask, GraphQlBuilderOptions options, int level) + { + var serializer = options.ArgumentBuilder ?? DefaultGraphQlArgumentBuilder.Instance; + if (serializer.TryBuild(new GraphQlArgumentBuilderContext { Value = value, FormatMask = formatMask, Options = options, Level = level }, out var serializedValue)) + return serializedValue; + + if (value is null) + return "null"; + + var enumerable = value as IEnumerable; + if (!String.IsNullOrEmpty(formatMask) && enumerable == null) + return + value is IFormattable formattable + ? $"\"{EscapeGraphQlStringValue(formattable.ToString(formatMask, CultureInfo.InvariantCulture))}\"" + : throw new ArgumentException($"Value must implement {nameof(IFormattable)} interface to use a format mask. ", nameof(value)); + + if (value is Enum @enum) + return ConvertEnumToString(@enum); + + if (value is bool @bool) + return @bool ? "true" : "false"; + + if (value is DateTime dateTime) + return $"\"{dateTime.ToString("O")}\""; + + if (value is DateTimeOffset dateTimeOffset) + return $"\"{dateTimeOffset.ToString("O")}\""; + + if (value is IGraphQlInputObject inputObject) + return BuildInputObject(inputObject, options, level + 2); + + if (value is Guid) + return $"\"{value}\""; + + if (value is String @string) + return $"\"{EscapeGraphQlStringValue(@string)}\""; + + if (enumerable != null) + return BuildEnumerableArgument(enumerable, formatMask, options, level, '[', ']'); + + if (value is short || value is ushort || value is byte || value is int || value is uint || value is long || value is ulong || value is float || value is double || value is decimal) + return Convert.ToString(value, CultureInfo.InvariantCulture); + + var argumentValue = EscapeGraphQlStringValue(Convert.ToString(value, CultureInfo.InvariantCulture)); + return $"\"{argumentValue}\""; + } + + public static string BuildEnumerableArgument(IEnumerable enumerable, string formatMask, GraphQlBuilderOptions options, int level, char openingSymbol, char closingSymbol) + { + var builder = new StringBuilder(); + builder.Append(openingSymbol); + var delimiter = String.Empty; + foreach (var item in enumerable) + { + builder.Append(delimiter); + + if (options.Formatting == Formatting.Indented) + { + builder.AppendLine(); + builder.Append(GetIndentation(level + 1, options.IndentationSize)); + } + + builder.Append(BuildArgumentValue(item, formatMask, options, level)); + delimiter = ","; + } + + builder.Append(closingSymbol); + return builder.ToString(); + } + + public static string BuildInputObject(IGraphQlInputObject inputObject, GraphQlBuilderOptions options, int level) + { + var builder = new StringBuilder(); + builder.Append("{"); + + var isIndentedFormatting = options.Formatting == Formatting.Indented; + string valueSeparator; + if (isIndentedFormatting) + { + builder.AppendLine(); + valueSeparator = ": "; + } + else + valueSeparator = ":"; + + var separator = String.Empty; + foreach (var propertyValue in inputObject.GetPropertyValues()) + { + var queryBuilderParameter = propertyValue.Value as QueryBuilderParameter; + var value = + queryBuilderParameter?.Name != null + ? $"${queryBuilderParameter.Name}" + : BuildArgumentValue(queryBuilderParameter == null ? propertyValue.Value : queryBuilderParameter.Value, propertyValue.FormatMask, options, level); + + builder.Append(isIndentedFormatting ? GetIndentation(level, options.IndentationSize) : separator); + builder.Append(propertyValue.Name); + builder.Append(valueSeparator); + builder.Append(value); + + separator = ","; + + if (isIndentedFormatting) + builder.AppendLine(); + } + + if (isIndentedFormatting) + builder.Append(GetIndentation(level - 1, options.IndentationSize)); + + builder.Append("}"); + + return builder.ToString(); + } + + public static string BuildDirective(GraphQlDirective directive, GraphQlBuilderOptions options, int level) + { + if (directive == null) + return String.Empty; + + var isIndentedFormatting = options.Formatting == Formatting.Indented; + var indentationSpace = isIndentedFormatting ? " " : String.Empty; + var builder = new StringBuilder(); + builder.Append(indentationSpace); + builder.Append("@"); + builder.Append(directive.Name); + builder.Append("("); + + string separator = null; + foreach (var kvp in directive.Arguments) + { + var argumentName = kvp.Key; + var argument = kvp.Value; + + builder.Append(separator); + builder.Append(argumentName); + builder.Append(":"); + builder.Append(indentationSpace); + + if (argument.Name == null) + builder.Append(BuildArgumentValue(argument.Value, null, options, level)); + else + { + builder.Append("$"); + builder.Append(argument.Name); + } + + separator = isIndentedFormatting ? ", " : ","; + } + + builder.Append(")"); + return builder.ToString(); + } + + public static void ValidateGraphQlIdentifier(string name, string identifier) + { + if (identifier != null && !RegexGraphQlIdentifier.IsMatch(identifier)) + throw new ArgumentException("value must match " + RegexGraphQlIdentifier, name); + } + + private static string ConvertEnumToString(Enum @enum) + { + var enumMember = @enum.GetType().GetField(@enum.ToString()); + if (enumMember == null) + throw new InvalidOperationException("enum member resolution failed"); + + var enumMemberAttribute = (EnumMemberAttribute)enumMember.GetCustomAttribute(typeof(EnumMemberAttribute)); + + return enumMemberAttribute == null + ? @enum.ToString() + : enumMemberAttribute.Value; + } + } + + public interface IGraphQlArgumentBuilder + { + bool TryBuild(GraphQlArgumentBuilderContext context, out string graphQlString); + } + + public class GraphQlArgumentBuilderContext + { + public object Value { get; set; } + public string FormatMask { get; set; } + public GraphQlBuilderOptions Options { get; set; } + public int Level { get; set; } + } + + public class DefaultGraphQlArgumentBuilder : IGraphQlArgumentBuilder + { + private static readonly Regex RegexWhiteSpace = new Regex(@"\s", RegexOptions.Compiled); + + public static readonly DefaultGraphQlArgumentBuilder Instance = new(); + + public bool TryBuild(GraphQlArgumentBuilderContext context, out string graphQlString) + { + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + if (context.Value is JValue jValue) + { + switch (jValue.Type) + { + case JTokenType.Null: + graphQlString = "null"; + return true; + + case JTokenType.Integer: + case JTokenType.Float: + case JTokenType.Boolean: + graphQlString = GraphQlQueryHelper.BuildArgumentValue(jValue.Value, null, context.Options, context.Level); + return true; + + case JTokenType.String: + graphQlString = $"\"{GraphQlQueryHelper.EscapeGraphQlStringValue((string)jValue.Value)}\""; + return true; + + default: + graphQlString = $"\"{jValue.Value}\""; + return true; + } + } + + if (context.Value is JProperty jProperty) + { + if (RegexWhiteSpace.IsMatch(jProperty.Name)) + throw new ArgumentException($"JSON object keys used as GraphQL arguments must not contain whitespace; key: {jProperty.Name}"); + + graphQlString = $"{jProperty.Name}:{(context.Options.Formatting == Formatting.Indented ? " " : null)}{GraphQlQueryHelper.BuildArgumentValue(jProperty.Value, null, context.Options, context.Level)}"; + return true; + } + + if (context.Value is JObject jObject) + { + graphQlString = GraphQlQueryHelper.BuildEnumerableArgument(jObject, null, context.Options, context.Level + 1, '{', '}'); + return true; + } + #endif + + graphQlString = null; + return false; + } + } + + internal struct InputPropertyInfo + { + public string Name { get; set; } + public object Value { get; set; } + public string FormatMask { get; set; } + } + + internal interface IGraphQlInputObject + { + IEnumerable GetPropertyValues(); + } + + public interface IGraphQlQueryBuilder + { + void Clear(); + void IncludeAllFields(); + string Build(Formatting formatting = Formatting.None, byte indentationSize = 2); + } + + public struct QueryBuilderArgumentInfo + { + public string ArgumentName { get; set; } + public QueryBuilderParameter ArgumentValue { get; set; } + public string FormatMask { get; set; } + } + + public abstract class QueryBuilderParameter + { + private string _name; + + internal string GraphQlTypeName { get; } + internal object Value { get; set; } + + public string Name + { + get => _name; + set + { + GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(Name), value); + _name = value; + } + } + + protected QueryBuilderParameter(string name, string graphQlTypeName, object value) + { + Name = name?.Trim(); + GraphQlTypeName = graphQlTypeName?.Replace(" ", null).Replace("\t", null).Replace("\n", null).Replace("\r", null); + Value = value; + } + + protected QueryBuilderParameter(object value) => Value = value; + } + + public class QueryBuilderParameter : QueryBuilderParameter + { + public new T Value + { + get => base.Value == null ? default : (T)base.Value; + set => base.Value = value; + } + + protected QueryBuilderParameter(string name, string graphQlTypeName, T value) : base(name, graphQlTypeName, value) + { + EnsureGraphQlTypeName(graphQlTypeName); + } + + protected QueryBuilderParameter(string name, string graphQlTypeName) : base(name, graphQlTypeName, null) + { + EnsureGraphQlTypeName(graphQlTypeName); + } + + private QueryBuilderParameter(T value) : base(value) + { + } + + public void ResetValue() => base.Value = null; + + public static implicit operator QueryBuilderParameter(T value) => new QueryBuilderParameter(value); + + public static implicit operator T(QueryBuilderParameter parameter) => parameter.Value; + + private static void EnsureGraphQlTypeName(string graphQlTypeName) + { + if (String.IsNullOrWhiteSpace(graphQlTypeName)) + throw new ArgumentException("value required", nameof(graphQlTypeName)); + } + } + + public class GraphQlQueryParameter : QueryBuilderParameter + { + private string _formatMask; + + public string FormatMask + { + get => _formatMask; + set => _formatMask = + typeof(IFormattable).IsAssignableFrom(typeof(T)) + ? value + : throw new InvalidOperationException($"Value must be of {nameof(IFormattable)} type. "); + } + + public GraphQlQueryParameter(string name, string graphQlTypeName = null) + : base(name, graphQlTypeName ?? GetGraphQlTypeName(typeof(T))) + { + } + + public GraphQlQueryParameter(string name, string graphQlTypeName, T defaultValue) + : base(name, graphQlTypeName, defaultValue) + { + } + + public GraphQlQueryParameter(string name, T defaultValue, bool isNullable = true) + : base(name, GetGraphQlTypeName(typeof(T), isNullable), defaultValue) + { + } + + private static string GetGraphQlTypeName(global::System.Type valueType, bool isNullable) + { + var graphQlTypeName = GetGraphQlTypeName(valueType); + if (!isNullable) + graphQlTypeName += "!"; + + return graphQlTypeName; + } + + private static string GetGraphQlTypeName(global::System.Type valueType) + { + var nullableUnderlyingType = Nullable.GetUnderlyingType(valueType); + valueType = nullableUnderlyingType ?? valueType; + + if (valueType.IsArray) + { + var arrayItemType = GetGraphQlTypeName(valueType.GetElementType()); + return arrayItemType == null ? null : "[" + arrayItemType + "]"; + } + + if (typeof(IEnumerable).IsAssignableFrom(valueType)) + { + var genericArguments = valueType.GetGenericArguments(); + if (genericArguments.Length == 1) + { + var listItemType = GetGraphQlTypeName(valueType.GetGenericArguments()[0]); + return listItemType == null ? null : "[" + listItemType + "]"; + } + } + + if (GraphQlTypes.ReverseMapping.TryGetValue(valueType, out var graphQlTypeName)) + return graphQlTypeName; + + if (valueType == typeof(string)) + return "String"; + + var nullableSuffix = nullableUnderlyingType == null ? null : "?"; + graphQlTypeName = GetValueTypeGraphQlTypeName(valueType); + return graphQlTypeName == null ? null : graphQlTypeName + nullableSuffix; + } + + private static string GetValueTypeGraphQlTypeName(global::System.Type valueType) + { + if (valueType == typeof(bool)) + return "Boolean"; + + if (valueType == typeof(float) || valueType == typeof(double) || valueType == typeof(decimal)) + return "Float"; + + if (valueType == typeof(Guid)) + return "ID"; + + if (valueType == typeof(sbyte) || valueType == typeof(byte) || valueType == typeof(short) || valueType == typeof(ushort) || valueType == typeof(int) || valueType == typeof(uint) || + valueType == typeof(long) || valueType == typeof(ulong)) + return "Int"; + + return null; + } + } + + public abstract class GraphQlDirective + { + private readonly Dictionary _arguments = new Dictionary(); + + internal IEnumerable> Arguments => _arguments; + + public string Name { get; } + + protected GraphQlDirective(string name) + { + GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(name), name); + Name = name; + } + + protected void AddArgument(string name, QueryBuilderParameter value) + { + if (value != null) + _arguments[name] = value; + } + } + + public class GraphQlBuilderOptions + { + public Formatting Formatting { get; set; } + public byte IndentationSize { get; set; } = 2; + public IGraphQlArgumentBuilder ArgumentBuilder { get; set; } + } + + public abstract partial class GraphQlQueryBuilder : IGraphQlQueryBuilder + { + private readonly Dictionary _fieldCriteria = new Dictionary(); + + private readonly string _operationType; + private readonly string _operationName; + private Dictionary _fragments; + private List _queryParameters; + + protected abstract string TypeName { get; } + + public abstract IReadOnlyList AllFields { get; } + + protected GraphQlQueryBuilder(string operationType, string operationName) + { + GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(operationName), operationName); + _operationType = operationType; + _operationName = operationName; + } + + public virtual void Clear() + { + _fieldCriteria.Clear(); + _fragments?.Clear(); + _queryParameters?.Clear(); + } + + void IGraphQlQueryBuilder.IncludeAllFields() + { + IncludeAllFields(); + } + + public string Build(Formatting formatting = Formatting.None, byte indentationSize = 2) + { + return Build(new GraphQlBuilderOptions { Formatting = formatting, IndentationSize = indentationSize }); + } + + public string Build(GraphQlBuilderOptions options) + { + return Build(options, 1); + } + + protected void IncludeAllFields() + { + IncludeFields(AllFields.Where(f => !f.RequiresParameters)); + } + + protected virtual string Build(GraphQlBuilderOptions options, int level) + { + var isIndentedFormatting = options.Formatting == Formatting.Indented; + var separator = String.Empty; + var indentationSpace = isIndentedFormatting ? " " : String.Empty; + var builder = new StringBuilder(); + + BuildOperationSignature(builder, options, indentationSpace, level); + + if (builder.Length > 0 || level > 1) + builder.Append(indentationSpace); + + builder.Append("{"); + + if (isIndentedFormatting) + builder.AppendLine(); + + separator = String.Empty; + + foreach (var criteria in _fieldCriteria.Values.Concat(_fragments?.Values ?? Enumerable.Empty())) + { + var fieldCriteria = criteria.Build(options, level); + if (isIndentedFormatting) + builder.AppendLine(fieldCriteria); + else if (!String.IsNullOrEmpty(fieldCriteria)) + { + builder.Append(separator); + builder.Append(fieldCriteria); + } + + separator = ","; + } + + if (isIndentedFormatting) + builder.Append(GraphQlQueryHelper.GetIndentation(level - 1, options.IndentationSize)); + + builder.Append("}"); + + return builder.ToString(); + } + + private void BuildOperationSignature(StringBuilder builder, GraphQlBuilderOptions options, string indentationSpace, int level) + { + if (String.IsNullOrEmpty(_operationType)) + return; + + builder.Append(_operationType); + + if (!String.IsNullOrEmpty(_operationName)) + { + builder.Append(" "); + builder.Append(_operationName); + } + + if (_queryParameters?.Count > 0) + { + builder.Append(indentationSpace); + builder.Append("("); + + var separator = String.Empty; + var isIndentedFormatting = options.Formatting == Formatting.Indented; + + foreach (var queryParameterInfo in _queryParameters) + { + if (isIndentedFormatting) + { + builder.AppendLine(separator); + builder.Append(GraphQlQueryHelper.GetIndentation(level, options.IndentationSize)); + } + else + builder.Append(separator); + + builder.Append("$"); + builder.Append(queryParameterInfo.ArgumentValue.Name); + builder.Append(":"); + builder.Append(indentationSpace); + + builder.Append(queryParameterInfo.ArgumentValue.GraphQlTypeName); + + if (!queryParameterInfo.ArgumentValue.GraphQlTypeName.EndsWith("!") && queryParameterInfo.ArgumentValue.Value is not null) + { + builder.Append(indentationSpace); + builder.Append("="); + builder.Append(indentationSpace); + builder.Append(GraphQlQueryHelper.BuildArgumentValue(queryParameterInfo.ArgumentValue.Value, queryParameterInfo.FormatMask, options, 0)); + } + + if (!isIndentedFormatting) + separator = ","; + } + + builder.Append(")"); + } + } + + protected void IncludeScalarField(string fieldName, string alias, IList args, GraphQlDirective[] directives) + { + _fieldCriteria[alias ?? fieldName] = new GraphQlScalarFieldCriteria(fieldName, alias, args, directives); + } + + protected void IncludeObjectField(string fieldName, string alias, GraphQlQueryBuilder objectFieldQueryBuilder, IList args, GraphQlDirective[] directives) + { + _fieldCriteria[alias ?? fieldName] = new GraphQlObjectFieldCriteria(fieldName, alias, objectFieldQueryBuilder, args, directives); + } + + protected void IncludeFragment(GraphQlQueryBuilder objectFieldQueryBuilder, GraphQlDirective[] directives) + { + _fragments = _fragments ?? new Dictionary(); + _fragments[objectFieldQueryBuilder.TypeName] = new GraphQlFragmentCriteria(objectFieldQueryBuilder, directives); + } + + protected void ExcludeField(string fieldName) + { + if (fieldName == null) + throw new ArgumentNullException(nameof(fieldName)); + + _fieldCriteria.Remove(fieldName); + } + + protected void IncludeFields(IEnumerable fields) + { + IncludeFields(fields, 0, new Dictionary()); + } + + private void IncludeFields(IEnumerable fields, int level, Dictionary parentTypeLevel) + { + global::System.Type builderType = null; + + foreach (var field in fields) + { + if (field.QueryBuilderType == null) + IncludeScalarField(field.Name, field.DefaultAlias, null, null); + else + { + if (_operationType != null && GetType() == field.QueryBuilderType || + parentTypeLevel.TryGetValue(field.QueryBuilderType, out var parentLevel) && parentLevel < level) + continue; + + if (builderType is null) + { + builderType = GetType(); + parentLevel = parentTypeLevel.TryGetValue(builderType, out parentLevel) ? parentLevel : level; + parentTypeLevel[builderType] = Math.Min(level, parentLevel); + } + + var queryBuilder = InitializeChildQueryBuilder(builderType, field.QueryBuilderType, level, parentTypeLevel); + + var includeFragmentMethods = field.QueryBuilderType.GetMethods().Where(IsIncludeFragmentMethod); + + foreach (var includeFragmentMethod in includeFragmentMethods) + includeFragmentMethod.Invoke( + queryBuilder, + new object[] { InitializeChildQueryBuilder(builderType, includeFragmentMethod.GetParameters()[0].ParameterType, level, parentTypeLevel) }); + + if (queryBuilder._fieldCriteria.Count > 0 || queryBuilder._fragments != null) + IncludeObjectField(field.Name, field.DefaultAlias, queryBuilder, null, null); + } + } + } + + private static GraphQlQueryBuilder InitializeChildQueryBuilder(global::System.Type parentQueryBuilderType, global::System.Type queryBuilderType, int level, Dictionary parentTypeLevel) + { + var queryBuilder = (GraphQlQueryBuilder)Activator.CreateInstance(queryBuilderType); + queryBuilder.IncludeFields( + queryBuilder.AllFields.Where(f => !f.RequiresParameters), + level + 1, + parentTypeLevel); + + return queryBuilder; + } + + private static bool IsIncludeFragmentMethod(MethodInfo methodInfo) + { + if (!methodInfo.Name.StartsWith("With") || !methodInfo.Name.EndsWith("Fragment")) + return false; + + var parameters = methodInfo.GetParameters(); + return parameters.Length == 1 && parameters[0].ParameterType.IsSubclassOf(typeof(GraphQlQueryBuilder)); + } + + protected void AddParameter(GraphQlQueryParameter parameter) + { + if (_queryParameters == null) + _queryParameters = new List(); + + _queryParameters.Add(new QueryBuilderArgumentInfo { ArgumentValue = parameter, FormatMask = parameter.FormatMask }); + } + + private abstract class GraphQlFieldCriteria + { + private readonly IList _args; + private readonly GraphQlDirective[] _directives; + + protected readonly string FieldName; + protected readonly string Alias; + + protected static string GetIndentation(Formatting formatting, int level, byte indentationSize) => + formatting == Formatting.Indented ? GraphQlQueryHelper.GetIndentation(level, indentationSize) : null; + + protected GraphQlFieldCriteria(string fieldName, string alias, IList args, GraphQlDirective[] directives) + { + GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(alias), alias); + FieldName = fieldName; + Alias = alias; + _args = args; + _directives = directives; + } + + public abstract string Build(GraphQlBuilderOptions options, int level); + + protected string BuildArgumentClause(GraphQlBuilderOptions options, int level) + { + var separator = options.Formatting == Formatting.Indented ? " " : null; + var argumentCount = _args?.Count ?? 0; + if (argumentCount == 0) + return String.Empty; + + var arguments = + _args.Select( + a => $"{a.ArgumentName}:{separator}{(a.ArgumentValue.Name == null ? GraphQlQueryHelper.BuildArgumentValue(a.ArgumentValue.Value, a.FormatMask, options, level) : $"${a.ArgumentValue.Name}")}"); + + return $"({String.Join($",{separator}", arguments)})"; + } + + protected string BuildDirectiveClause(GraphQlBuilderOptions options, int level) => + _directives == null ? null : String.Concat(_directives.Select(d => d == null ? null : GraphQlQueryHelper.BuildDirective(d, options, level))); + + protected static string BuildAliasPrefix(string alias, Formatting formatting) + { + var separator = formatting == Formatting.Indented ? " " : String.Empty; + return String.IsNullOrWhiteSpace(alias) ? null : $"{alias}:{separator}"; + } + } + + private class GraphQlScalarFieldCriteria : GraphQlFieldCriteria + { + public GraphQlScalarFieldCriteria(string fieldName, string alias, IList args, GraphQlDirective[] directives) + : base(fieldName, alias, args, directives) + { + } + + public override string Build(GraphQlBuilderOptions options, int level) => + GetIndentation(options.Formatting, level, options.IndentationSize) + + BuildAliasPrefix(Alias, options.Formatting) + + FieldName + + BuildArgumentClause(options, level) + + BuildDirectiveClause(options, level); + } + + private class GraphQlObjectFieldCriteria : GraphQlFieldCriteria + { + private readonly GraphQlQueryBuilder _objectQueryBuilder; + + public GraphQlObjectFieldCriteria(string fieldName, string alias, GraphQlQueryBuilder objectQueryBuilder, IList args, GraphQlDirective[] directives) + : base(fieldName, alias, args, directives) + { + _objectQueryBuilder = objectQueryBuilder; + } + + public override string Build(GraphQlBuilderOptions options, int level) => + _objectQueryBuilder._fieldCriteria.Count > 0 || _objectQueryBuilder._fragments?.Count > 0 + ? GetIndentation(options.Formatting, level, options.IndentationSize) + BuildAliasPrefix(Alias, options.Formatting) + FieldName + + BuildArgumentClause(options, level) + BuildDirectiveClause(options, level) + _objectQueryBuilder.Build(options, level + 1) + : null; + } + + private class GraphQlFragmentCriteria : GraphQlFieldCriteria + { + private readonly GraphQlQueryBuilder _objectQueryBuilder; + + public GraphQlFragmentCriteria(GraphQlQueryBuilder objectQueryBuilder, GraphQlDirective[] directives) : base(objectQueryBuilder.TypeName, null, null, directives) + { + _objectQueryBuilder = objectQueryBuilder; + } + + public override string Build(GraphQlBuilderOptions options, int level) => + _objectQueryBuilder._fieldCriteria.Count == 0 + ? null + : GetIndentation(options.Formatting, level, options.IndentationSize) + "..." + (options.Formatting == Formatting.Indented ? " " : null) + "on " + + FieldName + BuildArgumentClause(options, level) + BuildDirectiveClause(options, level) + _objectQueryBuilder.Build(options, level + 1); + } + } + + public abstract partial class GraphQlQueryBuilder : GraphQlQueryBuilder where TQueryBuilder : GraphQlQueryBuilder + { + protected GraphQlQueryBuilder(string operationType = null, string operationName = null) : base(operationType, operationName) + { + } + + /// + /// Includes all fields that don't require parameters into the query. + /// + public TQueryBuilder WithAllFields() + { + IncludeAllFields(); + return (TQueryBuilder)this; + } + + /// + /// Includes all scalar fields that don't require parameters into the query. + /// + public TQueryBuilder WithAllScalarFields() + { + IncludeFields(AllFields.Where(f => !f.IsComplex && !f.RequiresParameters)); + return (TQueryBuilder)this; + } + + public TQueryBuilder ExceptField(string fieldName) + { + ExcludeField(fieldName); + return (TQueryBuilder)this; + } + + /// + /// Includes "__typename" field; included automatically for interface and union types. + /// + public TQueryBuilder WithTypeName(string alias = null, params GraphQlDirective[] directives) + { + IncludeScalarField("__typename", alias, null, directives); + return (TQueryBuilder)this; + } + + protected TQueryBuilder WithScalarField(string fieldName, string alias, GraphQlDirective[] directives, IList args = null) + { + IncludeScalarField(fieldName, alias, args, directives); + return (TQueryBuilder)this; + } + + protected TQueryBuilder WithObjectField(string fieldName, string alias, GraphQlQueryBuilder queryBuilder, GraphQlDirective[] directives, IList args = null) + { + IncludeObjectField(fieldName, alias, queryBuilder, args, directives); + return (TQueryBuilder)this; + } + + protected TQueryBuilder WithFragment(GraphQlQueryBuilder queryBuilder, GraphQlDirective[] directives) + { + IncludeFragment(queryBuilder, directives); + return (TQueryBuilder)this; + } + + protected TQueryBuilder WithParameterInternal(GraphQlQueryParameter parameter) + { + AddParameter(parameter); + return (TQueryBuilder)this; + } + } + + public abstract class GraphQlResponse + { + public TDataContract Data { get; set; } + public ICollection Errors { get; set; } + } + + public class GraphQlQueryError + { + public string Message { get; set; } + public ICollection Locations { get; set; } + } + + public class GraphQlErrorLocation + { + public int Line { get; set; } + public int Column { get; set; } + } + #endregion + + #region GraphQL type helpers + public static class GraphQlTypes + { + public const string Boolean = "Boolean"; + public const string DateTime = "DateTime"; + public const string EmailAddress = "EmailAddress"; + public const string Id = "ID"; + public const string Int = "Int"; + public const string String = "String"; + public const string Uuid = "UUID"; + + public const string UserRole = "UserRole"; + + public const string AuthenticationError = "AuthenticationError"; + public const string Checkpoint = "Checkpoint"; + public const string LiveDoc = "LiveDoc"; + public const string LiveDocPullBulk = "LiveDocPullBulk"; + public const string Mutation = "Mutation"; + public const string PushLiveDocPayload = "PushLiveDocPayload"; + public const string PushUserPayload = "PushUserPayload"; + public const string PushWorkspacePayload = "PushWorkspacePayload"; + public const string Query = "Query"; + public const string Subscription = "Subscription"; + public const string UnauthorizedAccessError = "UnauthorizedAccessError"; + public const string User = "User"; + public const string UserPullBulk = "UserPullBulk"; + public const string Workspace = "Workspace"; + public const string WorkspacePullBulk = "WorkspacePullBulk"; + + public const string BooleanOperationFilterInput = "BooleanOperationFilterInput"; + public const string DateTimeOperationFilterInput = "DateTimeOperationFilterInput"; + public const string ListStringOperationFilterInput = "ListStringOperationFilterInput"; + public const string LiveDocFilterInput = "LiveDocFilterInput"; + public const string LiveDocInput = "LiveDocInput"; + public const string LiveDocInputCheckpoint = "LiveDocInputCheckpoint"; + public const string LiveDocInputHeaders = "LiveDocInputHeaders"; + public const string LiveDocInputPushRow = "LiveDocInputPushRow"; + public const string PushLiveDocInput = "PushLiveDocInput"; + public const string PushUserInput = "PushUserInput"; + public const string PushWorkspaceInput = "PushWorkspaceInput"; + public const string StringOperationFilterInput = "StringOperationFilterInput"; + public const string UserFilterInput = "UserFilterInput"; + public const string UserInput = "UserInput"; + public const string UserInputCheckpoint = "UserInputCheckpoint"; + public const string UserInputHeaders = "UserInputHeaders"; + public const string UserInputPushRow = "UserInputPushRow"; + public const string UserRoleOperationFilterInput = "UserRoleOperationFilterInput"; + public const string UuidOperationFilterInput = "UuidOperationFilterInput"; + public const string WorkspaceFilterInput = "WorkspaceFilterInput"; + public const string WorkspaceInput = "WorkspaceInput"; + public const string WorkspaceInputCheckpoint = "WorkspaceInputCheckpoint"; + public const string WorkspaceInputHeaders = "WorkspaceInputHeaders"; + public const string WorkspaceInputPushRow = "WorkspaceInputPushRow"; + + public const string PushLiveDocError = "PushLiveDocError"; + public const string PushUserError = "PushUserError"; + public const string PushWorkspaceError = "PushWorkspaceError"; + + public const string Error = "Error"; + + public static readonly IReadOnlyDictionary ReverseMapping = + new Dictionary + { + { typeof(string), "String" }, + { typeof(Guid), "UUID" }, + { typeof(DateTimeOffset), "DateTime" }, + { typeof(bool), "Boolean" }, + { typeof(BooleanOperationFilterInputGql), "BooleanOperationFilterInput" }, + { typeof(DateTimeOperationFilterInputGql), "DateTimeOperationFilterInput" }, + { typeof(ListStringOperationFilterInputGql), "ListStringOperationFilterInput" }, + { typeof(LiveDocFilterInputGql), "LiveDocFilterInput" }, + { typeof(LiveDocInputGql), "LiveDocInput" }, + { typeof(LiveDocInputCheckpointGql), "LiveDocInputCheckpoint" }, + { typeof(LiveDocInputHeadersGql), "LiveDocInputHeaders" }, + { typeof(LiveDocInputPushRowGql), "LiveDocInputPushRow" }, + { typeof(PushLiveDocInputGql), "PushLiveDocInput" }, + { typeof(PushUserInputGql), "PushUserInput" }, + { typeof(PushWorkspaceInputGql), "PushWorkspaceInput" }, + { typeof(StringOperationFilterInputGql), "StringOperationFilterInput" }, + { typeof(UserFilterInputGql), "UserFilterInput" }, + { typeof(UserInputGql), "UserInput" }, + { typeof(UserInputCheckpointGql), "UserInputCheckpoint" }, + { typeof(UserInputHeadersGql), "UserInputHeaders" }, + { typeof(UserInputPushRowGql), "UserInputPushRow" }, + { typeof(UserRoleOperationFilterInputGql), "UserRoleOperationFilterInput" }, + { typeof(UuidOperationFilterInputGql), "UuidOperationFilterInput" }, + { typeof(WorkspaceFilterInputGql), "WorkspaceFilterInput" }, + { typeof(WorkspaceInputGql), "WorkspaceInput" }, + { typeof(WorkspaceInputCheckpointGql), "WorkspaceInputCheckpoint" }, + { typeof(WorkspaceInputHeadersGql), "WorkspaceInputHeaders" }, + { typeof(WorkspaceInputPushRowGql), "WorkspaceInputPushRow" } + }; +} + #endregion + + #region enums + public enum UserRoleGql + { + StandardUser, + WorkspaceAdmin, + SystemAdmin + } + #endregion + + #nullable enable + #region directives + public class SkipDirective : GraphQlDirective + { + public SkipDirective(QueryBuilderParameter @if) : base("skip") + { + AddArgument("if", @if); + } + } + + public class IncludeDirective : GraphQlDirective + { + public IncludeDirective(QueryBuilderParameter @if) : base("include") + { + AddArgument("if", @if); + } + } + #endregion + + #region builder classes + public partial class UserPullBulkQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(UserQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "UserPullBulk"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public UserPullBulkQueryBuilderGql WithDocuments(UserQueryBuilderGql userQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, userQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public UserPullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); + + public UserPullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public UserPullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); + } + + public partial class WorkspacePullBulkQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(WorkspaceQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "WorkspacePullBulk"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public WorkspacePullBulkQueryBuilderGql WithDocuments(WorkspaceQueryBuilderGql workspaceQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, workspaceQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public WorkspacePullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); + + public WorkspacePullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public WorkspacePullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); + } + + public partial class LiveDocPullBulkQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(LiveDocQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "LiveDocPullBulk"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public LiveDocPullBulkQueryBuilderGql WithDocuments(LiveDocQueryBuilderGql liveDocQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, liveDocQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public LiveDocPullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); + + public LiveDocPullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public LiveDocPullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); + } + + public partial class QueryQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "pullUser", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(UserPullBulkQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "pullWorkspace", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(WorkspacePullBulkQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "pullLiveDoc", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(LiveDocPullBulkQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "Query"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public QueryQueryBuilderGql(string? operationName = null) : base("query", operationName) + { + } + + public QueryQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); + + public QueryQueryBuilderGql WithPullUser(UserPullBulkQueryBuilderGql userPullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (checkpoint != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); + + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); + if (where != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); + + return WithObjectField("pullUser", alias, userPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public QueryQueryBuilderGql ExceptPullUser() => ExceptField("pullUser"); + + public QueryQueryBuilderGql WithPullWorkspace(WorkspacePullBulkQueryBuilderGql workspacePullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (checkpoint != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); + + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); + if (where != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); + + return WithObjectField("pullWorkspace", alias, workspacePullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public QueryQueryBuilderGql ExceptPullWorkspace() => ExceptField("pullWorkspace"); + + public QueryQueryBuilderGql WithPullLiveDoc(LiveDocPullBulkQueryBuilderGql liveDocPullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (checkpoint != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); + + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); + if (where != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); + + return WithObjectField("pullLiveDoc", alias, liveDocPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public QueryQueryBuilderGql ExceptPullLiveDoc() => ExceptField("pullLiveDoc"); + } + + public partial class MutationQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "pushUser", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushUserPayloadQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "pushWorkspace", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushWorkspacePayloadQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "pushLiveDoc", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushLiveDocPayloadQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "Mutation"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public MutationQueryBuilderGql(string? operationName = null) : base("mutation", operationName) + { + } + + public MutationQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); + + public MutationQueryBuilderGql WithPushUser(PushUserPayloadQueryBuilderGql pushUserPayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); + return WithObjectField("pushUser", alias, pushUserPayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public MutationQueryBuilderGql ExceptPushUser() => ExceptField("pushUser"); + + public MutationQueryBuilderGql WithPushWorkspace(PushWorkspacePayloadQueryBuilderGql pushWorkspacePayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); + return WithObjectField("pushWorkspace", alias, pushWorkspacePayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public MutationQueryBuilderGql ExceptPushWorkspace() => ExceptField("pushWorkspace"); + + public MutationQueryBuilderGql WithPushLiveDoc(PushLiveDocPayloadQueryBuilderGql pushLiveDocPayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); + return WithObjectField("pushLiveDoc", alias, pushLiveDocPayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public MutationQueryBuilderGql ExceptPushLiveDoc() => ExceptField("pushLiveDoc"); + } + + public partial class SubscriptionQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "streamUser", IsComplex = true, QueryBuilderType = typeof(UserPullBulkQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "streamWorkspace", IsComplex = true, QueryBuilderType = typeof(WorkspacePullBulkQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "streamLiveDoc", IsComplex = true, QueryBuilderType = typeof(LiveDocPullBulkQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "Subscription"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public SubscriptionQueryBuilderGql(string? operationName = null) : base("subscription", operationName) + { + } + + public SubscriptionQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); + + public SubscriptionQueryBuilderGql WithStreamUser(UserPullBulkQueryBuilderGql userPullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (headers != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); + + if (topics != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); + + return WithObjectField("streamUser", alias, userPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public SubscriptionQueryBuilderGql ExceptStreamUser() => ExceptField("streamUser"); + + public SubscriptionQueryBuilderGql WithStreamWorkspace(WorkspacePullBulkQueryBuilderGql workspacePullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (headers != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); + + if (topics != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); + + return WithObjectField("streamWorkspace", alias, workspacePullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public SubscriptionQueryBuilderGql ExceptStreamWorkspace() => ExceptField("streamWorkspace"); + + public SubscriptionQueryBuilderGql WithStreamLiveDoc(LiveDocPullBulkQueryBuilderGql liveDocPullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (headers != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); + + if (topics != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); + + return WithObjectField("streamLiveDoc", alias, liveDocPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public SubscriptionQueryBuilderGql ExceptStreamLiveDoc() => ExceptField("streamLiveDoc"); + } + + public partial class UserQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "firstName" }, + new GraphQlFieldMetadata { Name = "lastName" }, + new GraphQlFieldMetadata { Name = "fullName" }, + new GraphQlFieldMetadata { Name = "email" }, + new GraphQlFieldMetadata { Name = "role" }, + new GraphQlFieldMetadata { Name = "jwtAccessToken" }, + new GraphQlFieldMetadata { Name = "workspaceId" }, + new GraphQlFieldMetadata { Name = "id" }, + new GraphQlFieldMetadata { Name = "isDeleted" }, + new GraphQlFieldMetadata { Name = "updatedAt" }, + new GraphQlFieldMetadata { Name = "topics", IsComplex = true } + }; + + protected override string TypeName { get; } = "User"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public UserQueryBuilderGql WithFirstName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("firstName", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptFirstName() => ExceptField("firstName"); + + public UserQueryBuilderGql WithLastName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("lastName", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptLastName() => ExceptField("lastName"); + + public UserQueryBuilderGql WithFullName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("fullName", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptFullName() => ExceptField("fullName"); + + public UserQueryBuilderGql WithEmail(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("email", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptEmail() => ExceptField("email"); + + public UserQueryBuilderGql WithRole(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("role", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptRole() => ExceptField("role"); + + public UserQueryBuilderGql WithJwtAccessToken(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("jwtAccessToken", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptJwtAccessToken() => ExceptField("jwtAccessToken"); + + public UserQueryBuilderGql WithWorkspaceId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("workspaceId", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptWorkspaceId() => ExceptField("workspaceId"); + + public UserQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptId() => ExceptField("id"); + + public UserQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); + + public UserQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); + + public UserQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptTopics() => ExceptField("topics"); + } + + public partial class CheckpointQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "lastDocumentId" }, + new GraphQlFieldMetadata { Name = "updatedAt" } + }; + + protected override string TypeName { get; } = "Checkpoint"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public CheckpointQueryBuilderGql WithLastDocumentId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("lastDocumentId", alias, new GraphQlDirective?[] { skip, include }); + + public CheckpointQueryBuilderGql ExceptLastDocumentId() => ExceptField("lastDocumentId"); + + public CheckpointQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); + + public CheckpointQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); + } + + public partial class AuthenticationErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "message" } + }; + + protected override string TypeName { get; } = "AuthenticationError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public AuthenticationErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); + + public AuthenticationErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); + } + + public partial class UnauthorizedAccessErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "message" } + }; + + protected override string TypeName { get; } = "UnauthorizedAccessError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public UnauthorizedAccessErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); + + public UnauthorizedAccessErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); + } + + public partial class WorkspaceQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "name" }, + new GraphQlFieldMetadata { Name = "id" }, + new GraphQlFieldMetadata { Name = "isDeleted" }, + new GraphQlFieldMetadata { Name = "updatedAt" }, + new GraphQlFieldMetadata { Name = "topics", IsComplex = true } + }; + + protected override string TypeName { get; } = "Workspace"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public WorkspaceQueryBuilderGql WithName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("name", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptName() => ExceptField("name"); + + public WorkspaceQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptId() => ExceptField("id"); + + public WorkspaceQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); + + public WorkspaceQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); + + public WorkspaceQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptTopics() => ExceptField("topics"); + } + + public partial class LiveDocQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "content" }, + new GraphQlFieldMetadata { Name = "ownerId" }, + new GraphQlFieldMetadata { Name = "workspaceId" }, + new GraphQlFieldMetadata { Name = "id" }, + new GraphQlFieldMetadata { Name = "isDeleted" }, + new GraphQlFieldMetadata { Name = "updatedAt" }, + new GraphQlFieldMetadata { Name = "topics", IsComplex = true } + }; + + protected override string TypeName { get; } = "LiveDoc"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public LiveDocQueryBuilderGql WithContent(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("content", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptContent() => ExceptField("content"); + + public LiveDocQueryBuilderGql WithOwnerId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("ownerId", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptOwnerId() => ExceptField("ownerId"); + + public LiveDocQueryBuilderGql WithWorkspaceId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("workspaceId", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptWorkspaceId() => ExceptField("workspaceId"); + + public LiveDocQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptId() => ExceptField("id"); + + public LiveDocQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); + + public LiveDocQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); + + public LiveDocQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptTopics() => ExceptField("topics"); + } + + public partial class ErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "message" } + }; + + public ErrorQueryBuilderGql() => WithTypeName(); + + protected override string TypeName { get; } = "Error"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public ErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); + + public ErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); + + public ErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public ErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + } + + public partial class PushUserErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); + + public PushUserErrorQueryBuilderGql() => WithTypeName(); + + protected override string TypeName { get; } = "PushUserError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushUserErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushUserErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + } + + public partial class PushUserPayloadQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "user", IsComplex = true, QueryBuilderType = typeof(UserQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushUserErrorQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "PushUserPayload"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushUserPayloadQueryBuilderGql WithUser(UserQueryBuilderGql userQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("user", alias, userQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushUserPayloadQueryBuilderGql ExceptUser() => ExceptField("user"); + + public PushUserPayloadQueryBuilderGql WithErrors(PushUserErrorQueryBuilderGql pushUserErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushUserErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushUserPayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); + } + + public partial class PushWorkspaceErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); + + public PushWorkspaceErrorQueryBuilderGql() => WithTypeName(); + + protected override string TypeName { get; } = "PushWorkspaceError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushWorkspaceErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushWorkspaceErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + } + + public partial class PushWorkspacePayloadQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "workspace", IsComplex = true, QueryBuilderType = typeof(WorkspaceQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushWorkspaceErrorQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "PushWorkspacePayload"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushWorkspacePayloadQueryBuilderGql WithWorkspace(WorkspaceQueryBuilderGql workspaceQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("workspace", alias, workspaceQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushWorkspacePayloadQueryBuilderGql ExceptWorkspace() => ExceptField("workspace"); + + public PushWorkspacePayloadQueryBuilderGql WithErrors(PushWorkspaceErrorQueryBuilderGql pushWorkspaceErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushWorkspaceErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushWorkspacePayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); + } + + public partial class PushLiveDocErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); + + public PushLiveDocErrorQueryBuilderGql() => WithTypeName(); + + protected override string TypeName { get; } = "PushLiveDocError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushLiveDocErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushLiveDocErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + } + + public partial class PushLiveDocPayloadQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "liveDoc", IsComplex = true, QueryBuilderType = typeof(LiveDocQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushLiveDocErrorQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "PushLiveDocPayload"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushLiveDocPayloadQueryBuilderGql WithLiveDoc(LiveDocQueryBuilderGql liveDocQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("liveDoc", alias, liveDocQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushLiveDocPayloadQueryBuilderGql ExceptLiveDoc() => ExceptField("liveDoc"); + + public PushLiveDocPayloadQueryBuilderGql WithErrors(PushLiveDocErrorQueryBuilderGql pushLiveDocErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushLiveDocErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushLiveDocPayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); + } + #endregion + + #region input classes + public partial class UserInputCheckpointGql : IGraphQlInputObject + { + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _lastDocumentId; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastDocumentId + { + get => (QueryBuilderParameter?)_lastDocumentId.Value; + set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_updatedAt.Name != null) yield return _updatedAt; + if (_lastDocumentId.Name != null) yield return _lastDocumentId; + } + } + + public partial class UserInputPushRowGql : IGraphQlInputObject + { + private InputPropertyInfo _assumedMasterState; + private InputPropertyInfo _newDocumentState; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? AssumedMasterState + { + get => (QueryBuilderParameter?)_assumedMasterState.Value; + set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NewDocumentState + { + get => (QueryBuilderParameter?)_newDocumentState.Value; + set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_assumedMasterState.Name != null) yield return _assumedMasterState; + if (_newDocumentState.Name != null) yield return _newDocumentState; + } + } + + public partial class WorkspaceInputCheckpointGql : IGraphQlInputObject + { + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _lastDocumentId; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastDocumentId + { + get => (QueryBuilderParameter?)_lastDocumentId.Value; + set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_updatedAt.Name != null) yield return _updatedAt; + if (_lastDocumentId.Name != null) yield return _lastDocumentId; + } + } + + public partial class WorkspaceInputPushRowGql : IGraphQlInputObject + { + private InputPropertyInfo _assumedMasterState; + private InputPropertyInfo _newDocumentState; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? AssumedMasterState + { + get => (QueryBuilderParameter?)_assumedMasterState.Value; + set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NewDocumentState + { + get => (QueryBuilderParameter?)_newDocumentState.Value; + set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_assumedMasterState.Name != null) yield return _assumedMasterState; + if (_newDocumentState.Name != null) yield return _newDocumentState; + } + } + + public partial class LiveDocInputCheckpointGql : IGraphQlInputObject + { + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _lastDocumentId; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastDocumentId + { + get => (QueryBuilderParameter?)_lastDocumentId.Value; + set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_updatedAt.Name != null) yield return _updatedAt; + if (_lastDocumentId.Name != null) yield return _lastDocumentId; + } + } + + public partial class LiveDocInputPushRowGql : IGraphQlInputObject + { + private InputPropertyInfo _assumedMasterState; + private InputPropertyInfo _newDocumentState; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? AssumedMasterState + { + get => (QueryBuilderParameter?)_assumedMasterState.Value; + set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NewDocumentState + { + get => (QueryBuilderParameter?)_newDocumentState.Value; + set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_assumedMasterState.Name != null) yield return _assumedMasterState; + if (_newDocumentState.Name != null) yield return _newDocumentState; + } + } + + public partial class UserFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _and; + private InputPropertyInfo _or; + private InputPropertyInfo _firstName; + private InputPropertyInfo _lastName; + private InputPropertyInfo _fullName; + private InputPropertyInfo _email; + private InputPropertyInfo _role; + private InputPropertyInfo _jwtAccessToken; + private InputPropertyInfo _workspaceId; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? And + { + get => (QueryBuilderParameter?>?)_and.Value; + set => _and = new InputPropertyInfo { Name = "and", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Or + { + get => (QueryBuilderParameter?>?)_or.Value; + set => _or = new InputPropertyInfo { Name = "or", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FirstName + { + get => (QueryBuilderParameter?)_firstName.Value; + set => _firstName = new InputPropertyInfo { Name = "firstName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastName + { + get => (QueryBuilderParameter?)_lastName.Value; + set => _lastName = new InputPropertyInfo { Name = "lastName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FullName + { + get => (QueryBuilderParameter?)_fullName.Value; + set => _fullName = new InputPropertyInfo { Name = "fullName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Email + { + get => (QueryBuilderParameter?)_email.Value; + set => _email = new InputPropertyInfo { Name = "email", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Role + { + get => (QueryBuilderParameter?)_role.Value; + set => _role = new InputPropertyInfo { Name = "role", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? JwtAccessToken + { + get => (QueryBuilderParameter?)_jwtAccessToken.Value; + set => _jwtAccessToken = new InputPropertyInfo { Name = "jwtAccessToken", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? WorkspaceId + { + get => (QueryBuilderParameter?)_workspaceId.Value; + set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Topics + { + get => (QueryBuilderParameter?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_and.Name != null) yield return _and; + if (_or.Name != null) yield return _or; + if (_firstName.Name != null) yield return _firstName; + if (_lastName.Name != null) yield return _lastName; + if (_fullName.Name != null) yield return _fullName; + if (_email.Name != null) yield return _email; + if (_role.Name != null) yield return _role; + if (_jwtAccessToken.Name != null) yield return _jwtAccessToken; + if (_workspaceId.Name != null) yield return _workspaceId; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class UserInputGql : IGraphQlInputObject + { + private InputPropertyInfo _firstName; + private InputPropertyInfo _lastName; + private InputPropertyInfo _fullName; + private InputPropertyInfo _email; + private InputPropertyInfo _role; + private InputPropertyInfo _jwtAccessToken; + private InputPropertyInfo _workspaceId; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FirstName + { + get => (QueryBuilderParameter?)_firstName.Value; + set => _firstName = new InputPropertyInfo { Name = "firstName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastName + { + get => (QueryBuilderParameter?)_lastName.Value; + set => _lastName = new InputPropertyInfo { Name = "lastName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FullName + { + get => (QueryBuilderParameter?)_fullName.Value; + set => _fullName = new InputPropertyInfo { Name = "fullName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Email + { + get => (QueryBuilderParameter?)_email.Value; + set => _email = new InputPropertyInfo { Name = "email", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Role + { + get => (QueryBuilderParameter?)_role.Value; + set => _role = new InputPropertyInfo { Name = "role", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? JwtAccessToken + { + get => (QueryBuilderParameter?)_jwtAccessToken.Value; + set => _jwtAccessToken = new InputPropertyInfo { Name = "jwtAccessToken", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? WorkspaceId + { + get => (QueryBuilderParameter?)_workspaceId.Value; + set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Topics + { + get => (QueryBuilderParameter?>?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_firstName.Name != null) yield return _firstName; + if (_lastName.Name != null) yield return _lastName; + if (_fullName.Name != null) yield return _fullName; + if (_email.Name != null) yield return _email; + if (_role.Name != null) yield return _role; + if (_jwtAccessToken.Name != null) yield return _jwtAccessToken; + if (_workspaceId.Name != null) yield return _workspaceId; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class UserInputHeadersGql : IGraphQlInputObject + { + private InputPropertyInfo _authorization; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Authorization + { + get => (QueryBuilderParameter?)_authorization.Value; + set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_authorization.Name != null) yield return _authorization; + } + } + + public partial class WorkspaceFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _and; + private InputPropertyInfo _or; + private InputPropertyInfo _name; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? And + { + get => (QueryBuilderParameter?>?)_and.Value; + set => _and = new InputPropertyInfo { Name = "and", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Or + { + get => (QueryBuilderParameter?>?)_or.Value; + set => _or = new InputPropertyInfo { Name = "or", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Name + { + get => (QueryBuilderParameter?)_name.Value; + set => _name = new InputPropertyInfo { Name = "name", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Topics + { + get => (QueryBuilderParameter?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_and.Name != null) yield return _and; + if (_or.Name != null) yield return _or; + if (_name.Name != null) yield return _name; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class WorkspaceInputGql : IGraphQlInputObject + { + private InputPropertyInfo _name; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Name + { + get => (QueryBuilderParameter?)_name.Value; + set => _name = new InputPropertyInfo { Name = "name", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Topics + { + get => (QueryBuilderParameter?>?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_name.Name != null) yield return _name; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class WorkspaceInputHeadersGql : IGraphQlInputObject + { + private InputPropertyInfo _authorization; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Authorization + { + get => (QueryBuilderParameter?)_authorization.Value; + set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_authorization.Name != null) yield return _authorization; + } + } + + public partial class LiveDocFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _and; + private InputPropertyInfo _or; + private InputPropertyInfo _content; + private InputPropertyInfo _ownerId; + private InputPropertyInfo _workspaceId; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? And + { + get => (QueryBuilderParameter?>?)_and.Value; + set => _and = new InputPropertyInfo { Name = "and", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Or + { + get => (QueryBuilderParameter?>?)_or.Value; + set => _or = new InputPropertyInfo { Name = "or", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Content + { + get => (QueryBuilderParameter?)_content.Value; + set => _content = new InputPropertyInfo { Name = "content", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? OwnerId + { + get => (QueryBuilderParameter?)_ownerId.Value; + set => _ownerId = new InputPropertyInfo { Name = "ownerId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? WorkspaceId + { + get => (QueryBuilderParameter?)_workspaceId.Value; + set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Topics + { + get => (QueryBuilderParameter?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_and.Name != null) yield return _and; + if (_or.Name != null) yield return _or; + if (_content.Name != null) yield return _content; + if (_ownerId.Name != null) yield return _ownerId; + if (_workspaceId.Name != null) yield return _workspaceId; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class LiveDocInputGql : IGraphQlInputObject + { + private InputPropertyInfo _content; + private InputPropertyInfo _ownerId; + private InputPropertyInfo _workspaceId; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Content + { + get => (QueryBuilderParameter?)_content.Value; + set => _content = new InputPropertyInfo { Name = "content", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? OwnerId + { + get => (QueryBuilderParameter?)_ownerId.Value; + set => _ownerId = new InputPropertyInfo { Name = "ownerId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? WorkspaceId + { + get => (QueryBuilderParameter?)_workspaceId.Value; + set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Topics + { + get => (QueryBuilderParameter?>?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_content.Name != null) yield return _content; + if (_ownerId.Name != null) yield return _ownerId; + if (_workspaceId.Name != null) yield return _workspaceId; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class LiveDocInputHeadersGql : IGraphQlInputObject + { + private InputPropertyInfo _authorization; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Authorization + { + get => (QueryBuilderParameter?)_authorization.Value; + set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_authorization.Name != null) yield return _authorization; + } + } + + public partial class StringOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _and; + private InputPropertyInfo _or; + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + private InputPropertyInfo _contains; + private InputPropertyInfo _ncontains; + private InputPropertyInfo _in; + private InputPropertyInfo _nin; + private InputPropertyInfo _startsWith; + private InputPropertyInfo _nstartsWith; + private InputPropertyInfo _endsWith; + private InputPropertyInfo _nendsWith; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? And + { + get => (QueryBuilderParameter?>?)_and.Value; + set => _and = new InputPropertyInfo { Name = "and", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Or + { + get => (QueryBuilderParameter?>?)_or.Value; + set => _or = new InputPropertyInfo { Name = "or", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Contains + { + get => (QueryBuilderParameter?)_contains.Value; + set => _contains = new InputPropertyInfo { Name = "contains", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ncontains + { + get => (QueryBuilderParameter?)_ncontains.Value; + set => _ncontains = new InputPropertyInfo { Name = "ncontains", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? In + { + get => (QueryBuilderParameter?>?)_in.Value; + set => _in = new InputPropertyInfo { Name = "in", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Nin + { + get => (QueryBuilderParameter?>?)_nin.Value; + set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? StartsWith + { + get => (QueryBuilderParameter?)_startsWith.Value; + set => _startsWith = new InputPropertyInfo { Name = "startsWith", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NstartsWith + { + get => (QueryBuilderParameter?)_nstartsWith.Value; + set => _nstartsWith = new InputPropertyInfo { Name = "nstartsWith", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? EndsWith + { + get => (QueryBuilderParameter?)_endsWith.Value; + set => _endsWith = new InputPropertyInfo { Name = "endsWith", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NendsWith + { + get => (QueryBuilderParameter?)_nendsWith.Value; + set => _nendsWith = new InputPropertyInfo { Name = "nendsWith", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_and.Name != null) yield return _and; + if (_or.Name != null) yield return _or; + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + if (_contains.Name != null) yield return _contains; + if (_ncontains.Name != null) yield return _ncontains; + if (_in.Name != null) yield return _in; + if (_nin.Name != null) yield return _nin; + if (_startsWith.Name != null) yield return _startsWith; + if (_nstartsWith.Name != null) yield return _nstartsWith; + if (_endsWith.Name != null) yield return _endsWith; + if (_nendsWith.Name != null) yield return _nendsWith; + } + } + + public partial class UserRoleOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + private InputPropertyInfo _in; + private InputPropertyInfo _nin; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? In + { + get => (QueryBuilderParameter?>?)_in.Value; + set => _in = new InputPropertyInfo { Name = "in", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Nin + { + get => (QueryBuilderParameter?>?)_nin.Value; + set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + if (_in.Name != null) yield return _in; + if (_nin.Name != null) yield return _nin; + } + } + + public partial class UuidOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + private InputPropertyInfo _in; + private InputPropertyInfo _nin; + private InputPropertyInfo _gt; + private InputPropertyInfo _ngt; + private InputPropertyInfo _gte; + private InputPropertyInfo _ngte; + private InputPropertyInfo _lt; + private InputPropertyInfo _nlt; + private InputPropertyInfo _lte; + private InputPropertyInfo _nlte; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? In + { + get => (QueryBuilderParameter?>?)_in.Value; + set => _in = new InputPropertyInfo { Name = "in", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Nin + { + get => (QueryBuilderParameter?>?)_nin.Value; + set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Gt + { + get => (QueryBuilderParameter?)_gt.Value; + set => _gt = new InputPropertyInfo { Name = "gt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ngt + { + get => (QueryBuilderParameter?)_ngt.Value; + set => _ngt = new InputPropertyInfo { Name = "ngt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Gte + { + get => (QueryBuilderParameter?)_gte.Value; + set => _gte = new InputPropertyInfo { Name = "gte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ngte + { + get => (QueryBuilderParameter?)_ngte.Value; + set => _ngte = new InputPropertyInfo { Name = "ngte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Lt + { + get => (QueryBuilderParameter?)_lt.Value; + set => _lt = new InputPropertyInfo { Name = "lt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Nlt + { + get => (QueryBuilderParameter?)_nlt.Value; + set => _nlt = new InputPropertyInfo { Name = "nlt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Lte + { + get => (QueryBuilderParameter?)_lte.Value; + set => _lte = new InputPropertyInfo { Name = "lte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Nlte + { + get => (QueryBuilderParameter?)_nlte.Value; + set => _nlte = new InputPropertyInfo { Name = "nlte", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + if (_in.Name != null) yield return _in; + if (_nin.Name != null) yield return _nin; + if (_gt.Name != null) yield return _gt; + if (_ngt.Name != null) yield return _ngt; + if (_gte.Name != null) yield return _gte; + if (_ngte.Name != null) yield return _ngte; + if (_lt.Name != null) yield return _lt; + if (_nlt.Name != null) yield return _nlt; + if (_lte.Name != null) yield return _lte; + if (_nlte.Name != null) yield return _nlte; + } + } + + public partial class BooleanOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + } + } + + public partial class DateTimeOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + private InputPropertyInfo _in; + private InputPropertyInfo _nin; + private InputPropertyInfo _gt; + private InputPropertyInfo _ngt; + private InputPropertyInfo _gte; + private InputPropertyInfo _ngte; + private InputPropertyInfo _lt; + private InputPropertyInfo _nlt; + private InputPropertyInfo _lte; + private InputPropertyInfo _nlte; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? In + { + get => (QueryBuilderParameter?>?)_in.Value; + set => _in = new InputPropertyInfo { Name = "in", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Nin + { + get => (QueryBuilderParameter?>?)_nin.Value; + set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Gt + { + get => (QueryBuilderParameter?)_gt.Value; + set => _gt = new InputPropertyInfo { Name = "gt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ngt + { + get => (QueryBuilderParameter?)_ngt.Value; + set => _ngt = new InputPropertyInfo { Name = "ngt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Gte + { + get => (QueryBuilderParameter?)_gte.Value; + set => _gte = new InputPropertyInfo { Name = "gte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ngte + { + get => (QueryBuilderParameter?)_ngte.Value; + set => _ngte = new InputPropertyInfo { Name = "ngte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Lt + { + get => (QueryBuilderParameter?)_lt.Value; + set => _lt = new InputPropertyInfo { Name = "lt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Nlt + { + get => (QueryBuilderParameter?)_nlt.Value; + set => _nlt = new InputPropertyInfo { Name = "nlt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Lte + { + get => (QueryBuilderParameter?)_lte.Value; + set => _lte = new InputPropertyInfo { Name = "lte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Nlte + { + get => (QueryBuilderParameter?)_nlte.Value; + set => _nlte = new InputPropertyInfo { Name = "nlte", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + if (_in.Name != null) yield return _in; + if (_nin.Name != null) yield return _nin; + if (_gt.Name != null) yield return _gt; + if (_ngt.Name != null) yield return _ngt; + if (_gte.Name != null) yield return _gte; + if (_ngte.Name != null) yield return _ngte; + if (_lt.Name != null) yield return _lt; + if (_nlt.Name != null) yield return _nlt; + if (_lte.Name != null) yield return _lte; + if (_nlte.Name != null) yield return _nlte; + } + } + + public partial class ListStringOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _all; + private InputPropertyInfo _none; + private InputPropertyInfo _some; + private InputPropertyInfo _any; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? All + { + get => (QueryBuilderParameter?)_all.Value; + set => _all = new InputPropertyInfo { Name = "all", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? None + { + get => (QueryBuilderParameter?)_none.Value; + set => _none = new InputPropertyInfo { Name = "none", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Some + { + get => (QueryBuilderParameter?)_some.Value; + set => _some = new InputPropertyInfo { Name = "some", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Any + { + get => (QueryBuilderParameter?)_any.Value; + set => _any = new InputPropertyInfo { Name = "any", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_all.Name != null) yield return _all; + if (_none.Name != null) yield return _none; + if (_some.Name != null) yield return _some; + if (_any.Name != null) yield return _any; + } + } + + public partial class PushUserInputGql : IGraphQlInputObject + { + private InputPropertyInfo _userPushRow; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? UserPushRow + { + get => (QueryBuilderParameter?>?)_userPushRow.Value; + set => _userPushRow = new InputPropertyInfo { Name = "userPushRow", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_userPushRow.Name != null) yield return _userPushRow; + } + } + + public partial class PushWorkspaceInputGql : IGraphQlInputObject + { + private InputPropertyInfo _workspacePushRow; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? WorkspacePushRow + { + get => (QueryBuilderParameter?>?)_workspacePushRow.Value; + set => _workspacePushRow = new InputPropertyInfo { Name = "workspacePushRow", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_workspacePushRow.Name != null) yield return _workspacePushRow; + } + } + + public partial class PushLiveDocInputGql : IGraphQlInputObject + { + private InputPropertyInfo _liveDocPushRow; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? LiveDocPushRow + { + get => (QueryBuilderParameter?>?)_liveDocPushRow.Value; + set => _liveDocPushRow = new InputPropertyInfo { Name = "liveDocPushRow", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_liveDocPushRow.Name != null) yield return _liveDocPushRow; + } + } + #endregion + + #region data classes + public partial class UserPullBulkGql + { + public ICollection? Documents { get; set; } + public CheckpointGql? Checkpoint { get; set; } + } + + public partial class WorkspacePullBulkGql + { + public ICollection? Documents { get; set; } + public CheckpointGql? Checkpoint { get; set; } + } + + public partial class LiveDocPullBulkGql + { + public ICollection? Documents { get; set; } + public CheckpointGql? Checkpoint { get; set; } + } + + public partial class QueryGql + { + public UserPullBulkGql? PullUser { get; set; } + public WorkspacePullBulkGql? PullWorkspace { get; set; } + public LiveDocPullBulkGql? PullLiveDoc { get; set; } + } + + public partial class MutationGql + { + public PushUserPayloadGql? PushUser { get; set; } + public PushWorkspacePayloadGql? PushWorkspace { get; set; } + public PushLiveDocPayloadGql? PushLiveDoc { get; set; } + } + + public partial class SubscriptionGql + { + public UserPullBulkGql? StreamUser { get; set; } + public WorkspacePullBulkGql? StreamWorkspace { get; set; } + public LiveDocPullBulkGql? StreamLiveDoc { get; set; } + } + + public partial class UserGql + { + public string FirstName { get; set; } + public string LastName { get; set; } + public string? FullName { get; set; } + public string? Email { get; set; } + public LiveDocs.GraphQLApi.Security.UserRole Role { get; set; } + public string? JwtAccessToken { get; set; } + public Guid WorkspaceId { get; set; } + public Guid Id { get; set; } + public bool IsDeleted { get; set; } + public DateTimeOffset UpdatedAt { get; set; } + public ICollection? Topics { get; set; } + } + + public partial class CheckpointGql + { + public Guid? LastDocumentId { get; set; } + public DateTimeOffset? UpdatedAt { get; set; } + } + + [GraphQlObjectType("AuthenticationError")] + public partial class AuthenticationErrorGql : IPushUserErrorGql, IPushWorkspaceErrorGql, IPushLiveDocErrorGql, IErrorGql + { + public string Message { get; set; } + } + + [GraphQlObjectType("UnauthorizedAccessError")] + public partial class UnauthorizedAccessErrorGql : IPushUserErrorGql, IPushWorkspaceErrorGql, IPushLiveDocErrorGql, IErrorGql + { + public string Message { get; set; } + } + + public partial class WorkspaceGql + { + public string Name { get; set; } + public Guid Id { get; set; } + public bool IsDeleted { get; set; } + public DateTimeOffset UpdatedAt { get; set; } + public ICollection? Topics { get; set; } + } + + public partial class LiveDocGql + { + public string Content { get; set; } + public Guid OwnerId { get; set; } + public Guid WorkspaceId { get; set; } + public Guid Id { get; set; } + public bool IsDeleted { get; set; } + public DateTimeOffset UpdatedAt { get; set; } + public ICollection? Topics { get; set; } + } + + public partial interface IErrorGql + { + string Message { get; set; } + } + + public partial interface IPushUserErrorGql + { + } + + public partial class PushUserPayloadGql + { + public ICollection? User { get; set; } + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] + #endif + public ICollection? Errors { get; set; } + } + + public partial interface IPushWorkspaceErrorGql + { + } + + public partial class PushWorkspacePayloadGql + { + public ICollection? Workspace { get; set; } + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] + #endif + public ICollection? Errors { get; set; } + } + + public partial interface IPushLiveDocErrorGql + { + } + + public partial class PushLiveDocPayloadGql + { + public ICollection? LiveDoc { get; set; } + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] + #endif + public ICollection? Errors { get; set; } + } + #endregion + #nullable restore +} From c964e4453bab63b62d4680e97b7a26feac696e75 Mon Sep 17 00:00:00 2001 From: Richard Beauchamp Date: Mon, 7 Oct 2024 07:29:35 -0700 Subject: [PATCH 5/5] sp --- .github/dependabot.yml | 1 + .github/release-drafter.yml | 1 + .github/workflows/main.yml | 1 + .github/workflows/pull-request.yml | 2 + .github/workflows/release.yml | 1 + example/LiveDocs.AppHost/Program.cs | 1 + .../Infrastructure/LiveDocsDbInitializer.cs | 139 +- .../Validations/JwtFormatAttribute.cs | 123 +- .../TestScenarioBuilder.cs | 451 +- .../DocumentExtensionsTests.cs | 69 +- .../Model/GraphQLTestModel.cs | 6688 ++++++++--------- 11 files changed, 3740 insertions(+), 3737 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e516055..273d347 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,5 @@ # .github/dependabot.yml + version: 2 updates: - package-ecosystem: "nuget" diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index da9348a..a0d899d 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,4 +1,5 @@ # .github/release-drafter.yml + name-template: 'v$RESOLVED_VERSION' tag-template: 'v$RESOLVED_VERSION' categories: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7eb57a7..db758cb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,5 @@ # .github/workflows/main.yml + name: CI on: diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 19844bc..edbd8d1 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,3 +1,5 @@ +# .github/workflows/pull-request.yml + name: Pull Request on: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01609d4..64b4255 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,5 @@ # .github/workflows/release.yml + name: Deploy NuGet Package before Release on: diff --git a/example/LiveDocs.AppHost/Program.cs b/example/LiveDocs.AppHost/Program.cs index cc82c96..7a1ed34 100644 --- a/example/LiveDocs.AppHost/Program.cs +++ b/example/LiveDocs.AppHost/Program.cs @@ -1,4 +1,5 @@ // example/LiveDocs.AppHost/Program.cs + using System; using Aspire.Hosting; using Projects; diff --git a/example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs b/example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs index 2531e1b..cb9f930 100644 --- a/example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs +++ b/example/LiveDocs.GraphQLApi/Infrastructure/LiveDocsDbInitializer.cs @@ -8,91 +8,90 @@ using LiveDocs.GraphQLApi.Security; using Microsoft.EntityFrameworkCore; -namespace LiveDocs.GraphQLApi.Infrastructure +namespace LiveDocs.GraphQLApi.Infrastructure; + +public static class LiveDocsDbInitializer { - public static class LiveDocsDbInitializer + public static async Task InitializeAsync() { - public static async Task InitializeAsync() - { - await using var dbContext = new LiveDocsDbContext(); + await using var dbContext = new LiveDocsDbContext(); - // See https://github.com/dotnet/aspire/issues/1023#issuecomment-2156120941 - // for macOS related issues - var strategy = new SqlServerRetryingExecutionStrategy( - dbContext, - maxRetryCount: 10, - TimeSpan.FromSeconds(5), - RetryIntervals); + // See https://github.com/dotnet/aspire/issues/1023#issuecomment-2156120941 + // for macOS related issues + var strategy = new SqlServerRetryingExecutionStrategy( + dbContext, + maxRetryCount: 10, + TimeSpan.FromSeconds(5), + RetryIntervals); - await strategy.ExecuteAsync(async () => + await strategy.ExecuteAsync(async () => + { + try { - try - { - await dbContext.Database.EnsureCreatedAsync(); - } - catch - { - // ignore this error; the db exists - } + await dbContext.Database.EnsureCreatedAsync(); + } + catch + { + // ignore this error; the db exists + } - if (!await dbContext.Workspaces.AnyAsync()) - { - await SeedDataAsync(dbContext); + if (!await dbContext.Workspaces.AnyAsync()) + { + await SeedDataAsync(dbContext); } - }); - } + }); + } - private static readonly int[] RetryIntervals = { 0 }; + private static readonly int[] RetryIntervals = { 0 }; - private static async Task SeedDataAsync(LiveDocsDbContext dbContext) + private static async Task SeedDataAsync(LiveDocsDbContext dbContext) + { + var rootWorkspace = new Workspace { - var rootWorkspace = new Workspace - { - Id = RT.Comb.Provider.Sql.Create(), - Name = "Default Workspace", - UpdatedAt = DateTimeOffset.UtcNow, - IsDeleted = false, - ReplicatedDocumentId = Guid.NewGuid(), - Topics = [], - }; + Id = RT.Comb.Provider.Sql.Create(), + Name = "Default Workspace", + UpdatedAt = DateTimeOffset.UtcNow, + IsDeleted = false, + ReplicatedDocumentId = Guid.NewGuid(), + Topics = [], + }; - await dbContext.Workspaces.AddAsync(rootWorkspace); + await dbContext.Workspaces.AddAsync(rootWorkspace); - var systemAdminReplicatedUser = new ReplicatedUser - { - Id = Guid.NewGuid(), - FirstName = "System", - LastName = "Admin", - Email = "systemadmin@livedocs.example.org", - Role = UserRole.SystemAdmin, - WorkspaceId = rootWorkspace.ReplicatedDocumentId, - UpdatedAt = DateTimeOffset.UtcNow, - IsDeleted = false, - }; + var systemAdminReplicatedUser = new ReplicatedUser + { + Id = Guid.NewGuid(), + FirstName = "System", + LastName = "Admin", + Email = "systemadmin@livedocs.example.org", + Role = UserRole.SystemAdmin, + WorkspaceId = rootWorkspace.ReplicatedDocumentId, + UpdatedAt = DateTimeOffset.UtcNow, + IsDeleted = false, + }; - // Generate a non-expiring JWT token for the system admin user - // We'll use this in the client app to bootstrap the "logged in" state - // since we are not supporting username and password login in this example application - var nonExpiringToken = JwtUtil.GenerateJwtToken(systemAdminReplicatedUser, expires: DateTime.MaxValue); + // Generate a non-expiring JWT token for the system admin user + // We'll use this in the client app to bootstrap the "logged in" state + // since we are not supporting username and password login in this example application + var nonExpiringToken = JwtUtil.GenerateJwtToken(systemAdminReplicatedUser, expires: DateTime.MaxValue); - var systemAdminUser = new User - { - Id = RT.Comb.Provider.Sql.Create(), - FirstName = systemAdminReplicatedUser.FirstName, - LastName = systemAdminReplicatedUser.LastName, - Email = systemAdminReplicatedUser.Email, - Role = systemAdminReplicatedUser.Role, - JwtAccessToken = nonExpiringToken, - WorkspaceId = rootWorkspace.Id, - UpdatedAt = systemAdminReplicatedUser.UpdatedAt, - IsDeleted = systemAdminReplicatedUser.IsDeleted, - ReplicatedDocumentId = systemAdminReplicatedUser.Id, - Topics = [], - }; + var systemAdminUser = new User + { + Id = RT.Comb.Provider.Sql.Create(), + FirstName = systemAdminReplicatedUser.FirstName, + LastName = systemAdminReplicatedUser.LastName, + Email = systemAdminReplicatedUser.Email, + Role = systemAdminReplicatedUser.Role, + JwtAccessToken = nonExpiringToken, + WorkspaceId = rootWorkspace.Id, + UpdatedAt = systemAdminReplicatedUser.UpdatedAt, + IsDeleted = systemAdminReplicatedUser.IsDeleted, + ReplicatedDocumentId = systemAdminReplicatedUser.Id, + Topics = [], + }; - await dbContext.Users.AddAsync(systemAdminUser); + await dbContext.Users.AddAsync(systemAdminUser); - await dbContext.SaveChangesAsync(); - } + await dbContext.SaveChangesAsync(); } } diff --git a/example/LiveDocs.GraphQLApi/Validations/JwtFormatAttribute.cs b/example/LiveDocs.GraphQLApi/Validations/JwtFormatAttribute.cs index 0055d15..7b5760c 100644 --- a/example/LiveDocs.GraphQLApi/Validations/JwtFormatAttribute.cs +++ b/example/LiveDocs.GraphQLApi/Validations/JwtFormatAttribute.cs @@ -4,81 +4,80 @@ using System.ComponentModel.DataAnnotations; using System.IdentityModel.Tokens.Jwt; -namespace LiveDocs.GraphQLApi.Validations +namespace LiveDocs.GraphQLApi.Validations; + +/// +/// Validates that a string property contains a well-formed JWT (JSON Web Token). +/// +/// +/// This attribute checks if a string is a valid JWT format by using the class +/// from the System.IdentityModel.Tokens.Jwt namespace. +/// +/// The validation does not check the token's signature or claims; it only ensures that the string is correctly structured as a JWT. +/// +/// +/// Usage: +/// Apply this attribute to string properties that are intended to hold JWT access tokens. +/// +/// +/// +/// [JwtFormat(AllowNull = true)] +/// public string? JwtAccessToken { get; set; } +/// +/// +/// +/// Note: +/// This attribute only validates the format of the JWT. It does not verify the token's integrity, expiration, or claims. +/// For full token validation, consider using a more comprehensive solution involving token validation middleware or services. +/// +/// +[AttributeUsage(AttributeTargets.Property)] +public sealed class JwtFormatAttribute : ValidationAttribute { /// - /// Validates that a string property contains a well-formed JWT (JSON Web Token). + /// Gets or sets a value indicating whether null values are allowed. + /// Default is false. /// - /// - /// This attribute checks if a string is a valid JWT format by using the class - /// from the System.IdentityModel.Tokens.Jwt namespace. - /// - /// The validation does not check the token's signature or claims; it only ensures that the string is correctly structured as a JWT. - /// - /// - /// Usage: - /// Apply this attribute to string properties that are intended to hold JWT access tokens. - /// - /// - /// - /// [JwtFormat(AllowNull = true)] - /// public string? JwtAccessToken { get; set; } - /// - /// + public bool AllowNull { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public JwtFormatAttribute() + { + AllowNull = false; + } + + /// + /// Validates whether the specified value is a well-formed JWT or null if allowed. + /// + /// The value to validate. + /// Provides contextual information about the validation operation. + /// + /// A indicating whether the validation was successful. /// - /// Note: - /// This attribute only validates the format of the JWT. It does not verify the token's integrity, expiration, or claims. - /// For full token validation, consider using a more comprehensive solution involving token validation middleware or services. + /// Returns if the value is a valid JWT format or if null is allowed and the value is null; + /// otherwise, returns an error message. /// - /// - [AttributeUsage(AttributeTargets.Property)] - public sealed class JwtFormatAttribute : ValidationAttribute + /// + protected override ValidationResult? IsValid(object? value, ValidationContext validationContext) { - /// - /// Gets or sets a value indicating whether null values are allowed. - /// Default is false. - /// - public bool AllowNull { get; set; } - - /// - /// Initializes a new instance of the class. - /// - public JwtFormatAttribute() + if (value is null) { - AllowNull = false; + return AllowNull ? ValidationResult.Success : new ValidationResult("The JWT token cannot be null."); } - /// - /// Validates whether the specified value is a well-formed JWT or null if allowed. - /// - /// The value to validate. - /// Provides contextual information about the validation operation. - /// - /// A indicating whether the validation was successful. - /// - /// Returns if the value is a valid JWT format or if null is allowed and the value is null; - /// otherwise, returns an error message. - /// - /// - protected override ValidationResult? IsValid(object? value, ValidationContext validationContext) + if (value is string jwt) { - if (value is null) + if (string.IsNullOrWhiteSpace(jwt)) { - return AllowNull ? ValidationResult.Success : new ValidationResult("The JWT token cannot be null."); + return new ValidationResult("The JWT token is empty or consists only of whitespace."); } - if (value is string jwt) - { - if (string.IsNullOrWhiteSpace(jwt)) - { - return new ValidationResult("The JWT token is empty or consists only of whitespace."); - } - - var handler = new JwtSecurityTokenHandler(); - return handler.CanReadToken(jwt) ? ValidationResult.Success : new ValidationResult("The JWT token format is invalid."); - } - - return new ValidationResult($"The value must be a string. Actual type: {value.GetType().Name}"); + var handler = new JwtSecurityTokenHandler(); + return handler.CanReadToken(jwt) ? ValidationResult.Success : new ValidationResult("The JWT token format is invalid."); } + + return new ValidationResult($"The value must be a string. Actual type: {value.GetType().Name}"); } } diff --git a/tests/RxDBDotNet.Tests.Setup/TestScenarioBuilder.cs b/tests/RxDBDotNet.Tests.Setup/TestScenarioBuilder.cs index efb0710..2e7d4b0 100644 --- a/tests/RxDBDotNet.Tests.Setup/TestScenarioBuilder.cs +++ b/tests/RxDBDotNet.Tests.Setup/TestScenarioBuilder.cs @@ -31,279 +31,278 @@ using RxDBDotNet.Services; using StackExchange.Redis; -namespace RxDBDotNet.Tests.Setup +namespace RxDBDotNet.Tests.Setup; + +/// +/// Provides a fluent builder pattern for arranging a test scenario. +/// +public class TestScenarioBuilder { + private bool _setupAuthorization; + private Action _configureWebHostBuilder = _ => { }; + private Action _configureServices = _ => { }; + private Action _configureGraphQL = _ => { }; + private readonly Dictionary> _configureReplicatedDocuments = []; + /// - /// Provides a fluent builder pattern for arranging a test scenario. + /// Initializes a new instance of the class with optional default GraphQL configurations. /// - public class TestScenarioBuilder + /// + /// If set to true, the constructor configures default GraphQL options and services that do not change between tests. + /// + public TestScenarioBuilder(bool configureGraphQLDefaults = true) { - private bool _setupAuthorization; - private Action _configureWebHostBuilder = _ => { }; - private Action _configureServices = _ => { }; - private Action _configureGraphQL = _ => { }; - private readonly Dictionary> _configureReplicatedDocuments = []; - - /// - /// Initializes a new instance of the class with optional default GraphQL configurations. - /// - /// - /// If set to true, the constructor configures default GraphQL options and services that do not change between tests. - /// - public TestScenarioBuilder(bool configureGraphQLDefaults = true) + if (configureGraphQLDefaults) { - if (configureGraphQLDefaults) - { - // Configure default graphql options that don't change between tests - ConfigureGraphQL(builder => - { - builder.ModifyRequestOptions(o => o.IncludeExceptionDetails = true) - .AddMutationConventions() - .AddReplication() - .AddRedisSubscriptions(provider => provider.GetRequiredService(), new SubscriptionOptions - { - TopicPrefix = Guid.NewGuid() - .ToString(), - }) - .AddSubscriptionDiagnostics(); - }); - } - - // Configure default servcies that don't change between tests - ConfigureServices(services => + // Configure default graphql options that don't change between tests + ConfigureGraphQL(builder => { - services.AddProblemDetails(); - services.Configure(options => options.KeepAliveInterval = TimeSpan.FromMinutes(2)); - services.Configure(options => options.ExecutionTimeout = TimeSpan.FromMinutes(15)); - services.AddSingleton(_ => ConnectionMultiplexer.Connect("localhost:3333")); - services.AddDbContext(options => - options.UseSqlServer(Environment.GetEnvironmentVariable(ConfigKeys.DbConnectionString) - ?? throw new InvalidOperationException($"The '{ConfigKeys.DbConnectionString}' env variable must be set"))); - - services.AddScoped, UserService>() - .AddScoped, WorkspaceService>() - .AddScoped, LiveDocService>(); + builder.ModifyRequestOptions(o => o.IncludeExceptionDetails = true) + .AddMutationConventions() + .AddReplication() + .AddRedisSubscriptions(provider => provider.GetRequiredService(), new SubscriptionOptions + { + TopicPrefix = Guid.NewGuid() + .ToString(), + }) + .AddSubscriptionDiagnostics(); }); - - // Add documents with no additional configuration - // Can be overridden by the test scenario - ConfigureReplicatedDocument(); - ConfigureReplicatedDocument(); - ConfigureReplicatedDocument(); } - /// - /// Configures authorization for the test setup. - /// - /// If true, sets up authorization. - /// The current instance. - public TestScenarioBuilder WithAuthorization(bool setup = true) + // Configure default servcies that don't change between tests + ConfigureServices(services => { - _setupAuthorization = setup; - return this; - } + services.AddProblemDetails(); + services.Configure(options => options.KeepAliveInterval = TimeSpan.FromMinutes(2)); + services.Configure(options => options.ExecutionTimeout = TimeSpan.FromMinutes(15)); + services.AddSingleton(_ => ConnectionMultiplexer.Connect("localhost:3333")); + services.AddDbContext(options => + options.UseSqlServer(Environment.GetEnvironmentVariable(ConfigKeys.DbConnectionString) + ?? throw new InvalidOperationException($"The '{ConfigKeys.DbConnectionString}' env variable must be set"))); + + services.AddScoped, UserService>() + .AddScoped, WorkspaceService>() + .AddScoped, LiveDocService>(); + }); + + // Add documents with no additional configuration + // Can be overridden by the test scenario + ConfigureReplicatedDocument(); + ConfigureReplicatedDocument(); + ConfigureReplicatedDocument(); + } - /// - /// Configures the web host builder. - /// - /// An action to configure the web host builder. - /// The current instance. - public TestScenarioBuilder ConfigureWebHost(Action configure) - { - _configureWebHostBuilder += configure; - return this; - } + /// + /// Configures authorization for the test setup. + /// + /// If true, sets up authorization. + /// The current instance. + public TestScenarioBuilder WithAuthorization(bool setup = true) + { + _setupAuthorization = setup; + return this; + } - /// - /// Configures services for the test setup. - /// - /// An action to configure services. - /// The current instance. - public TestScenarioBuilder ConfigureServices(Action configure) - { - _configureServices += configure; - return this; - } + /// + /// Configures the web host builder. + /// + /// An action to configure the web host builder. + /// The current instance. + public TestScenarioBuilder ConfigureWebHost(Action configure) + { + _configureWebHostBuilder += configure; + return this; + } - /// - /// Configures GraphQL for the test setup. - /// - /// An action to configure GraphQL. - /// The current instance. - public TestScenarioBuilder ConfigureGraphQL(Action configure) - { - _configureGraphQL += configure; - return this; - } + /// + /// Configures services for the test setup. + /// + /// An action to configure services. + /// The current instance. + public TestScenarioBuilder ConfigureServices(Action configure) + { + _configureServices += configure; + return this; + } - /// - /// Configures options for a specific document type. - /// - /// The type of the document. - /// An action to configure replication options. - /// The current instance. - public TestScenarioBuilder ConfigureReplicatedDocument(Action>? configure = null) - where TDocument : class, IReplicatedDocument - { - _configureReplicatedDocuments[typeof(TDocument)] = builder => builder.AddReplicatedDocument(configure); - return this; - } + /// + /// Configures GraphQL for the test setup. + /// + /// An action to configure GraphQL. + /// The current instance. + public TestScenarioBuilder ConfigureGraphQL(Action configure) + { + _configureGraphQL += configure; + return this; + } - /// - /// Builds and returns a new based on the configured options. - /// - /// A new instance. - public TestContext Build() - { - var asyncDisposables = new List(); - var disposables = new List(); + /// + /// Configures options for a specific document type. + /// + /// The type of the document. + /// An action to configure replication options. + /// The current instance. + public TestScenarioBuilder ConfigureReplicatedDocument(Action>? configure = null) + where TDocument : class, IReplicatedDocument + { + _configureReplicatedDocuments[typeof(TDocument)] = builder => builder.AddReplicatedDocument(configure); + return this; + } + + /// + /// Builds and returns a new based on the configured options. + /// + /// A new instance. + public TestContext Build() + { + var asyncDisposables = new List(); + var disposables = new List(); - var testTimeout = Debugger.IsAttached ? TimeSpan.FromMinutes(5) : TimeSpan.FromSeconds(10); + var testTimeout = Debugger.IsAttached ? TimeSpan.FromMinutes(5) : TimeSpan.FromSeconds(10); - var timeoutTokenSource = new CancellationTokenSource(testTimeout); - disposables.Add(timeoutTokenSource); + var timeoutTokenSource = new CancellationTokenSource(testTimeout); + disposables.Add(timeoutTokenSource); - var timeoutToken = timeoutTokenSource.Token; + var timeoutToken = timeoutTokenSource.Token; #pragma warning disable CA2000 // This is disposed in the TestContext.DisposeAsync method - var factory = ConfigureWebApplicationFactory(); + var factory = ConfigureWebApplicationFactory(); - asyncDisposables.Add(factory); + asyncDisposables.Add(factory); - var asyncTestServiceScope = factory.Services.CreateAsyncScope(); - asyncDisposables.Add(asyncTestServiceScope); + var asyncTestServiceScope = factory.Services.CreateAsyncScope(); + asyncDisposables.Add(asyncTestServiceScope); - var applicationStoppingToken = asyncTestServiceScope - .ServiceProvider - .GetRequiredService() - .ApplicationStopping; + var applicationStoppingToken = asyncTestServiceScope + .ServiceProvider + .GetRequiredService() + .ApplicationStopping; - var linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(timeoutToken, applicationStoppingToken); - disposables.Add(linkedTokenSource); + var linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(timeoutToken, applicationStoppingToken); + disposables.Add(linkedTokenSource); - var linkedToken = linkedTokenSource.Token; + var linkedToken = linkedTokenSource.Token; - return new TestContext - { - Factory = factory, - HttpClient = factory.CreateClient(), - ServiceProvider = asyncTestServiceScope.ServiceProvider, - CancellationToken = linkedToken, - AsyncDisposables = asyncDisposables, - Disposables = disposables, - }; - } + return new TestContext + { + Factory = factory, + HttpClient = factory.CreateClient(), + ServiceProvider = asyncTestServiceScope.ServiceProvider, + CancellationToken = linkedToken, + AsyncDisposables = asyncDisposables, + Disposables = disposables, + }; + } - private WebApplicationFactory ConfigureWebApplicationFactory() + private WebApplicationFactory ConfigureWebApplicationFactory() + { + return new WebApplicationFactory().WithWebHostBuilder(builder => { - return new WebApplicationFactory().WithWebHostBuilder(builder => - { - builder.UseSolutionRelativeContentRoot("example/LiveDocs.GraphQLApi") - .ConfigureServices(services => + builder.UseSolutionRelativeContentRoot("example/LiveDocs.GraphQLApi") + .ConfigureServices(services => + { + if (_setupAuthorization) { - if (_setupAuthorization) - { - SetupAuthorization(services); - } + SetupAuthorization(services); + } - _configureServices(services); + _configureServices(services); - var graphQLBuilder = services.AddGraphQLServer(); + var graphQLBuilder = services.AddGraphQLServer(); - foreach (var replicatedDocumentConfig in _configureReplicatedDocuments.Values) - { - replicatedDocumentConfig(graphQLBuilder); - } + foreach (var replicatedDocumentConfig in _configureReplicatedDocuments.Values) + { + replicatedDocumentConfig(graphQLBuilder); + } - _configureGraphQL(graphQLBuilder); - }); + _configureGraphQL(graphQLBuilder); + }); - builder.Configure(ConfigureAppDefaults); + builder.Configure(ConfigureAppDefaults); - _configureWebHostBuilder(builder); - }); - } + _configureWebHostBuilder(builder); + }); + } - /// - /// Sets up authorization for testing purposes. - /// - /// The to configure. - private void SetupAuthorization(IServiceCollection services) - { - services.AddScoped(); + /// + /// Sets up authorization for testing purposes. + /// + /// The to configure. + private void SetupAuthorization(IServiceCollection services) + { + services.AddScoped(); - ConfigurePolicies(services); + ConfigurePolicies(services); - ConfigureAuthentication(services); + ConfigureAuthentication(services); - ConfigureGraphQL(builder => builder.AddAuthorization()); - } + ConfigureGraphQL(builder => builder.AddAuthorization()); + } - private static void ConfigurePolicies(IServiceCollection services) - { - services.AddAuthorizationBuilder() - .AddPolicy("IsWorkspaceAdmin", - policy => policy.RequireClaim(ClaimTypes.Role, nameof(UserRole.WorkspaceAdmin), nameof(UserRole.SystemAdmin))) - .AddPolicy("IsSystemAdmin", policy => policy.RequireClaim(ClaimTypes.Role, nameof(UserRole.SystemAdmin))); - } + private static void ConfigurePolicies(IServiceCollection services) + { + services.AddAuthorizationBuilder() + .AddPolicy("IsWorkspaceAdmin", + policy => policy.RequireClaim(ClaimTypes.Role, nameof(UserRole.WorkspaceAdmin), nameof(UserRole.SystemAdmin))) + .AddPolicy("IsSystemAdmin", policy => policy.RequireClaim(ClaimTypes.Role, nameof(UserRole.SystemAdmin))); + } - /// - /// Configures authentication for testing purposes. - /// - /// The to configure. - private static void ConfigureAuthentication(IServiceCollection services) - { - services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) - .AddJwtBearer(options => + /// + /// Configures authentication for testing purposes. + /// + /// The to configure. + private static void ConfigureAuthentication(IServiceCollection services) + { + services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + .AddJwtBearer(options => + { + options.Audience = JwtUtil.Audience; + options.IncludeErrorDetails = true; + options.RequireHttpsMetadata = false; + options.TokenValidationParameters = JwtUtil.GetTokenValidationParameters(); + options.Events = new JwtBearerEvents { - options.Audience = JwtUtil.Audience; - options.IncludeErrorDetails = true; - options.RequireHttpsMetadata = false; - options.TokenValidationParameters = JwtUtil.GetTokenValidationParameters(); - options.Events = new JwtBearerEvents + OnMessageReceived = _ => Task.CompletedTask, + OnAuthenticationFailed = ctx => { - OnMessageReceived = _ => Task.CompletedTask, - OnAuthenticationFailed = ctx => - { - ctx.Response.StatusCode = StatusCodes.Status401Unauthorized; - ctx.Fail(ctx.Exception); - return Task.CompletedTask; - }, - OnForbidden = ctx => - { - ctx.Response.StatusCode = StatusCodes.Status403Forbidden; - ctx.Fail(nameof(HttpStatusCode.Forbidden)); - return Task.CompletedTask; - }, - }; - }); - } + ctx.Response.StatusCode = StatusCodes.Status401Unauthorized; + ctx.Fail(ctx.Exception); + return Task.CompletedTask; + }, + OnForbidden = ctx => + { + ctx.Response.StatusCode = StatusCodes.Status403Forbidden; + ctx.Fail(nameof(HttpStatusCode.Forbidden)); + return Task.CompletedTask; + }, + }; + }); + } - /// - /// Configures the default application settings. - /// - /// The application builder. - private void ConfigureAppDefaults(IApplicationBuilder app) + /// + /// Configures the default application settings. + /// + /// The application builder. + private void ConfigureAppDefaults(IApplicationBuilder app) + { + if (_setupAuthorization) { - if (_setupAuthorization) - { - app.UseAuthentication(); - } - - app.UseExceptionHandler(); - app.UseDeveloperExceptionPage(); - app.UseWebSockets(); - app.UseRouting(); + app.UseAuthentication(); + } - if (_setupAuthorization) - { - app.UseAuthorization(); - } + app.UseExceptionHandler(); + app.UseDeveloperExceptionPage(); + app.UseWebSockets(); + app.UseRouting(); - app.UseEndpoints(endpoints => endpoints.MapGraphQL().WithOptions(new GraphQLServerOptions - { - Tool = { Enable = true }, - })); + if (_setupAuthorization) + { + app.UseAuthorization(); } + + app.UseEndpoints(endpoints => endpoints.MapGraphQL().WithOptions(new GraphQLServerOptions + { + Tool = { Enable = true }, + })); } } diff --git a/tests/RxDBDotNet.Tests/DocumentExtensionsTests.cs b/tests/RxDBDotNet.Tests/DocumentExtensionsTests.cs index 1ee1e0c..36b988b 100644 --- a/tests/RxDBDotNet.Tests/DocumentExtensionsTests.cs +++ b/tests/RxDBDotNet.Tests/DocumentExtensionsTests.cs @@ -5,47 +5,46 @@ using RxDBDotNet.Documents; using RxDBDotNet.Extensions; -namespace RxDBDotNet.Tests +namespace RxDBDotNet.Tests; + +public class DocumentExtensionsTests { - public class DocumentExtensionsTests + [Fact] + public void GetGraphQLTypeName_WithGraphQLNameAttribute_ShouldReturnAttributeName() { - [Fact] - public void GetGraphQLTypeName_WithGraphQLNameAttribute_ShouldReturnAttributeName() - { - // Arrange - // Act - var result = DocumentExtensions.GetGraphQLTypeName(); + // Arrange + // Act + var result = DocumentExtensions.GetGraphQLTypeName(); - // Assert - result.Should().Be("CustomTypeName"); - } + // Assert + result.Should().Be("CustomTypeName"); + } - [Fact] - public void GetGraphQLTypeName_WithoutGraphQLNameAttribute_ShouldReturnClassName() - { - // Arrange - // Act - var result = DocumentExtensions.GetGraphQLTypeName(); + [Fact] + public void GetGraphQLTypeName_WithoutGraphQLNameAttribute_ShouldReturnClassName() + { + // Arrange + // Act + var result = DocumentExtensions.GetGraphQLTypeName(); - // Assert - result.Should().Be("DocumentWithoutAttribute"); - } + // Assert + result.Should().Be("DocumentWithoutAttribute"); + } - [GraphQLName("CustomTypeName")] - private class DocumentWithAttribute : IReplicatedDocument - { - public Guid Id { get; set; } - public DateTimeOffset UpdatedAt { get; set; } - public bool IsDeleted { get; set; } - public List? Topics { get; set; } - } + [GraphQLName("CustomTypeName")] + private class DocumentWithAttribute : IReplicatedDocument + { + public Guid Id { get; set; } + public DateTimeOffset UpdatedAt { get; set; } + public bool IsDeleted { get; set; } + public List? Topics { get; set; } + } - private class DocumentWithoutAttribute : IReplicatedDocument - { - public Guid Id { get; set; } - public DateTimeOffset UpdatedAt { get; set; } - public bool IsDeleted { get; set; } - public List? Topics { get; set; } - } + private class DocumentWithoutAttribute : IReplicatedDocument + { + public Guid Id { get; set; } + public DateTimeOffset UpdatedAt { get; set; } + public bool IsDeleted { get; set; } + public List? Topics { get; set; } } } diff --git a/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs b/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs index 9cb1064..08daaad 100644 --- a/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs +++ b/tests/RxDBDotNet.Tests/Model/GraphQLTestModel.cs @@ -1,6 +1,6 @@ -// This file has been auto generated. -#pragma warning disable 8618 - +// This file has been auto generated. +#pragma warning disable 8618 + using System; using System.Collections; using System.Collections.Generic; @@ -15,3344 +15,3344 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; #endif - -namespace RxDBDotNet.Tests.Model -{ - #region base classes - public struct GraphQlFieldMetadata - { - public string Name { get; set; } - public string DefaultAlias { get; set; } - public bool IsComplex { get; set; } - public bool RequiresParameters { get; set; } - public global::System.Type QueryBuilderType { get; set; } - } - - public enum Formatting - { - None, - Indented - } - - public class GraphQlObjectTypeAttribute : global::System.Attribute - { - public string TypeName { get; } - - public GraphQlObjectTypeAttribute(string typeName) => TypeName = typeName; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - public class QueryBuilderParameterConverter : global::Newtonsoft.Json.JsonConverter - { - public override object ReadJson(JsonReader reader, global::System.Type objectType, object existingValue, JsonSerializer serializer) - { - switch (reader.TokenType) - { - case JsonToken.Null: - return null; - - default: - return (QueryBuilderParameter)(T)serializer.Deserialize(reader, typeof(T)); - } - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - if (value == null) - writer.WriteNull(); - else - serializer.Serialize(writer, ((QueryBuilderParameter)value).Value, typeof(T)); - } - - public override bool CanConvert(global::System.Type objectType) => objectType.IsSubclassOf(typeof(QueryBuilderParameter)); - } - - public class GraphQlInterfaceJsonConverter : global::Newtonsoft.Json.JsonConverter - { - private const string FieldNameType = "__typename"; - - private static readonly Dictionary InterfaceTypeMapping = - typeof(GraphQlInterfaceJsonConverter).Assembly.GetTypes() - .Select(t => new { Type = t, Attribute = t.GetCustomAttribute() }) - .Where(x => x.Attribute != null && x.Type.Namespace == typeof(GraphQlInterfaceJsonConverter).Namespace) - .ToDictionary(x => x.Attribute.TypeName, x => x.Type); - - public override bool CanConvert(global::System.Type objectType) => objectType.IsInterface || objectType.IsArray; - - public override object ReadJson(JsonReader reader, global::System.Type objectType, object existingValue, JsonSerializer serializer) - { - while (reader.TokenType == JsonToken.Comment) - reader.Read(); - - switch (reader.TokenType) - { - case JsonToken.Null: - return null; - - case JsonToken.StartObject: - var jObject = JObject.Load(reader); - if (!jObject.TryGetValue(FieldNameType, out var token) || token.Type != JTokenType.String) - throw CreateJsonReaderException(reader, $"\"{GetType().FullName}\" requires JSON object to contain \"{FieldNameType}\" field with type name"); - - var typeName = token.Value(); - if (!InterfaceTypeMapping.TryGetValue(typeName, out var type)) - throw CreateJsonReaderException(reader, $"type \"{typeName}\" not found"); - - using (reader = CloneReader(jObject, reader)) - return serializer.Deserialize(reader, type); - - case JsonToken.StartArray: - var elementType = GetElementType(objectType); - if (elementType == null) - throw CreateJsonReaderException(reader, $"array element type could not be resolved for type \"{objectType.FullName}\""); - - return ReadArray(reader, objectType, elementType, serializer); - - default: - throw CreateJsonReaderException(reader, $"unrecognized token: {reader.TokenType}"); - } - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) => serializer.Serialize(writer, value); - - private static JsonReader CloneReader(JToken jToken, JsonReader reader) - { - var jObjectReader = jToken.CreateReader(); - jObjectReader.Culture = reader.Culture; - jObjectReader.CloseInput = reader.CloseInput; - jObjectReader.SupportMultipleContent = reader.SupportMultipleContent; - jObjectReader.DateTimeZoneHandling = reader.DateTimeZoneHandling; - jObjectReader.FloatParseHandling = reader.FloatParseHandling; - jObjectReader.DateFormatString = reader.DateFormatString; - jObjectReader.DateParseHandling = reader.DateParseHandling; - return jObjectReader; - } - - private static JsonReaderException CreateJsonReaderException(JsonReader reader, string message) - { - if (reader is IJsonLineInfo lineInfo && lineInfo.HasLineInfo()) - return new JsonReaderException(message, reader.Path, lineInfo.LineNumber, lineInfo.LinePosition, null); - - return new JsonReaderException(message); - } - - private static global::System.Type GetElementType(global::System.Type arrayOrGenericContainer) => - arrayOrGenericContainer.IsArray ? arrayOrGenericContainer.GetElementType() : arrayOrGenericContainer.GenericTypeArguments.FirstOrDefault(); - - private IList ReadArray(JsonReader reader, global::System.Type targetType, global::System.Type elementType, JsonSerializer serializer) - { - var list = CreateCompatibleList(targetType, elementType); - while (reader.Read() && reader.TokenType != JsonToken.EndArray) - list.Add(ReadJson(reader, elementType, null, serializer)); - - if (!targetType.IsArray) - return list; - - var array = Array.CreateInstance(elementType, list.Count); - list.CopyTo(array, 0); - return array; - } - - private static IList CreateCompatibleList(global::System.Type targetContainerType, global::System.Type elementType) => - (IList)Activator.CreateInstance(targetContainerType.IsArray || targetContainerType.IsAbstract ? typeof(List<>).MakeGenericType(elementType) : targetContainerType); - } - #endif - - internal static class GraphQlQueryHelper - { - private static readonly Regex RegexGraphQlIdentifier = new Regex(@"^[_A-Za-z][_0-9A-Za-z]*$", RegexOptions.Compiled); - private static readonly Regex RegexEscapeGraphQlString = new Regex(@"[\\\""/\b\f\n\r\t]", RegexOptions.Compiled); - - public static string GetIndentation(int level, byte indentationSize) - { - return new String(' ', level * indentationSize); - } - - public static string EscapeGraphQlStringValue(string value) - { - return RegexEscapeGraphQlString.Replace(value, m => @$"\{GetEscapeSequence(m.Value)}"); - } - - private static string GetEscapeSequence(string input) - { - switch (input) - { - case "\\": - return "\\"; - case "\"": - return "\""; - case "/": - return "/"; - case "\b": - return "b"; - case "\f": - return "f"; - case "\n": - return "n"; - case "\r": - return "r"; - case "\t": - return "t"; - default: - throw new InvalidOperationException($"invalid character: {input}"); - } - } - - public static string BuildArgumentValue(object value, string formatMask, GraphQlBuilderOptions options, int level) - { - var serializer = options.ArgumentBuilder ?? DefaultGraphQlArgumentBuilder.Instance; - if (serializer.TryBuild(new GraphQlArgumentBuilderContext { Value = value, FormatMask = formatMask, Options = options, Level = level }, out var serializedValue)) - return serializedValue; - - if (value is null) - return "null"; - - var enumerable = value as IEnumerable; - if (!String.IsNullOrEmpty(formatMask) && enumerable == null) - return - value is IFormattable formattable - ? $"\"{EscapeGraphQlStringValue(formattable.ToString(formatMask, CultureInfo.InvariantCulture))}\"" - : throw new ArgumentException($"Value must implement {nameof(IFormattable)} interface to use a format mask. ", nameof(value)); - - if (value is Enum @enum) - return ConvertEnumToString(@enum); - - if (value is bool @bool) - return @bool ? "true" : "false"; - - if (value is DateTime dateTime) - return $"\"{dateTime.ToString("O")}\""; - - if (value is DateTimeOffset dateTimeOffset) - return $"\"{dateTimeOffset.ToString("O")}\""; - - if (value is IGraphQlInputObject inputObject) - return BuildInputObject(inputObject, options, level + 2); - - if (value is Guid) - return $"\"{value}\""; - - if (value is String @string) - return $"\"{EscapeGraphQlStringValue(@string)}\""; - - if (enumerable != null) - return BuildEnumerableArgument(enumerable, formatMask, options, level, '[', ']'); - - if (value is short || value is ushort || value is byte || value is int || value is uint || value is long || value is ulong || value is float || value is double || value is decimal) - return Convert.ToString(value, CultureInfo.InvariantCulture); - - var argumentValue = EscapeGraphQlStringValue(Convert.ToString(value, CultureInfo.InvariantCulture)); - return $"\"{argumentValue}\""; - } - - public static string BuildEnumerableArgument(IEnumerable enumerable, string formatMask, GraphQlBuilderOptions options, int level, char openingSymbol, char closingSymbol) - { - var builder = new StringBuilder(); - builder.Append(openingSymbol); - var delimiter = String.Empty; - foreach (var item in enumerable) - { - builder.Append(delimiter); - - if (options.Formatting == Formatting.Indented) - { - builder.AppendLine(); - builder.Append(GetIndentation(level + 1, options.IndentationSize)); - } - - builder.Append(BuildArgumentValue(item, formatMask, options, level)); - delimiter = ","; - } - - builder.Append(closingSymbol); - return builder.ToString(); - } - - public static string BuildInputObject(IGraphQlInputObject inputObject, GraphQlBuilderOptions options, int level) - { - var builder = new StringBuilder(); - builder.Append("{"); - - var isIndentedFormatting = options.Formatting == Formatting.Indented; - string valueSeparator; - if (isIndentedFormatting) - { - builder.AppendLine(); - valueSeparator = ": "; - } - else - valueSeparator = ":"; - - var separator = String.Empty; - foreach (var propertyValue in inputObject.GetPropertyValues()) - { - var queryBuilderParameter = propertyValue.Value as QueryBuilderParameter; - var value = - queryBuilderParameter?.Name != null - ? $"${queryBuilderParameter.Name}" - : BuildArgumentValue(queryBuilderParameter == null ? propertyValue.Value : queryBuilderParameter.Value, propertyValue.FormatMask, options, level); - - builder.Append(isIndentedFormatting ? GetIndentation(level, options.IndentationSize) : separator); - builder.Append(propertyValue.Name); - builder.Append(valueSeparator); - builder.Append(value); - - separator = ","; - - if (isIndentedFormatting) - builder.AppendLine(); - } - - if (isIndentedFormatting) - builder.Append(GetIndentation(level - 1, options.IndentationSize)); - - builder.Append("}"); - - return builder.ToString(); - } - - public static string BuildDirective(GraphQlDirective directive, GraphQlBuilderOptions options, int level) - { - if (directive == null) - return String.Empty; - - var isIndentedFormatting = options.Formatting == Formatting.Indented; - var indentationSpace = isIndentedFormatting ? " " : String.Empty; - var builder = new StringBuilder(); - builder.Append(indentationSpace); - builder.Append("@"); - builder.Append(directive.Name); - builder.Append("("); - - string separator = null; - foreach (var kvp in directive.Arguments) - { - var argumentName = kvp.Key; - var argument = kvp.Value; - - builder.Append(separator); - builder.Append(argumentName); - builder.Append(":"); - builder.Append(indentationSpace); - - if (argument.Name == null) - builder.Append(BuildArgumentValue(argument.Value, null, options, level)); - else - { - builder.Append("$"); - builder.Append(argument.Name); - } - - separator = isIndentedFormatting ? ", " : ","; - } - - builder.Append(")"); - return builder.ToString(); - } - - public static void ValidateGraphQlIdentifier(string name, string identifier) - { - if (identifier != null && !RegexGraphQlIdentifier.IsMatch(identifier)) - throw new ArgumentException("value must match " + RegexGraphQlIdentifier, name); - } - - private static string ConvertEnumToString(Enum @enum) - { - var enumMember = @enum.GetType().GetField(@enum.ToString()); - if (enumMember == null) - throw new InvalidOperationException("enum member resolution failed"); - - var enumMemberAttribute = (EnumMemberAttribute)enumMember.GetCustomAttribute(typeof(EnumMemberAttribute)); - - return enumMemberAttribute == null - ? @enum.ToString() - : enumMemberAttribute.Value; - } - } - - public interface IGraphQlArgumentBuilder - { - bool TryBuild(GraphQlArgumentBuilderContext context, out string graphQlString); - } - - public class GraphQlArgumentBuilderContext - { - public object Value { get; set; } - public string FormatMask { get; set; } - public GraphQlBuilderOptions Options { get; set; } - public int Level { get; set; } - } - - public class DefaultGraphQlArgumentBuilder : IGraphQlArgumentBuilder - { - private static readonly Regex RegexWhiteSpace = new Regex(@"\s", RegexOptions.Compiled); - - public static readonly DefaultGraphQlArgumentBuilder Instance = new(); - - public bool TryBuild(GraphQlArgumentBuilderContext context, out string graphQlString) - { - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - if (context.Value is JValue jValue) - { - switch (jValue.Type) - { - case JTokenType.Null: - graphQlString = "null"; - return true; - - case JTokenType.Integer: - case JTokenType.Float: - case JTokenType.Boolean: - graphQlString = GraphQlQueryHelper.BuildArgumentValue(jValue.Value, null, context.Options, context.Level); - return true; - - case JTokenType.String: - graphQlString = $"\"{GraphQlQueryHelper.EscapeGraphQlStringValue((string)jValue.Value)}\""; - return true; - - default: - graphQlString = $"\"{jValue.Value}\""; - return true; - } - } - - if (context.Value is JProperty jProperty) - { - if (RegexWhiteSpace.IsMatch(jProperty.Name)) - throw new ArgumentException($"JSON object keys used as GraphQL arguments must not contain whitespace; key: {jProperty.Name}"); - - graphQlString = $"{jProperty.Name}:{(context.Options.Formatting == Formatting.Indented ? " " : null)}{GraphQlQueryHelper.BuildArgumentValue(jProperty.Value, null, context.Options, context.Level)}"; - return true; - } - - if (context.Value is JObject jObject) - { - graphQlString = GraphQlQueryHelper.BuildEnumerableArgument(jObject, null, context.Options, context.Level + 1, '{', '}'); - return true; - } - #endif - - graphQlString = null; - return false; - } - } - - internal struct InputPropertyInfo - { - public string Name { get; set; } - public object Value { get; set; } - public string FormatMask { get; set; } - } - - internal interface IGraphQlInputObject - { - IEnumerable GetPropertyValues(); - } - - public interface IGraphQlQueryBuilder - { - void Clear(); - void IncludeAllFields(); - string Build(Formatting formatting = Formatting.None, byte indentationSize = 2); - } - - public struct QueryBuilderArgumentInfo - { - public string ArgumentName { get; set; } - public QueryBuilderParameter ArgumentValue { get; set; } - public string FormatMask { get; set; } - } - - public abstract class QueryBuilderParameter - { - private string _name; - - internal string GraphQlTypeName { get; } - internal object Value { get; set; } - - public string Name - { - get => _name; - set - { - GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(Name), value); - _name = value; - } - } - - protected QueryBuilderParameter(string name, string graphQlTypeName, object value) - { - Name = name?.Trim(); - GraphQlTypeName = graphQlTypeName?.Replace(" ", null).Replace("\t", null).Replace("\n", null).Replace("\r", null); - Value = value; - } - - protected QueryBuilderParameter(object value) => Value = value; - } - - public class QueryBuilderParameter : QueryBuilderParameter - { - public new T Value - { - get => base.Value == null ? default : (T)base.Value; - set => base.Value = value; - } - - protected QueryBuilderParameter(string name, string graphQlTypeName, T value) : base(name, graphQlTypeName, value) - { - EnsureGraphQlTypeName(graphQlTypeName); - } - - protected QueryBuilderParameter(string name, string graphQlTypeName) : base(name, graphQlTypeName, null) - { - EnsureGraphQlTypeName(graphQlTypeName); - } - - private QueryBuilderParameter(T value) : base(value) - { - } - - public void ResetValue() => base.Value = null; - - public static implicit operator QueryBuilderParameter(T value) => new QueryBuilderParameter(value); - - public static implicit operator T(QueryBuilderParameter parameter) => parameter.Value; - - private static void EnsureGraphQlTypeName(string graphQlTypeName) - { - if (String.IsNullOrWhiteSpace(graphQlTypeName)) - throw new ArgumentException("value required", nameof(graphQlTypeName)); - } - } - - public class GraphQlQueryParameter : QueryBuilderParameter - { - private string _formatMask; - - public string FormatMask - { - get => _formatMask; - set => _formatMask = - typeof(IFormattable).IsAssignableFrom(typeof(T)) - ? value - : throw new InvalidOperationException($"Value must be of {nameof(IFormattable)} type. "); - } - - public GraphQlQueryParameter(string name, string graphQlTypeName = null) - : base(name, graphQlTypeName ?? GetGraphQlTypeName(typeof(T))) - { - } - - public GraphQlQueryParameter(string name, string graphQlTypeName, T defaultValue) - : base(name, graphQlTypeName, defaultValue) - { - } - - public GraphQlQueryParameter(string name, T defaultValue, bool isNullable = true) - : base(name, GetGraphQlTypeName(typeof(T), isNullable), defaultValue) - { - } - - private static string GetGraphQlTypeName(global::System.Type valueType, bool isNullable) - { - var graphQlTypeName = GetGraphQlTypeName(valueType); - if (!isNullable) - graphQlTypeName += "!"; - - return graphQlTypeName; - } - - private static string GetGraphQlTypeName(global::System.Type valueType) - { - var nullableUnderlyingType = Nullable.GetUnderlyingType(valueType); - valueType = nullableUnderlyingType ?? valueType; - - if (valueType.IsArray) - { - var arrayItemType = GetGraphQlTypeName(valueType.GetElementType()); - return arrayItemType == null ? null : "[" + arrayItemType + "]"; - } - - if (typeof(IEnumerable).IsAssignableFrom(valueType)) - { - var genericArguments = valueType.GetGenericArguments(); - if (genericArguments.Length == 1) - { - var listItemType = GetGraphQlTypeName(valueType.GetGenericArguments()[0]); - return listItemType == null ? null : "[" + listItemType + "]"; - } - } - - if (GraphQlTypes.ReverseMapping.TryGetValue(valueType, out var graphQlTypeName)) - return graphQlTypeName; - - if (valueType == typeof(string)) - return "String"; - - var nullableSuffix = nullableUnderlyingType == null ? null : "?"; - graphQlTypeName = GetValueTypeGraphQlTypeName(valueType); - return graphQlTypeName == null ? null : graphQlTypeName + nullableSuffix; - } - - private static string GetValueTypeGraphQlTypeName(global::System.Type valueType) - { - if (valueType == typeof(bool)) - return "Boolean"; - - if (valueType == typeof(float) || valueType == typeof(double) || valueType == typeof(decimal)) - return "Float"; - - if (valueType == typeof(Guid)) - return "ID"; - - if (valueType == typeof(sbyte) || valueType == typeof(byte) || valueType == typeof(short) || valueType == typeof(ushort) || valueType == typeof(int) || valueType == typeof(uint) || - valueType == typeof(long) || valueType == typeof(ulong)) - return "Int"; - - return null; - } - } - - public abstract class GraphQlDirective - { - private readonly Dictionary _arguments = new Dictionary(); - - internal IEnumerable> Arguments => _arguments; - - public string Name { get; } - - protected GraphQlDirective(string name) - { - GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(name), name); - Name = name; - } - - protected void AddArgument(string name, QueryBuilderParameter value) - { - if (value != null) - _arguments[name] = value; - } - } - - public class GraphQlBuilderOptions - { - public Formatting Formatting { get; set; } - public byte IndentationSize { get; set; } = 2; - public IGraphQlArgumentBuilder ArgumentBuilder { get; set; } - } - - public abstract partial class GraphQlQueryBuilder : IGraphQlQueryBuilder - { - private readonly Dictionary _fieldCriteria = new Dictionary(); - - private readonly string _operationType; - private readonly string _operationName; - private Dictionary _fragments; - private List _queryParameters; - - protected abstract string TypeName { get; } - - public abstract IReadOnlyList AllFields { get; } - - protected GraphQlQueryBuilder(string operationType, string operationName) - { - GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(operationName), operationName); - _operationType = operationType; - _operationName = operationName; - } - - public virtual void Clear() - { - _fieldCriteria.Clear(); - _fragments?.Clear(); - _queryParameters?.Clear(); - } - - void IGraphQlQueryBuilder.IncludeAllFields() - { - IncludeAllFields(); - } - - public string Build(Formatting formatting = Formatting.None, byte indentationSize = 2) - { - return Build(new GraphQlBuilderOptions { Formatting = formatting, IndentationSize = indentationSize }); - } - - public string Build(GraphQlBuilderOptions options) - { - return Build(options, 1); - } - - protected void IncludeAllFields() - { - IncludeFields(AllFields.Where(f => !f.RequiresParameters)); - } - - protected virtual string Build(GraphQlBuilderOptions options, int level) - { - var isIndentedFormatting = options.Formatting == Formatting.Indented; - var separator = String.Empty; - var indentationSpace = isIndentedFormatting ? " " : String.Empty; - var builder = new StringBuilder(); - - BuildOperationSignature(builder, options, indentationSpace, level); - - if (builder.Length > 0 || level > 1) - builder.Append(indentationSpace); - - builder.Append("{"); - - if (isIndentedFormatting) - builder.AppendLine(); - - separator = String.Empty; - - foreach (var criteria in _fieldCriteria.Values.Concat(_fragments?.Values ?? Enumerable.Empty())) - { - var fieldCriteria = criteria.Build(options, level); - if (isIndentedFormatting) - builder.AppendLine(fieldCriteria); - else if (!String.IsNullOrEmpty(fieldCriteria)) - { - builder.Append(separator); - builder.Append(fieldCriteria); - } - - separator = ","; - } - - if (isIndentedFormatting) - builder.Append(GraphQlQueryHelper.GetIndentation(level - 1, options.IndentationSize)); - - builder.Append("}"); - - return builder.ToString(); - } - - private void BuildOperationSignature(StringBuilder builder, GraphQlBuilderOptions options, string indentationSpace, int level) - { - if (String.IsNullOrEmpty(_operationType)) - return; - - builder.Append(_operationType); - - if (!String.IsNullOrEmpty(_operationName)) - { - builder.Append(" "); - builder.Append(_operationName); - } - - if (_queryParameters?.Count > 0) - { - builder.Append(indentationSpace); - builder.Append("("); - - var separator = String.Empty; - var isIndentedFormatting = options.Formatting == Formatting.Indented; - - foreach (var queryParameterInfo in _queryParameters) - { - if (isIndentedFormatting) - { - builder.AppendLine(separator); - builder.Append(GraphQlQueryHelper.GetIndentation(level, options.IndentationSize)); - } - else - builder.Append(separator); - - builder.Append("$"); - builder.Append(queryParameterInfo.ArgumentValue.Name); - builder.Append(":"); - builder.Append(indentationSpace); - - builder.Append(queryParameterInfo.ArgumentValue.GraphQlTypeName); - - if (!queryParameterInfo.ArgumentValue.GraphQlTypeName.EndsWith("!") && queryParameterInfo.ArgumentValue.Value is not null) - { - builder.Append(indentationSpace); - builder.Append("="); - builder.Append(indentationSpace); - builder.Append(GraphQlQueryHelper.BuildArgumentValue(queryParameterInfo.ArgumentValue.Value, queryParameterInfo.FormatMask, options, 0)); - } - - if (!isIndentedFormatting) - separator = ","; - } - - builder.Append(")"); - } - } - - protected void IncludeScalarField(string fieldName, string alias, IList args, GraphQlDirective[] directives) - { - _fieldCriteria[alias ?? fieldName] = new GraphQlScalarFieldCriteria(fieldName, alias, args, directives); - } - - protected void IncludeObjectField(string fieldName, string alias, GraphQlQueryBuilder objectFieldQueryBuilder, IList args, GraphQlDirective[] directives) - { - _fieldCriteria[alias ?? fieldName] = new GraphQlObjectFieldCriteria(fieldName, alias, objectFieldQueryBuilder, args, directives); - } - - protected void IncludeFragment(GraphQlQueryBuilder objectFieldQueryBuilder, GraphQlDirective[] directives) - { - _fragments = _fragments ?? new Dictionary(); - _fragments[objectFieldQueryBuilder.TypeName] = new GraphQlFragmentCriteria(objectFieldQueryBuilder, directives); - } - - protected void ExcludeField(string fieldName) - { - if (fieldName == null) - throw new ArgumentNullException(nameof(fieldName)); - - _fieldCriteria.Remove(fieldName); - } - - protected void IncludeFields(IEnumerable fields) - { - IncludeFields(fields, 0, new Dictionary()); - } - - private void IncludeFields(IEnumerable fields, int level, Dictionary parentTypeLevel) - { - global::System.Type builderType = null; - - foreach (var field in fields) - { - if (field.QueryBuilderType == null) - IncludeScalarField(field.Name, field.DefaultAlias, null, null); - else - { - if (_operationType != null && GetType() == field.QueryBuilderType || - parentTypeLevel.TryGetValue(field.QueryBuilderType, out var parentLevel) && parentLevel < level) - continue; - - if (builderType is null) - { - builderType = GetType(); - parentLevel = parentTypeLevel.TryGetValue(builderType, out parentLevel) ? parentLevel : level; - parentTypeLevel[builderType] = Math.Min(level, parentLevel); - } - - var queryBuilder = InitializeChildQueryBuilder(builderType, field.QueryBuilderType, level, parentTypeLevel); - - var includeFragmentMethods = field.QueryBuilderType.GetMethods().Where(IsIncludeFragmentMethod); - - foreach (var includeFragmentMethod in includeFragmentMethods) - includeFragmentMethod.Invoke( - queryBuilder, - new object[] { InitializeChildQueryBuilder(builderType, includeFragmentMethod.GetParameters()[0].ParameterType, level, parentTypeLevel) }); - - if (queryBuilder._fieldCriteria.Count > 0 || queryBuilder._fragments != null) - IncludeObjectField(field.Name, field.DefaultAlias, queryBuilder, null, null); - } - } - } - - private static GraphQlQueryBuilder InitializeChildQueryBuilder(global::System.Type parentQueryBuilderType, global::System.Type queryBuilderType, int level, Dictionary parentTypeLevel) - { - var queryBuilder = (GraphQlQueryBuilder)Activator.CreateInstance(queryBuilderType); - queryBuilder.IncludeFields( - queryBuilder.AllFields.Where(f => !f.RequiresParameters), - level + 1, - parentTypeLevel); - - return queryBuilder; - } - - private static bool IsIncludeFragmentMethod(MethodInfo methodInfo) - { - if (!methodInfo.Name.StartsWith("With") || !methodInfo.Name.EndsWith("Fragment")) - return false; - - var parameters = methodInfo.GetParameters(); - return parameters.Length == 1 && parameters[0].ParameterType.IsSubclassOf(typeof(GraphQlQueryBuilder)); - } - - protected void AddParameter(GraphQlQueryParameter parameter) - { - if (_queryParameters == null) - _queryParameters = new List(); - - _queryParameters.Add(new QueryBuilderArgumentInfo { ArgumentValue = parameter, FormatMask = parameter.FormatMask }); - } - - private abstract class GraphQlFieldCriteria - { - private readonly IList _args; - private readonly GraphQlDirective[] _directives; - - protected readonly string FieldName; - protected readonly string Alias; - - protected static string GetIndentation(Formatting formatting, int level, byte indentationSize) => - formatting == Formatting.Indented ? GraphQlQueryHelper.GetIndentation(level, indentationSize) : null; - - protected GraphQlFieldCriteria(string fieldName, string alias, IList args, GraphQlDirective[] directives) - { - GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(alias), alias); - FieldName = fieldName; - Alias = alias; - _args = args; - _directives = directives; - } - - public abstract string Build(GraphQlBuilderOptions options, int level); - - protected string BuildArgumentClause(GraphQlBuilderOptions options, int level) - { - var separator = options.Formatting == Formatting.Indented ? " " : null; - var argumentCount = _args?.Count ?? 0; - if (argumentCount == 0) - return String.Empty; - - var arguments = - _args.Select( - a => $"{a.ArgumentName}:{separator}{(a.ArgumentValue.Name == null ? GraphQlQueryHelper.BuildArgumentValue(a.ArgumentValue.Value, a.FormatMask, options, level) : $"${a.ArgumentValue.Name}")}"); - - return $"({String.Join($",{separator}", arguments)})"; - } - - protected string BuildDirectiveClause(GraphQlBuilderOptions options, int level) => - _directives == null ? null : String.Concat(_directives.Select(d => d == null ? null : GraphQlQueryHelper.BuildDirective(d, options, level))); - - protected static string BuildAliasPrefix(string alias, Formatting formatting) - { - var separator = formatting == Formatting.Indented ? " " : String.Empty; - return String.IsNullOrWhiteSpace(alias) ? null : $"{alias}:{separator}"; - } - } - - private class GraphQlScalarFieldCriteria : GraphQlFieldCriteria - { - public GraphQlScalarFieldCriteria(string fieldName, string alias, IList args, GraphQlDirective[] directives) - : base(fieldName, alias, args, directives) - { - } - - public override string Build(GraphQlBuilderOptions options, int level) => - GetIndentation(options.Formatting, level, options.IndentationSize) + - BuildAliasPrefix(Alias, options.Formatting) + - FieldName + - BuildArgumentClause(options, level) + - BuildDirectiveClause(options, level); - } - - private class GraphQlObjectFieldCriteria : GraphQlFieldCriteria - { - private readonly GraphQlQueryBuilder _objectQueryBuilder; - - public GraphQlObjectFieldCriteria(string fieldName, string alias, GraphQlQueryBuilder objectQueryBuilder, IList args, GraphQlDirective[] directives) - : base(fieldName, alias, args, directives) - { - _objectQueryBuilder = objectQueryBuilder; - } - - public override string Build(GraphQlBuilderOptions options, int level) => - _objectQueryBuilder._fieldCriteria.Count > 0 || _objectQueryBuilder._fragments?.Count > 0 - ? GetIndentation(options.Formatting, level, options.IndentationSize) + BuildAliasPrefix(Alias, options.Formatting) + FieldName + - BuildArgumentClause(options, level) + BuildDirectiveClause(options, level) + _objectQueryBuilder.Build(options, level + 1) - : null; - } - - private class GraphQlFragmentCriteria : GraphQlFieldCriteria - { - private readonly GraphQlQueryBuilder _objectQueryBuilder; - - public GraphQlFragmentCriteria(GraphQlQueryBuilder objectQueryBuilder, GraphQlDirective[] directives) : base(objectQueryBuilder.TypeName, null, null, directives) - { - _objectQueryBuilder = objectQueryBuilder; - } - - public override string Build(GraphQlBuilderOptions options, int level) => - _objectQueryBuilder._fieldCriteria.Count == 0 - ? null - : GetIndentation(options.Formatting, level, options.IndentationSize) + "..." + (options.Formatting == Formatting.Indented ? " " : null) + "on " + - FieldName + BuildArgumentClause(options, level) + BuildDirectiveClause(options, level) + _objectQueryBuilder.Build(options, level + 1); - } - } - - public abstract partial class GraphQlQueryBuilder : GraphQlQueryBuilder where TQueryBuilder : GraphQlQueryBuilder - { - protected GraphQlQueryBuilder(string operationType = null, string operationName = null) : base(operationType, operationName) - { - } - - /// - /// Includes all fields that don't require parameters into the query. - /// - public TQueryBuilder WithAllFields() - { - IncludeAllFields(); - return (TQueryBuilder)this; - } - - /// - /// Includes all scalar fields that don't require parameters into the query. - /// - public TQueryBuilder WithAllScalarFields() - { - IncludeFields(AllFields.Where(f => !f.IsComplex && !f.RequiresParameters)); - return (TQueryBuilder)this; - } - - public TQueryBuilder ExceptField(string fieldName) - { - ExcludeField(fieldName); - return (TQueryBuilder)this; - } - - /// - /// Includes "__typename" field; included automatically for interface and union types. - /// - public TQueryBuilder WithTypeName(string alias = null, params GraphQlDirective[] directives) - { - IncludeScalarField("__typename", alias, null, directives); - return (TQueryBuilder)this; - } - - protected TQueryBuilder WithScalarField(string fieldName, string alias, GraphQlDirective[] directives, IList args = null) - { - IncludeScalarField(fieldName, alias, args, directives); - return (TQueryBuilder)this; - } - - protected TQueryBuilder WithObjectField(string fieldName, string alias, GraphQlQueryBuilder queryBuilder, GraphQlDirective[] directives, IList args = null) - { - IncludeObjectField(fieldName, alias, queryBuilder, args, directives); - return (TQueryBuilder)this; - } - - protected TQueryBuilder WithFragment(GraphQlQueryBuilder queryBuilder, GraphQlDirective[] directives) - { - IncludeFragment(queryBuilder, directives); - return (TQueryBuilder)this; - } - - protected TQueryBuilder WithParameterInternal(GraphQlQueryParameter parameter) - { - AddParameter(parameter); - return (TQueryBuilder)this; - } - } - - public abstract class GraphQlResponse - { - public TDataContract Data { get; set; } - public ICollection Errors { get; set; } - } - - public class GraphQlQueryError - { - public string Message { get; set; } - public ICollection Locations { get; set; } - } - - public class GraphQlErrorLocation - { - public int Line { get; set; } - public int Column { get; set; } - } - #endregion - - #region GraphQL type helpers - public static class GraphQlTypes - { - public const string Boolean = "Boolean"; - public const string DateTime = "DateTime"; - public const string EmailAddress = "EmailAddress"; - public const string Id = "ID"; - public const string Int = "Int"; - public const string String = "String"; - public const string Uuid = "UUID"; - - public const string UserRole = "UserRole"; - - public const string AuthenticationError = "AuthenticationError"; - public const string Checkpoint = "Checkpoint"; - public const string LiveDoc = "LiveDoc"; - public const string LiveDocPullBulk = "LiveDocPullBulk"; - public const string Mutation = "Mutation"; - public const string PushLiveDocPayload = "PushLiveDocPayload"; - public const string PushUserPayload = "PushUserPayload"; - public const string PushWorkspacePayload = "PushWorkspacePayload"; - public const string Query = "Query"; - public const string Subscription = "Subscription"; - public const string UnauthorizedAccessError = "UnauthorizedAccessError"; - public const string User = "User"; - public const string UserPullBulk = "UserPullBulk"; - public const string Workspace = "Workspace"; - public const string WorkspacePullBulk = "WorkspacePullBulk"; - - public const string BooleanOperationFilterInput = "BooleanOperationFilterInput"; - public const string DateTimeOperationFilterInput = "DateTimeOperationFilterInput"; - public const string ListStringOperationFilterInput = "ListStringOperationFilterInput"; - public const string LiveDocFilterInput = "LiveDocFilterInput"; - public const string LiveDocInput = "LiveDocInput"; - public const string LiveDocInputCheckpoint = "LiveDocInputCheckpoint"; - public const string LiveDocInputHeaders = "LiveDocInputHeaders"; - public const string LiveDocInputPushRow = "LiveDocInputPushRow"; - public const string PushLiveDocInput = "PushLiveDocInput"; - public const string PushUserInput = "PushUserInput"; - public const string PushWorkspaceInput = "PushWorkspaceInput"; - public const string StringOperationFilterInput = "StringOperationFilterInput"; - public const string UserFilterInput = "UserFilterInput"; - public const string UserInput = "UserInput"; - public const string UserInputCheckpoint = "UserInputCheckpoint"; - public const string UserInputHeaders = "UserInputHeaders"; - public const string UserInputPushRow = "UserInputPushRow"; - public const string UserRoleOperationFilterInput = "UserRoleOperationFilterInput"; - public const string UuidOperationFilterInput = "UuidOperationFilterInput"; - public const string WorkspaceFilterInput = "WorkspaceFilterInput"; - public const string WorkspaceInput = "WorkspaceInput"; - public const string WorkspaceInputCheckpoint = "WorkspaceInputCheckpoint"; - public const string WorkspaceInputHeaders = "WorkspaceInputHeaders"; - public const string WorkspaceInputPushRow = "WorkspaceInputPushRow"; - - public const string PushLiveDocError = "PushLiveDocError"; - public const string PushUserError = "PushUserError"; - public const string PushWorkspaceError = "PushWorkspaceError"; - - public const string Error = "Error"; - - public static readonly IReadOnlyDictionary ReverseMapping = - new Dictionary - { - { typeof(string), "String" }, - { typeof(Guid), "UUID" }, - { typeof(DateTimeOffset), "DateTime" }, - { typeof(bool), "Boolean" }, - { typeof(BooleanOperationFilterInputGql), "BooleanOperationFilterInput" }, - { typeof(DateTimeOperationFilterInputGql), "DateTimeOperationFilterInput" }, - { typeof(ListStringOperationFilterInputGql), "ListStringOperationFilterInput" }, - { typeof(LiveDocFilterInputGql), "LiveDocFilterInput" }, - { typeof(LiveDocInputGql), "LiveDocInput" }, - { typeof(LiveDocInputCheckpointGql), "LiveDocInputCheckpoint" }, - { typeof(LiveDocInputHeadersGql), "LiveDocInputHeaders" }, - { typeof(LiveDocInputPushRowGql), "LiveDocInputPushRow" }, - { typeof(PushLiveDocInputGql), "PushLiveDocInput" }, - { typeof(PushUserInputGql), "PushUserInput" }, - { typeof(PushWorkspaceInputGql), "PushWorkspaceInput" }, - { typeof(StringOperationFilterInputGql), "StringOperationFilterInput" }, - { typeof(UserFilterInputGql), "UserFilterInput" }, - { typeof(UserInputGql), "UserInput" }, - { typeof(UserInputCheckpointGql), "UserInputCheckpoint" }, - { typeof(UserInputHeadersGql), "UserInputHeaders" }, - { typeof(UserInputPushRowGql), "UserInputPushRow" }, - { typeof(UserRoleOperationFilterInputGql), "UserRoleOperationFilterInput" }, - { typeof(UuidOperationFilterInputGql), "UuidOperationFilterInput" }, - { typeof(WorkspaceFilterInputGql), "WorkspaceFilterInput" }, - { typeof(WorkspaceInputGql), "WorkspaceInput" }, - { typeof(WorkspaceInputCheckpointGql), "WorkspaceInputCheckpoint" }, - { typeof(WorkspaceInputHeadersGql), "WorkspaceInputHeaders" }, - { typeof(WorkspaceInputPushRowGql), "WorkspaceInputPushRow" } - }; -} - #endregion - - #region enums - public enum UserRoleGql - { - StandardUser, - WorkspaceAdmin, - SystemAdmin - } - #endregion - - #nullable enable - #region directives - public class SkipDirective : GraphQlDirective - { - public SkipDirective(QueryBuilderParameter @if) : base("skip") - { - AddArgument("if", @if); - } - } - - public class IncludeDirective : GraphQlDirective - { - public IncludeDirective(QueryBuilderParameter @if) : base("include") - { - AddArgument("if", @if); - } - } - #endregion - - #region builder classes - public partial class UserPullBulkQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(UserQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "UserPullBulk"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public UserPullBulkQueryBuilderGql WithDocuments(UserQueryBuilderGql userQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, userQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public UserPullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); - - public UserPullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public UserPullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); - } - - public partial class WorkspacePullBulkQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(WorkspaceQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "WorkspacePullBulk"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public WorkspacePullBulkQueryBuilderGql WithDocuments(WorkspaceQueryBuilderGql workspaceQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, workspaceQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public WorkspacePullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); - - public WorkspacePullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public WorkspacePullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); - } - - public partial class LiveDocPullBulkQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(LiveDocQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "LiveDocPullBulk"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public LiveDocPullBulkQueryBuilderGql WithDocuments(LiveDocQueryBuilderGql liveDocQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, liveDocQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public LiveDocPullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); - - public LiveDocPullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public LiveDocPullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); - } - - public partial class QueryQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "pullUser", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(UserPullBulkQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "pullWorkspace", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(WorkspacePullBulkQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "pullLiveDoc", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(LiveDocPullBulkQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "Query"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public QueryQueryBuilderGql(string? operationName = null) : base("query", operationName) - { - } - - public QueryQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); - - public QueryQueryBuilderGql WithPullUser(UserPullBulkQueryBuilderGql userPullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (checkpoint != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); - - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); - if (where != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); - - return WithObjectField("pullUser", alias, userPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public QueryQueryBuilderGql ExceptPullUser() => ExceptField("pullUser"); - - public QueryQueryBuilderGql WithPullWorkspace(WorkspacePullBulkQueryBuilderGql workspacePullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (checkpoint != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); - - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); - if (where != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); - - return WithObjectField("pullWorkspace", alias, workspacePullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public QueryQueryBuilderGql ExceptPullWorkspace() => ExceptField("pullWorkspace"); - - public QueryQueryBuilderGql WithPullLiveDoc(LiveDocPullBulkQueryBuilderGql liveDocPullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (checkpoint != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); - - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); - if (where != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); - - return WithObjectField("pullLiveDoc", alias, liveDocPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public QueryQueryBuilderGql ExceptPullLiveDoc() => ExceptField("pullLiveDoc"); - } - - public partial class MutationQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "pushUser", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushUserPayloadQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "pushWorkspace", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushWorkspacePayloadQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "pushLiveDoc", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushLiveDocPayloadQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "Mutation"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public MutationQueryBuilderGql(string? operationName = null) : base("mutation", operationName) - { - } - - public MutationQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); - - public MutationQueryBuilderGql WithPushUser(PushUserPayloadQueryBuilderGql pushUserPayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); - return WithObjectField("pushUser", alias, pushUserPayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public MutationQueryBuilderGql ExceptPushUser() => ExceptField("pushUser"); - - public MutationQueryBuilderGql WithPushWorkspace(PushWorkspacePayloadQueryBuilderGql pushWorkspacePayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); - return WithObjectField("pushWorkspace", alias, pushWorkspacePayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public MutationQueryBuilderGql ExceptPushWorkspace() => ExceptField("pushWorkspace"); - - public MutationQueryBuilderGql WithPushLiveDoc(PushLiveDocPayloadQueryBuilderGql pushLiveDocPayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); - return WithObjectField("pushLiveDoc", alias, pushLiveDocPayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public MutationQueryBuilderGql ExceptPushLiveDoc() => ExceptField("pushLiveDoc"); - } - - public partial class SubscriptionQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "streamUser", IsComplex = true, QueryBuilderType = typeof(UserPullBulkQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "streamWorkspace", IsComplex = true, QueryBuilderType = typeof(WorkspacePullBulkQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "streamLiveDoc", IsComplex = true, QueryBuilderType = typeof(LiveDocPullBulkQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "Subscription"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public SubscriptionQueryBuilderGql(string? operationName = null) : base("subscription", operationName) - { - } - - public SubscriptionQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); - - public SubscriptionQueryBuilderGql WithStreamUser(UserPullBulkQueryBuilderGql userPullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (headers != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); - - if (topics != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); - - return WithObjectField("streamUser", alias, userPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public SubscriptionQueryBuilderGql ExceptStreamUser() => ExceptField("streamUser"); - - public SubscriptionQueryBuilderGql WithStreamWorkspace(WorkspacePullBulkQueryBuilderGql workspacePullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (headers != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); - - if (topics != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); - - return WithObjectField("streamWorkspace", alias, workspacePullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public SubscriptionQueryBuilderGql ExceptStreamWorkspace() => ExceptField("streamWorkspace"); - - public SubscriptionQueryBuilderGql WithStreamLiveDoc(LiveDocPullBulkQueryBuilderGql liveDocPullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) - { - var args = new List(); - if (headers != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); - - if (topics != null) - args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); - - return WithObjectField("streamLiveDoc", alias, liveDocPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); - } - - public SubscriptionQueryBuilderGql ExceptStreamLiveDoc() => ExceptField("streamLiveDoc"); - } - - public partial class UserQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "firstName" }, - new GraphQlFieldMetadata { Name = "lastName" }, - new GraphQlFieldMetadata { Name = "fullName" }, - new GraphQlFieldMetadata { Name = "email" }, - new GraphQlFieldMetadata { Name = "role" }, - new GraphQlFieldMetadata { Name = "jwtAccessToken" }, - new GraphQlFieldMetadata { Name = "workspaceId" }, - new GraphQlFieldMetadata { Name = "id" }, - new GraphQlFieldMetadata { Name = "isDeleted" }, - new GraphQlFieldMetadata { Name = "updatedAt" }, - new GraphQlFieldMetadata { Name = "topics", IsComplex = true } - }; - - protected override string TypeName { get; } = "User"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public UserQueryBuilderGql WithFirstName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("firstName", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptFirstName() => ExceptField("firstName"); - - public UserQueryBuilderGql WithLastName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("lastName", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptLastName() => ExceptField("lastName"); - - public UserQueryBuilderGql WithFullName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("fullName", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptFullName() => ExceptField("fullName"); - - public UserQueryBuilderGql WithEmail(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("email", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptEmail() => ExceptField("email"); - - public UserQueryBuilderGql WithRole(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("role", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptRole() => ExceptField("role"); - - public UserQueryBuilderGql WithJwtAccessToken(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("jwtAccessToken", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptJwtAccessToken() => ExceptField("jwtAccessToken"); - - public UserQueryBuilderGql WithWorkspaceId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("workspaceId", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptWorkspaceId() => ExceptField("workspaceId"); - - public UserQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptId() => ExceptField("id"); - - public UserQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); - - public UserQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); - - public UserQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); - - public UserQueryBuilderGql ExceptTopics() => ExceptField("topics"); - } - - public partial class CheckpointQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "lastDocumentId" }, - new GraphQlFieldMetadata { Name = "updatedAt" } - }; - - protected override string TypeName { get; } = "Checkpoint"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public CheckpointQueryBuilderGql WithLastDocumentId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("lastDocumentId", alias, new GraphQlDirective?[] { skip, include }); - - public CheckpointQueryBuilderGql ExceptLastDocumentId() => ExceptField("lastDocumentId"); - - public CheckpointQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); - - public CheckpointQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); - } - - public partial class AuthenticationErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "message" } - }; - - protected override string TypeName { get; } = "AuthenticationError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public AuthenticationErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); - - public AuthenticationErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); - } - - public partial class UnauthorizedAccessErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "message" } - }; - - protected override string TypeName { get; } = "UnauthorizedAccessError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public UnauthorizedAccessErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); - - public UnauthorizedAccessErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); - } - - public partial class WorkspaceQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "name" }, - new GraphQlFieldMetadata { Name = "id" }, - new GraphQlFieldMetadata { Name = "isDeleted" }, - new GraphQlFieldMetadata { Name = "updatedAt" }, - new GraphQlFieldMetadata { Name = "topics", IsComplex = true } - }; - - protected override string TypeName { get; } = "Workspace"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public WorkspaceQueryBuilderGql WithName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("name", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptName() => ExceptField("name"); - - public WorkspaceQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptId() => ExceptField("id"); - - public WorkspaceQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); - - public WorkspaceQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); - - public WorkspaceQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); - - public WorkspaceQueryBuilderGql ExceptTopics() => ExceptField("topics"); - } - - public partial class LiveDocQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "content" }, - new GraphQlFieldMetadata { Name = "ownerId" }, - new GraphQlFieldMetadata { Name = "workspaceId" }, - new GraphQlFieldMetadata { Name = "id" }, - new GraphQlFieldMetadata { Name = "isDeleted" }, - new GraphQlFieldMetadata { Name = "updatedAt" }, - new GraphQlFieldMetadata { Name = "topics", IsComplex = true } - }; - - protected override string TypeName { get; } = "LiveDoc"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public LiveDocQueryBuilderGql WithContent(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("content", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptContent() => ExceptField("content"); - - public LiveDocQueryBuilderGql WithOwnerId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("ownerId", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptOwnerId() => ExceptField("ownerId"); - - public LiveDocQueryBuilderGql WithWorkspaceId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("workspaceId", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptWorkspaceId() => ExceptField("workspaceId"); - - public LiveDocQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptId() => ExceptField("id"); - - public LiveDocQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); - - public LiveDocQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); - - public LiveDocQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); - - public LiveDocQueryBuilderGql ExceptTopics() => ExceptField("topics"); - } - - public partial class ErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "message" } - }; - - public ErrorQueryBuilderGql() => WithTypeName(); - - protected override string TypeName { get; } = "Error"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public ErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); - - public ErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); - - public ErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public ErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - } - - public partial class PushUserErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); - - public PushUserErrorQueryBuilderGql() => WithTypeName(); - - protected override string TypeName { get; } = "PushUserError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushUserErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushUserErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - } - - public partial class PushUserPayloadQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "user", IsComplex = true, QueryBuilderType = typeof(UserQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushUserErrorQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "PushUserPayload"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushUserPayloadQueryBuilderGql WithUser(UserQueryBuilderGql userQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("user", alias, userQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushUserPayloadQueryBuilderGql ExceptUser() => ExceptField("user"); - - public PushUserPayloadQueryBuilderGql WithErrors(PushUserErrorQueryBuilderGql pushUserErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushUserErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushUserPayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); - } - - public partial class PushWorkspaceErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); - - public PushWorkspaceErrorQueryBuilderGql() => WithTypeName(); - - protected override string TypeName { get; } = "PushWorkspaceError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushWorkspaceErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushWorkspaceErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - } - - public partial class PushWorkspacePayloadQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "workspace", IsComplex = true, QueryBuilderType = typeof(WorkspaceQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushWorkspaceErrorQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "PushWorkspacePayload"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushWorkspacePayloadQueryBuilderGql WithWorkspace(WorkspaceQueryBuilderGql workspaceQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("workspace", alias, workspaceQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushWorkspacePayloadQueryBuilderGql ExceptWorkspace() => ExceptField("workspace"); - - public PushWorkspacePayloadQueryBuilderGql WithErrors(PushWorkspaceErrorQueryBuilderGql pushWorkspaceErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushWorkspaceErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushWorkspacePayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); - } - - public partial class PushLiveDocErrorQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); - - public PushLiveDocErrorQueryBuilderGql() => WithTypeName(); - - protected override string TypeName { get; } = "PushLiveDocError"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushLiveDocErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushLiveDocErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - } - - public partial class PushLiveDocPayloadQueryBuilderGql : GraphQlQueryBuilder - { - private static readonly GraphQlFieldMetadata[] AllFieldMetadata = - { - new GraphQlFieldMetadata { Name = "liveDoc", IsComplex = true, QueryBuilderType = typeof(LiveDocQueryBuilderGql) }, - new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushLiveDocErrorQueryBuilderGql) } - }; - - protected override string TypeName { get; } = "PushLiveDocPayload"; - - public override IReadOnlyList AllFields { get; } = AllFieldMetadata; - - public PushLiveDocPayloadQueryBuilderGql WithLiveDoc(LiveDocQueryBuilderGql liveDocQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("liveDoc", alias, liveDocQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushLiveDocPayloadQueryBuilderGql ExceptLiveDoc() => ExceptField("liveDoc"); - - public PushLiveDocPayloadQueryBuilderGql WithErrors(PushLiveDocErrorQueryBuilderGql pushLiveDocErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushLiveDocErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); - - public PushLiveDocPayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); - } - #endregion - - #region input classes - public partial class UserInputCheckpointGql : IGraphQlInputObject - { - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _lastDocumentId; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastDocumentId - { - get => (QueryBuilderParameter?)_lastDocumentId.Value; - set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_updatedAt.Name != null) yield return _updatedAt; - if (_lastDocumentId.Name != null) yield return _lastDocumentId; - } - } - - public partial class UserInputPushRowGql : IGraphQlInputObject - { - private InputPropertyInfo _assumedMasterState; - private InputPropertyInfo _newDocumentState; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? AssumedMasterState - { - get => (QueryBuilderParameter?)_assumedMasterState.Value; - set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NewDocumentState - { - get => (QueryBuilderParameter?)_newDocumentState.Value; - set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_assumedMasterState.Name != null) yield return _assumedMasterState; - if (_newDocumentState.Name != null) yield return _newDocumentState; - } - } - - public partial class WorkspaceInputCheckpointGql : IGraphQlInputObject - { - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _lastDocumentId; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastDocumentId - { - get => (QueryBuilderParameter?)_lastDocumentId.Value; - set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_updatedAt.Name != null) yield return _updatedAt; - if (_lastDocumentId.Name != null) yield return _lastDocumentId; - } - } - - public partial class WorkspaceInputPushRowGql : IGraphQlInputObject - { - private InputPropertyInfo _assumedMasterState; - private InputPropertyInfo _newDocumentState; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? AssumedMasterState - { - get => (QueryBuilderParameter?)_assumedMasterState.Value; - set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NewDocumentState - { - get => (QueryBuilderParameter?)_newDocumentState.Value; - set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_assumedMasterState.Name != null) yield return _assumedMasterState; - if (_newDocumentState.Name != null) yield return _newDocumentState; - } - } - - public partial class LiveDocInputCheckpointGql : IGraphQlInputObject - { - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _lastDocumentId; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastDocumentId - { - get => (QueryBuilderParameter?)_lastDocumentId.Value; - set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_updatedAt.Name != null) yield return _updatedAt; - if (_lastDocumentId.Name != null) yield return _lastDocumentId; - } - } - - public partial class LiveDocInputPushRowGql : IGraphQlInputObject - { - private InputPropertyInfo _assumedMasterState; - private InputPropertyInfo _newDocumentState; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? AssumedMasterState - { - get => (QueryBuilderParameter?)_assumedMasterState.Value; - set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NewDocumentState - { - get => (QueryBuilderParameter?)_newDocumentState.Value; - set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_assumedMasterState.Name != null) yield return _assumedMasterState; - if (_newDocumentState.Name != null) yield return _newDocumentState; - } - } - - public partial class UserFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _and; - private InputPropertyInfo _or; - private InputPropertyInfo _firstName; - private InputPropertyInfo _lastName; - private InputPropertyInfo _fullName; - private InputPropertyInfo _email; - private InputPropertyInfo _role; - private InputPropertyInfo _jwtAccessToken; - private InputPropertyInfo _workspaceId; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? And - { - get => (QueryBuilderParameter?>?)_and.Value; - set => _and = new InputPropertyInfo { Name = "and", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Or - { - get => (QueryBuilderParameter?>?)_or.Value; - set => _or = new InputPropertyInfo { Name = "or", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? FirstName - { - get => (QueryBuilderParameter?)_firstName.Value; - set => _firstName = new InputPropertyInfo { Name = "firstName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastName - { - get => (QueryBuilderParameter?)_lastName.Value; - set => _lastName = new InputPropertyInfo { Name = "lastName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? FullName - { - get => (QueryBuilderParameter?)_fullName.Value; - set => _fullName = new InputPropertyInfo { Name = "fullName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Email - { - get => (QueryBuilderParameter?)_email.Value; - set => _email = new InputPropertyInfo { Name = "email", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Role - { - get => (QueryBuilderParameter?)_role.Value; - set => _role = new InputPropertyInfo { Name = "role", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? JwtAccessToken - { - get => (QueryBuilderParameter?)_jwtAccessToken.Value; - set => _jwtAccessToken = new InputPropertyInfo { Name = "jwtAccessToken", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? WorkspaceId - { - get => (QueryBuilderParameter?)_workspaceId.Value; - set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Topics - { - get => (QueryBuilderParameter?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_and.Name != null) yield return _and; - if (_or.Name != null) yield return _or; - if (_firstName.Name != null) yield return _firstName; - if (_lastName.Name != null) yield return _lastName; - if (_fullName.Name != null) yield return _fullName; - if (_email.Name != null) yield return _email; - if (_role.Name != null) yield return _role; - if (_jwtAccessToken.Name != null) yield return _jwtAccessToken; - if (_workspaceId.Name != null) yield return _workspaceId; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class UserInputGql : IGraphQlInputObject - { - private InputPropertyInfo _firstName; - private InputPropertyInfo _lastName; - private InputPropertyInfo _fullName; - private InputPropertyInfo _email; - private InputPropertyInfo _role; - private InputPropertyInfo _jwtAccessToken; - private InputPropertyInfo _workspaceId; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? FirstName - { - get => (QueryBuilderParameter?)_firstName.Value; - set => _firstName = new InputPropertyInfo { Name = "firstName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? LastName - { - get => (QueryBuilderParameter?)_lastName.Value; - set => _lastName = new InputPropertyInfo { Name = "lastName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? FullName - { - get => (QueryBuilderParameter?)_fullName.Value; - set => _fullName = new InputPropertyInfo { Name = "fullName", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Email - { - get => (QueryBuilderParameter?)_email.Value; - set => _email = new InputPropertyInfo { Name = "email", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Role - { - get => (QueryBuilderParameter?)_role.Value; - set => _role = new InputPropertyInfo { Name = "role", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? JwtAccessToken - { - get => (QueryBuilderParameter?)_jwtAccessToken.Value; - set => _jwtAccessToken = new InputPropertyInfo { Name = "jwtAccessToken", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? WorkspaceId - { - get => (QueryBuilderParameter?)_workspaceId.Value; - set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Topics - { - get => (QueryBuilderParameter?>?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_firstName.Name != null) yield return _firstName; - if (_lastName.Name != null) yield return _lastName; - if (_fullName.Name != null) yield return _fullName; - if (_email.Name != null) yield return _email; - if (_role.Name != null) yield return _role; - if (_jwtAccessToken.Name != null) yield return _jwtAccessToken; - if (_workspaceId.Name != null) yield return _workspaceId; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class UserInputHeadersGql : IGraphQlInputObject - { - private InputPropertyInfo _authorization; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Authorization - { - get => (QueryBuilderParameter?)_authorization.Value; - set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_authorization.Name != null) yield return _authorization; - } - } - - public partial class WorkspaceFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _and; - private InputPropertyInfo _or; - private InputPropertyInfo _name; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? And - { - get => (QueryBuilderParameter?>?)_and.Value; - set => _and = new InputPropertyInfo { Name = "and", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Or - { - get => (QueryBuilderParameter?>?)_or.Value; - set => _or = new InputPropertyInfo { Name = "or", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Name - { - get => (QueryBuilderParameter?)_name.Value; - set => _name = new InputPropertyInfo { Name = "name", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Topics - { - get => (QueryBuilderParameter?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_and.Name != null) yield return _and; - if (_or.Name != null) yield return _or; - if (_name.Name != null) yield return _name; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class WorkspaceInputGql : IGraphQlInputObject - { - private InputPropertyInfo _name; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Name - { - get => (QueryBuilderParameter?)_name.Value; - set => _name = new InputPropertyInfo { Name = "name", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Topics - { - get => (QueryBuilderParameter?>?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_name.Name != null) yield return _name; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class WorkspaceInputHeadersGql : IGraphQlInputObject - { - private InputPropertyInfo _authorization; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Authorization - { - get => (QueryBuilderParameter?)_authorization.Value; - set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_authorization.Name != null) yield return _authorization; - } - } - - public partial class LiveDocFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _and; - private InputPropertyInfo _or; - private InputPropertyInfo _content; - private InputPropertyInfo _ownerId; - private InputPropertyInfo _workspaceId; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? And - { - get => (QueryBuilderParameter?>?)_and.Value; - set => _and = new InputPropertyInfo { Name = "and", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Or - { - get => (QueryBuilderParameter?>?)_or.Value; - set => _or = new InputPropertyInfo { Name = "or", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Content - { - get => (QueryBuilderParameter?)_content.Value; - set => _content = new InputPropertyInfo { Name = "content", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? OwnerId - { - get => (QueryBuilderParameter?)_ownerId.Value; - set => _ownerId = new InputPropertyInfo { Name = "ownerId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? WorkspaceId - { - get => (QueryBuilderParameter?)_workspaceId.Value; - set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Topics - { - get => (QueryBuilderParameter?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_and.Name != null) yield return _and; - if (_or.Name != null) yield return _or; - if (_content.Name != null) yield return _content; - if (_ownerId.Name != null) yield return _ownerId; - if (_workspaceId.Name != null) yield return _workspaceId; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class LiveDocInputGql : IGraphQlInputObject - { - private InputPropertyInfo _content; - private InputPropertyInfo _ownerId; - private InputPropertyInfo _workspaceId; - private InputPropertyInfo _id; - private InputPropertyInfo _isDeleted; - private InputPropertyInfo _updatedAt; - private InputPropertyInfo _topics; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Content - { - get => (QueryBuilderParameter?)_content.Value; - set => _content = new InputPropertyInfo { Name = "content", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? OwnerId - { - get => (QueryBuilderParameter?)_ownerId.Value; - set => _ownerId = new InputPropertyInfo { Name = "ownerId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? WorkspaceId - { - get => (QueryBuilderParameter?)_workspaceId.Value; - set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Id - { - get => (QueryBuilderParameter?)_id.Value; - set => _id = new InputPropertyInfo { Name = "id", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? IsDeleted - { - get => (QueryBuilderParameter?)_isDeleted.Value; - set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? UpdatedAt - { - get => (QueryBuilderParameter?)_updatedAt.Value; - set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Topics - { - get => (QueryBuilderParameter?>?)_topics.Value; - set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_content.Name != null) yield return _content; - if (_ownerId.Name != null) yield return _ownerId; - if (_workspaceId.Name != null) yield return _workspaceId; - if (_id.Name != null) yield return _id; - if (_isDeleted.Name != null) yield return _isDeleted; - if (_updatedAt.Name != null) yield return _updatedAt; - if (_topics.Name != null) yield return _topics; - } - } - - public partial class LiveDocInputHeadersGql : IGraphQlInputObject - { - private InputPropertyInfo _authorization; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Authorization - { - get => (QueryBuilderParameter?)_authorization.Value; - set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_authorization.Name != null) yield return _authorization; - } - } - - public partial class StringOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _and; - private InputPropertyInfo _or; - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - private InputPropertyInfo _contains; - private InputPropertyInfo _ncontains; - private InputPropertyInfo _in; - private InputPropertyInfo _nin; - private InputPropertyInfo _startsWith; - private InputPropertyInfo _nstartsWith; - private InputPropertyInfo _endsWith; - private InputPropertyInfo _nendsWith; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? And - { - get => (QueryBuilderParameter?>?)_and.Value; - set => _and = new InputPropertyInfo { Name = "and", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Or - { - get => (QueryBuilderParameter?>?)_or.Value; - set => _or = new InputPropertyInfo { Name = "or", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Contains - { - get => (QueryBuilderParameter?)_contains.Value; - set => _contains = new InputPropertyInfo { Name = "contains", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ncontains - { - get => (QueryBuilderParameter?)_ncontains.Value; - set => _ncontains = new InputPropertyInfo { Name = "ncontains", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? In - { - get => (QueryBuilderParameter?>?)_in.Value; - set => _in = new InputPropertyInfo { Name = "in", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Nin - { - get => (QueryBuilderParameter?>?)_nin.Value; - set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? StartsWith - { - get => (QueryBuilderParameter?)_startsWith.Value; - set => _startsWith = new InputPropertyInfo { Name = "startsWith", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NstartsWith - { - get => (QueryBuilderParameter?)_nstartsWith.Value; - set => _nstartsWith = new InputPropertyInfo { Name = "nstartsWith", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? EndsWith - { - get => (QueryBuilderParameter?)_endsWith.Value; - set => _endsWith = new InputPropertyInfo { Name = "endsWith", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? NendsWith - { - get => (QueryBuilderParameter?)_nendsWith.Value; - set => _nendsWith = new InputPropertyInfo { Name = "nendsWith", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_and.Name != null) yield return _and; - if (_or.Name != null) yield return _or; - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - if (_contains.Name != null) yield return _contains; - if (_ncontains.Name != null) yield return _ncontains; - if (_in.Name != null) yield return _in; - if (_nin.Name != null) yield return _nin; - if (_startsWith.Name != null) yield return _startsWith; - if (_nstartsWith.Name != null) yield return _nstartsWith; - if (_endsWith.Name != null) yield return _endsWith; - if (_nendsWith.Name != null) yield return _nendsWith; - } - } - - public partial class UserRoleOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - private InputPropertyInfo _in; - private InputPropertyInfo _nin; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? In - { - get => (QueryBuilderParameter?>?)_in.Value; - set => _in = new InputPropertyInfo { Name = "in", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Nin - { - get => (QueryBuilderParameter?>?)_nin.Value; - set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - if (_in.Name != null) yield return _in; - if (_nin.Name != null) yield return _nin; - } - } - - public partial class UuidOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - private InputPropertyInfo _in; - private InputPropertyInfo _nin; - private InputPropertyInfo _gt; - private InputPropertyInfo _ngt; - private InputPropertyInfo _gte; - private InputPropertyInfo _ngte; - private InputPropertyInfo _lt; - private InputPropertyInfo _nlt; - private InputPropertyInfo _lte; - private InputPropertyInfo _nlte; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? In - { - get => (QueryBuilderParameter?>?)_in.Value; - set => _in = new InputPropertyInfo { Name = "in", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Nin - { - get => (QueryBuilderParameter?>?)_nin.Value; - set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Gt - { - get => (QueryBuilderParameter?)_gt.Value; - set => _gt = new InputPropertyInfo { Name = "gt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ngt - { - get => (QueryBuilderParameter?)_ngt.Value; - set => _ngt = new InputPropertyInfo { Name = "ngt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Gte - { - get => (QueryBuilderParameter?)_gte.Value; - set => _gte = new InputPropertyInfo { Name = "gte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ngte - { - get => (QueryBuilderParameter?)_ngte.Value; - set => _ngte = new InputPropertyInfo { Name = "ngte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Lt - { - get => (QueryBuilderParameter?)_lt.Value; - set => _lt = new InputPropertyInfo { Name = "lt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Nlt - { - get => (QueryBuilderParameter?)_nlt.Value; - set => _nlt = new InputPropertyInfo { Name = "nlt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Lte - { - get => (QueryBuilderParameter?)_lte.Value; - set => _lte = new InputPropertyInfo { Name = "lte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Nlte - { - get => (QueryBuilderParameter?)_nlte.Value; - set => _nlte = new InputPropertyInfo { Name = "nlte", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - if (_in.Name != null) yield return _in; - if (_nin.Name != null) yield return _nin; - if (_gt.Name != null) yield return _gt; - if (_ngt.Name != null) yield return _ngt; - if (_gte.Name != null) yield return _gte; - if (_ngte.Name != null) yield return _ngte; - if (_lt.Name != null) yield return _lt; - if (_nlt.Name != null) yield return _nlt; - if (_lte.Name != null) yield return _lte; - if (_nlte.Name != null) yield return _nlte; - } - } - - public partial class BooleanOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - } - } - - public partial class DateTimeOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _eq; - private InputPropertyInfo _neq; - private InputPropertyInfo _in; - private InputPropertyInfo _nin; - private InputPropertyInfo _gt; - private InputPropertyInfo _ngt; - private InputPropertyInfo _gte; - private InputPropertyInfo _ngte; - private InputPropertyInfo _lt; - private InputPropertyInfo _nlt; - private InputPropertyInfo _lte; - private InputPropertyInfo _nlte; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Eq - { - get => (QueryBuilderParameter?)_eq.Value; - set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Neq - { - get => (QueryBuilderParameter?)_neq.Value; - set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? In - { - get => (QueryBuilderParameter?>?)_in.Value; - set => _in = new InputPropertyInfo { Name = "in", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? Nin - { - get => (QueryBuilderParameter?>?)_nin.Value; - set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Gt - { - get => (QueryBuilderParameter?)_gt.Value; - set => _gt = new InputPropertyInfo { Name = "gt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ngt - { - get => (QueryBuilderParameter?)_ngt.Value; - set => _ngt = new InputPropertyInfo { Name = "ngt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Gte - { - get => (QueryBuilderParameter?)_gte.Value; - set => _gte = new InputPropertyInfo { Name = "gte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Ngte - { - get => (QueryBuilderParameter?)_ngte.Value; - set => _ngte = new InputPropertyInfo { Name = "ngte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Lt - { - get => (QueryBuilderParameter?)_lt.Value; - set => _lt = new InputPropertyInfo { Name = "lt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Nlt - { - get => (QueryBuilderParameter?)_nlt.Value; - set => _nlt = new InputPropertyInfo { Name = "nlt", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Lte - { - get => (QueryBuilderParameter?)_lte.Value; - set => _lte = new InputPropertyInfo { Name = "lte", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Nlte - { - get => (QueryBuilderParameter?)_nlte.Value; - set => _nlte = new InputPropertyInfo { Name = "nlte", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_eq.Name != null) yield return _eq; - if (_neq.Name != null) yield return _neq; - if (_in.Name != null) yield return _in; - if (_nin.Name != null) yield return _nin; - if (_gt.Name != null) yield return _gt; - if (_ngt.Name != null) yield return _ngt; - if (_gte.Name != null) yield return _gte; - if (_ngte.Name != null) yield return _ngte; - if (_lt.Name != null) yield return _lt; - if (_nlt.Name != null) yield return _nlt; - if (_lte.Name != null) yield return _lte; - if (_nlte.Name != null) yield return _nlte; - } - } - - public partial class ListStringOperationFilterInputGql : IGraphQlInputObject - { - private InputPropertyInfo _all; - private InputPropertyInfo _none; - private InputPropertyInfo _some; - private InputPropertyInfo _any; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? All - { - get => (QueryBuilderParameter?)_all.Value; - set => _all = new InputPropertyInfo { Name = "all", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? None - { - get => (QueryBuilderParameter?)_none.Value; - set => _none = new InputPropertyInfo { Name = "none", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Some - { - get => (QueryBuilderParameter?)_some.Value; - set => _some = new InputPropertyInfo { Name = "some", Value = value }; - } - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter))] - #endif - public QueryBuilderParameter? Any - { - get => (QueryBuilderParameter?)_any.Value; - set => _any = new InputPropertyInfo { Name = "any", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_all.Name != null) yield return _all; - if (_none.Name != null) yield return _none; - if (_some.Name != null) yield return _some; - if (_any.Name != null) yield return _any; - } - } - - public partial class PushUserInputGql : IGraphQlInputObject - { - private InputPropertyInfo _userPushRow; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? UserPushRow - { - get => (QueryBuilderParameter?>?)_userPushRow.Value; - set => _userPushRow = new InputPropertyInfo { Name = "userPushRow", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_userPushRow.Name != null) yield return _userPushRow; - } - } - - public partial class PushWorkspaceInputGql : IGraphQlInputObject - { - private InputPropertyInfo _workspacePushRow; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? WorkspacePushRow - { - get => (QueryBuilderParameter?>?)_workspacePushRow.Value; - set => _workspacePushRow = new InputPropertyInfo { Name = "workspacePushRow", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_workspacePushRow.Name != null) yield return _workspacePushRow; - } - } - - public partial class PushLiveDocInputGql : IGraphQlInputObject - { - private InputPropertyInfo _liveDocPushRow; - - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(QueryBuilderParameterConverter?>))] - #endif - public QueryBuilderParameter?>? LiveDocPushRow - { - get => (QueryBuilderParameter?>?)_liveDocPushRow.Value; - set => _liveDocPushRow = new InputPropertyInfo { Name = "liveDocPushRow", Value = value }; - } - - IEnumerable IGraphQlInputObject.GetPropertyValues() - { - if (_liveDocPushRow.Name != null) yield return _liveDocPushRow; - } - } - #endregion - - #region data classes - public partial class UserPullBulkGql - { - public ICollection? Documents { get; set; } - public CheckpointGql? Checkpoint { get; set; } - } - - public partial class WorkspacePullBulkGql - { - public ICollection? Documents { get; set; } - public CheckpointGql? Checkpoint { get; set; } - } - - public partial class LiveDocPullBulkGql - { - public ICollection? Documents { get; set; } - public CheckpointGql? Checkpoint { get; set; } - } - - public partial class QueryGql - { - public UserPullBulkGql? PullUser { get; set; } - public WorkspacePullBulkGql? PullWorkspace { get; set; } - public LiveDocPullBulkGql? PullLiveDoc { get; set; } - } - - public partial class MutationGql - { - public PushUserPayloadGql? PushUser { get; set; } - public PushWorkspacePayloadGql? PushWorkspace { get; set; } - public PushLiveDocPayloadGql? PushLiveDoc { get; set; } - } - - public partial class SubscriptionGql - { - public UserPullBulkGql? StreamUser { get; set; } - public WorkspacePullBulkGql? StreamWorkspace { get; set; } - public LiveDocPullBulkGql? StreamLiveDoc { get; set; } - } - - public partial class UserGql - { - public string FirstName { get; set; } - public string LastName { get; set; } - public string? FullName { get; set; } - public string? Email { get; set; } - public LiveDocs.GraphQLApi.Security.UserRole Role { get; set; } - public string? JwtAccessToken { get; set; } - public Guid WorkspaceId { get; set; } - public Guid Id { get; set; } - public bool IsDeleted { get; set; } - public DateTimeOffset UpdatedAt { get; set; } - public ICollection? Topics { get; set; } - } - - public partial class CheckpointGql - { - public Guid? LastDocumentId { get; set; } - public DateTimeOffset? UpdatedAt { get; set; } - } - - [GraphQlObjectType("AuthenticationError")] - public partial class AuthenticationErrorGql : IPushUserErrorGql, IPushWorkspaceErrorGql, IPushLiveDocErrorGql, IErrorGql - { - public string Message { get; set; } - } - - [GraphQlObjectType("UnauthorizedAccessError")] - public partial class UnauthorizedAccessErrorGql : IPushUserErrorGql, IPushWorkspaceErrorGql, IPushLiveDocErrorGql, IErrorGql - { - public string Message { get; set; } - } - - public partial class WorkspaceGql - { - public string Name { get; set; } - public Guid Id { get; set; } - public bool IsDeleted { get; set; } - public DateTimeOffset UpdatedAt { get; set; } - public ICollection? Topics { get; set; } - } - - public partial class LiveDocGql - { - public string Content { get; set; } - public Guid OwnerId { get; set; } - public Guid WorkspaceId { get; set; } - public Guid Id { get; set; } - public bool IsDeleted { get; set; } - public DateTimeOffset UpdatedAt { get; set; } - public ICollection? Topics { get; set; } - } - - public partial interface IErrorGql - { - string Message { get; set; } - } - - public partial interface IPushUserErrorGql - { - } - - public partial class PushUserPayloadGql - { - public ICollection? User { get; set; } - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] - #endif - public ICollection? Errors { get; set; } - } - - public partial interface IPushWorkspaceErrorGql - { - } - - public partial class PushWorkspacePayloadGql - { - public ICollection? Workspace { get; set; } - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] - #endif - public ICollection? Errors { get; set; } - } - - public partial interface IPushLiveDocErrorGql - { - } - - public partial class PushLiveDocPayloadGql - { - public ICollection? LiveDoc { get; set; } - #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON - [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] - #endif - public ICollection? Errors { get; set; } - } - #endregion - #nullable restore -} + +namespace RxDBDotNet.Tests.Model +{ + #region base classes + public struct GraphQlFieldMetadata + { + public string Name { get; set; } + public string DefaultAlias { get; set; } + public bool IsComplex { get; set; } + public bool RequiresParameters { get; set; } + public global::System.Type QueryBuilderType { get; set; } + } + + public enum Formatting + { + None, + Indented + } + + public class GraphQlObjectTypeAttribute : global::System.Attribute + { + public string TypeName { get; } + + public GraphQlObjectTypeAttribute(string typeName) => TypeName = typeName; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + public class QueryBuilderParameterConverter : global::Newtonsoft.Json.JsonConverter + { + public override object ReadJson(JsonReader reader, global::System.Type objectType, object existingValue, JsonSerializer serializer) + { + switch (reader.TokenType) + { + case JsonToken.Null: + return null; + + default: + return (QueryBuilderParameter)(T)serializer.Deserialize(reader, typeof(T)); + } + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + if (value == null) + writer.WriteNull(); + else + serializer.Serialize(writer, ((QueryBuilderParameter)value).Value, typeof(T)); + } + + public override bool CanConvert(global::System.Type objectType) => objectType.IsSubclassOf(typeof(QueryBuilderParameter)); + } + + public class GraphQlInterfaceJsonConverter : global::Newtonsoft.Json.JsonConverter + { + private const string FieldNameType = "__typename"; + + private static readonly Dictionary InterfaceTypeMapping = + typeof(GraphQlInterfaceJsonConverter).Assembly.GetTypes() + .Select(t => new { Type = t, Attribute = t.GetCustomAttribute() }) + .Where(x => x.Attribute != null && x.Type.Namespace == typeof(GraphQlInterfaceJsonConverter).Namespace) + .ToDictionary(x => x.Attribute.TypeName, x => x.Type); + + public override bool CanConvert(global::System.Type objectType) => objectType.IsInterface || objectType.IsArray; + + public override object ReadJson(JsonReader reader, global::System.Type objectType, object existingValue, JsonSerializer serializer) + { + while (reader.TokenType == JsonToken.Comment) + reader.Read(); + + switch (reader.TokenType) + { + case JsonToken.Null: + return null; + + case JsonToken.StartObject: + var jObject = JObject.Load(reader); + if (!jObject.TryGetValue(FieldNameType, out var token) || token.Type != JTokenType.String) + throw CreateJsonReaderException(reader, $"\"{GetType().FullName}\" requires JSON object to contain \"{FieldNameType}\" field with type name"); + + var typeName = token.Value(); + if (!InterfaceTypeMapping.TryGetValue(typeName, out var type)) + throw CreateJsonReaderException(reader, $"type \"{typeName}\" not found"); + + using (reader = CloneReader(jObject, reader)) + return serializer.Deserialize(reader, type); + + case JsonToken.StartArray: + var elementType = GetElementType(objectType); + if (elementType == null) + throw CreateJsonReaderException(reader, $"array element type could not be resolved for type \"{objectType.FullName}\""); + + return ReadArray(reader, objectType, elementType, serializer); + + default: + throw CreateJsonReaderException(reader, $"unrecognized token: {reader.TokenType}"); + } + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) => serializer.Serialize(writer, value); + + private static JsonReader CloneReader(JToken jToken, JsonReader reader) + { + var jObjectReader = jToken.CreateReader(); + jObjectReader.Culture = reader.Culture; + jObjectReader.CloseInput = reader.CloseInput; + jObjectReader.SupportMultipleContent = reader.SupportMultipleContent; + jObjectReader.DateTimeZoneHandling = reader.DateTimeZoneHandling; + jObjectReader.FloatParseHandling = reader.FloatParseHandling; + jObjectReader.DateFormatString = reader.DateFormatString; + jObjectReader.DateParseHandling = reader.DateParseHandling; + return jObjectReader; + } + + private static JsonReaderException CreateJsonReaderException(JsonReader reader, string message) + { + if (reader is IJsonLineInfo lineInfo && lineInfo.HasLineInfo()) + return new JsonReaderException(message, reader.Path, lineInfo.LineNumber, lineInfo.LinePosition, null); + + return new JsonReaderException(message); + } + + private static global::System.Type GetElementType(global::System.Type arrayOrGenericContainer) => + arrayOrGenericContainer.IsArray ? arrayOrGenericContainer.GetElementType() : arrayOrGenericContainer.GenericTypeArguments.FirstOrDefault(); + + private IList ReadArray(JsonReader reader, global::System.Type targetType, global::System.Type elementType, JsonSerializer serializer) + { + var list = CreateCompatibleList(targetType, elementType); + while (reader.Read() && reader.TokenType != JsonToken.EndArray) + list.Add(ReadJson(reader, elementType, null, serializer)); + + if (!targetType.IsArray) + return list; + + var array = Array.CreateInstance(elementType, list.Count); + list.CopyTo(array, 0); + return array; + } + + private static IList CreateCompatibleList(global::System.Type targetContainerType, global::System.Type elementType) => + (IList)Activator.CreateInstance(targetContainerType.IsArray || targetContainerType.IsAbstract ? typeof(List<>).MakeGenericType(elementType) : targetContainerType); + } + #endif + + internal static class GraphQlQueryHelper + { + private static readonly Regex RegexGraphQlIdentifier = new Regex(@"^[_A-Za-z][_0-9A-Za-z]*$", RegexOptions.Compiled); + private static readonly Regex RegexEscapeGraphQlString = new Regex(@"[\\\""/\b\f\n\r\t]", RegexOptions.Compiled); + + public static string GetIndentation(int level, byte indentationSize) + { + return new String(' ', level * indentationSize); + } + + public static string EscapeGraphQlStringValue(string value) + { + return RegexEscapeGraphQlString.Replace(value, m => @$"\{GetEscapeSequence(m.Value)}"); + } + + private static string GetEscapeSequence(string input) + { + switch (input) + { + case "\\": + return "\\"; + case "\"": + return "\""; + case "/": + return "/"; + case "\b": + return "b"; + case "\f": + return "f"; + case "\n": + return "n"; + case "\r": + return "r"; + case "\t": + return "t"; + default: + throw new InvalidOperationException($"invalid character: {input}"); + } + } + + public static string BuildArgumentValue(object value, string formatMask, GraphQlBuilderOptions options, int level) + { + var serializer = options.ArgumentBuilder ?? DefaultGraphQlArgumentBuilder.Instance; + if (serializer.TryBuild(new GraphQlArgumentBuilderContext { Value = value, FormatMask = formatMask, Options = options, Level = level }, out var serializedValue)) + return serializedValue; + + if (value is null) + return "null"; + + var enumerable = value as IEnumerable; + if (!String.IsNullOrEmpty(formatMask) && enumerable == null) + return + value is IFormattable formattable + ? $"\"{EscapeGraphQlStringValue(formattable.ToString(formatMask, CultureInfo.InvariantCulture))}\"" + : throw new ArgumentException($"Value must implement {nameof(IFormattable)} interface to use a format mask. ", nameof(value)); + + if (value is Enum @enum) + return ConvertEnumToString(@enum); + + if (value is bool @bool) + return @bool ? "true" : "false"; + + if (value is DateTime dateTime) + return $"\"{dateTime.ToString("O")}\""; + + if (value is DateTimeOffset dateTimeOffset) + return $"\"{dateTimeOffset.ToString("O")}\""; + + if (value is IGraphQlInputObject inputObject) + return BuildInputObject(inputObject, options, level + 2); + + if (value is Guid) + return $"\"{value}\""; + + if (value is String @string) + return $"\"{EscapeGraphQlStringValue(@string)}\""; + + if (enumerable != null) + return BuildEnumerableArgument(enumerable, formatMask, options, level, '[', ']'); + + if (value is short || value is ushort || value is byte || value is int || value is uint || value is long || value is ulong || value is float || value is double || value is decimal) + return Convert.ToString(value, CultureInfo.InvariantCulture); + + var argumentValue = EscapeGraphQlStringValue(Convert.ToString(value, CultureInfo.InvariantCulture)); + return $"\"{argumentValue}\""; + } + + public static string BuildEnumerableArgument(IEnumerable enumerable, string formatMask, GraphQlBuilderOptions options, int level, char openingSymbol, char closingSymbol) + { + var builder = new StringBuilder(); + builder.Append(openingSymbol); + var delimiter = String.Empty; + foreach (var item in enumerable) + { + builder.Append(delimiter); + + if (options.Formatting == Formatting.Indented) + { + builder.AppendLine(); + builder.Append(GetIndentation(level + 1, options.IndentationSize)); + } + + builder.Append(BuildArgumentValue(item, formatMask, options, level)); + delimiter = ","; + } + + builder.Append(closingSymbol); + return builder.ToString(); + } + + public static string BuildInputObject(IGraphQlInputObject inputObject, GraphQlBuilderOptions options, int level) + { + var builder = new StringBuilder(); + builder.Append("{"); + + var isIndentedFormatting = options.Formatting == Formatting.Indented; + string valueSeparator; + if (isIndentedFormatting) + { + builder.AppendLine(); + valueSeparator = ": "; + } + else + valueSeparator = ":"; + + var separator = String.Empty; + foreach (var propertyValue in inputObject.GetPropertyValues()) + { + var queryBuilderParameter = propertyValue.Value as QueryBuilderParameter; + var value = + queryBuilderParameter?.Name != null + ? $"${queryBuilderParameter.Name}" + : BuildArgumentValue(queryBuilderParameter == null ? propertyValue.Value : queryBuilderParameter.Value, propertyValue.FormatMask, options, level); + + builder.Append(isIndentedFormatting ? GetIndentation(level, options.IndentationSize) : separator); + builder.Append(propertyValue.Name); + builder.Append(valueSeparator); + builder.Append(value); + + separator = ","; + + if (isIndentedFormatting) + builder.AppendLine(); + } + + if (isIndentedFormatting) + builder.Append(GetIndentation(level - 1, options.IndentationSize)); + + builder.Append("}"); + + return builder.ToString(); + } + + public static string BuildDirective(GraphQlDirective directive, GraphQlBuilderOptions options, int level) + { + if (directive == null) + return String.Empty; + + var isIndentedFormatting = options.Formatting == Formatting.Indented; + var indentationSpace = isIndentedFormatting ? " " : String.Empty; + var builder = new StringBuilder(); + builder.Append(indentationSpace); + builder.Append("@"); + builder.Append(directive.Name); + builder.Append("("); + + string separator = null; + foreach (var kvp in directive.Arguments) + { + var argumentName = kvp.Key; + var argument = kvp.Value; + + builder.Append(separator); + builder.Append(argumentName); + builder.Append(":"); + builder.Append(indentationSpace); + + if (argument.Name == null) + builder.Append(BuildArgumentValue(argument.Value, null, options, level)); + else + { + builder.Append("$"); + builder.Append(argument.Name); + } + + separator = isIndentedFormatting ? ", " : ","; + } + + builder.Append(")"); + return builder.ToString(); + } + + public static void ValidateGraphQlIdentifier(string name, string identifier) + { + if (identifier != null && !RegexGraphQlIdentifier.IsMatch(identifier)) + throw new ArgumentException("value must match " + RegexGraphQlIdentifier, name); + } + + private static string ConvertEnumToString(Enum @enum) + { + var enumMember = @enum.GetType().GetField(@enum.ToString()); + if (enumMember == null) + throw new InvalidOperationException("enum member resolution failed"); + + var enumMemberAttribute = (EnumMemberAttribute)enumMember.GetCustomAttribute(typeof(EnumMemberAttribute)); + + return enumMemberAttribute == null + ? @enum.ToString() + : enumMemberAttribute.Value; + } + } + + public interface IGraphQlArgumentBuilder + { + bool TryBuild(GraphQlArgumentBuilderContext context, out string graphQlString); + } + + public class GraphQlArgumentBuilderContext + { + public object Value { get; set; } + public string FormatMask { get; set; } + public GraphQlBuilderOptions Options { get; set; } + public int Level { get; set; } + } + + public class DefaultGraphQlArgumentBuilder : IGraphQlArgumentBuilder + { + private static readonly Regex RegexWhiteSpace = new Regex(@"\s", RegexOptions.Compiled); + + public static readonly DefaultGraphQlArgumentBuilder Instance = new(); + + public bool TryBuild(GraphQlArgumentBuilderContext context, out string graphQlString) + { + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + if (context.Value is JValue jValue) + { + switch (jValue.Type) + { + case JTokenType.Null: + graphQlString = "null"; + return true; + + case JTokenType.Integer: + case JTokenType.Float: + case JTokenType.Boolean: + graphQlString = GraphQlQueryHelper.BuildArgumentValue(jValue.Value, null, context.Options, context.Level); + return true; + + case JTokenType.String: + graphQlString = $"\"{GraphQlQueryHelper.EscapeGraphQlStringValue((string)jValue.Value)}\""; + return true; + + default: + graphQlString = $"\"{jValue.Value}\""; + return true; + } + } + + if (context.Value is JProperty jProperty) + { + if (RegexWhiteSpace.IsMatch(jProperty.Name)) + throw new ArgumentException($"JSON object keys used as GraphQL arguments must not contain whitespace; key: {jProperty.Name}"); + + graphQlString = $"{jProperty.Name}:{(context.Options.Formatting == Formatting.Indented ? " " : null)}{GraphQlQueryHelper.BuildArgumentValue(jProperty.Value, null, context.Options, context.Level)}"; + return true; + } + + if (context.Value is JObject jObject) + { + graphQlString = GraphQlQueryHelper.BuildEnumerableArgument(jObject, null, context.Options, context.Level + 1, '{', '}'); + return true; + } + #endif + + graphQlString = null; + return false; + } + } + + internal struct InputPropertyInfo + { + public string Name { get; set; } + public object Value { get; set; } + public string FormatMask { get; set; } + } + + internal interface IGraphQlInputObject + { + IEnumerable GetPropertyValues(); + } + + public interface IGraphQlQueryBuilder + { + void Clear(); + void IncludeAllFields(); + string Build(Formatting formatting = Formatting.None, byte indentationSize = 2); + } + + public struct QueryBuilderArgumentInfo + { + public string ArgumentName { get; set; } + public QueryBuilderParameter ArgumentValue { get; set; } + public string FormatMask { get; set; } + } + + public abstract class QueryBuilderParameter + { + private string _name; + + internal string GraphQlTypeName { get; } + internal object Value { get; set; } + + public string Name + { + get => _name; + set + { + GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(Name), value); + _name = value; + } + } + + protected QueryBuilderParameter(string name, string graphQlTypeName, object value) + { + Name = name?.Trim(); + GraphQlTypeName = graphQlTypeName?.Replace(" ", null).Replace("\t", null).Replace("\n", null).Replace("\r", null); + Value = value; + } + + protected QueryBuilderParameter(object value) => Value = value; + } + + public class QueryBuilderParameter : QueryBuilderParameter + { + public new T Value + { + get => base.Value == null ? default : (T)base.Value; + set => base.Value = value; + } + + protected QueryBuilderParameter(string name, string graphQlTypeName, T value) : base(name, graphQlTypeName, value) + { + EnsureGraphQlTypeName(graphQlTypeName); + } + + protected QueryBuilderParameter(string name, string graphQlTypeName) : base(name, graphQlTypeName, null) + { + EnsureGraphQlTypeName(graphQlTypeName); + } + + private QueryBuilderParameter(T value) : base(value) + { + } + + public void ResetValue() => base.Value = null; + + public static implicit operator QueryBuilderParameter(T value) => new QueryBuilderParameter(value); + + public static implicit operator T(QueryBuilderParameter parameter) => parameter.Value; + + private static void EnsureGraphQlTypeName(string graphQlTypeName) + { + if (String.IsNullOrWhiteSpace(graphQlTypeName)) + throw new ArgumentException("value required", nameof(graphQlTypeName)); + } + } + + public class GraphQlQueryParameter : QueryBuilderParameter + { + private string _formatMask; + + public string FormatMask + { + get => _formatMask; + set => _formatMask = + typeof(IFormattable).IsAssignableFrom(typeof(T)) + ? value + : throw new InvalidOperationException($"Value must be of {nameof(IFormattable)} type. "); + } + + public GraphQlQueryParameter(string name, string graphQlTypeName = null) + : base(name, graphQlTypeName ?? GetGraphQlTypeName(typeof(T))) + { + } + + public GraphQlQueryParameter(string name, string graphQlTypeName, T defaultValue) + : base(name, graphQlTypeName, defaultValue) + { + } + + public GraphQlQueryParameter(string name, T defaultValue, bool isNullable = true) + : base(name, GetGraphQlTypeName(typeof(T), isNullable), defaultValue) + { + } + + private static string GetGraphQlTypeName(global::System.Type valueType, bool isNullable) + { + var graphQlTypeName = GetGraphQlTypeName(valueType); + if (!isNullable) + graphQlTypeName += "!"; + + return graphQlTypeName; + } + + private static string GetGraphQlTypeName(global::System.Type valueType) + { + var nullableUnderlyingType = Nullable.GetUnderlyingType(valueType); + valueType = nullableUnderlyingType ?? valueType; + + if (valueType.IsArray) + { + var arrayItemType = GetGraphQlTypeName(valueType.GetElementType()); + return arrayItemType == null ? null : "[" + arrayItemType + "]"; + } + + if (typeof(IEnumerable).IsAssignableFrom(valueType)) + { + var genericArguments = valueType.GetGenericArguments(); + if (genericArguments.Length == 1) + { + var listItemType = GetGraphQlTypeName(valueType.GetGenericArguments()[0]); + return listItemType == null ? null : "[" + listItemType + "]"; + } + } + + if (GraphQlTypes.ReverseMapping.TryGetValue(valueType, out var graphQlTypeName)) + return graphQlTypeName; + + if (valueType == typeof(string)) + return "String"; + + var nullableSuffix = nullableUnderlyingType == null ? null : "?"; + graphQlTypeName = GetValueTypeGraphQlTypeName(valueType); + return graphQlTypeName == null ? null : graphQlTypeName + nullableSuffix; + } + + private static string GetValueTypeGraphQlTypeName(global::System.Type valueType) + { + if (valueType == typeof(bool)) + return "Boolean"; + + if (valueType == typeof(float) || valueType == typeof(double) || valueType == typeof(decimal)) + return "Float"; + + if (valueType == typeof(Guid)) + return "ID"; + + if (valueType == typeof(sbyte) || valueType == typeof(byte) || valueType == typeof(short) || valueType == typeof(ushort) || valueType == typeof(int) || valueType == typeof(uint) || + valueType == typeof(long) || valueType == typeof(ulong)) + return "Int"; + + return null; + } + } + + public abstract class GraphQlDirective + { + private readonly Dictionary _arguments = new Dictionary(); + + internal IEnumerable> Arguments => _arguments; + + public string Name { get; } + + protected GraphQlDirective(string name) + { + GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(name), name); + Name = name; + } + + protected void AddArgument(string name, QueryBuilderParameter value) + { + if (value != null) + _arguments[name] = value; + } + } + + public class GraphQlBuilderOptions + { + public Formatting Formatting { get; set; } + public byte IndentationSize { get; set; } = 2; + public IGraphQlArgumentBuilder ArgumentBuilder { get; set; } + } + + public abstract partial class GraphQlQueryBuilder : IGraphQlQueryBuilder + { + private readonly Dictionary _fieldCriteria = new Dictionary(); + + private readonly string _operationType; + private readonly string _operationName; + private Dictionary _fragments; + private List _queryParameters; + + protected abstract string TypeName { get; } + + public abstract IReadOnlyList AllFields { get; } + + protected GraphQlQueryBuilder(string operationType, string operationName) + { + GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(operationName), operationName); + _operationType = operationType; + _operationName = operationName; + } + + public virtual void Clear() + { + _fieldCriteria.Clear(); + _fragments?.Clear(); + _queryParameters?.Clear(); + } + + void IGraphQlQueryBuilder.IncludeAllFields() + { + IncludeAllFields(); + } + + public string Build(Formatting formatting = Formatting.None, byte indentationSize = 2) + { + return Build(new GraphQlBuilderOptions { Formatting = formatting, IndentationSize = indentationSize }); + } + + public string Build(GraphQlBuilderOptions options) + { + return Build(options, 1); + } + + protected void IncludeAllFields() + { + IncludeFields(AllFields.Where(f => !f.RequiresParameters)); + } + + protected virtual string Build(GraphQlBuilderOptions options, int level) + { + var isIndentedFormatting = options.Formatting == Formatting.Indented; + var separator = String.Empty; + var indentationSpace = isIndentedFormatting ? " " : String.Empty; + var builder = new StringBuilder(); + + BuildOperationSignature(builder, options, indentationSpace, level); + + if (builder.Length > 0 || level > 1) + builder.Append(indentationSpace); + + builder.Append("{"); + + if (isIndentedFormatting) + builder.AppendLine(); + + separator = String.Empty; + + foreach (var criteria in _fieldCriteria.Values.Concat(_fragments?.Values ?? Enumerable.Empty())) + { + var fieldCriteria = criteria.Build(options, level); + if (isIndentedFormatting) + builder.AppendLine(fieldCriteria); + else if (!String.IsNullOrEmpty(fieldCriteria)) + { + builder.Append(separator); + builder.Append(fieldCriteria); + } + + separator = ","; + } + + if (isIndentedFormatting) + builder.Append(GraphQlQueryHelper.GetIndentation(level - 1, options.IndentationSize)); + + builder.Append("}"); + + return builder.ToString(); + } + + private void BuildOperationSignature(StringBuilder builder, GraphQlBuilderOptions options, string indentationSpace, int level) + { + if (String.IsNullOrEmpty(_operationType)) + return; + + builder.Append(_operationType); + + if (!String.IsNullOrEmpty(_operationName)) + { + builder.Append(" "); + builder.Append(_operationName); + } + + if (_queryParameters?.Count > 0) + { + builder.Append(indentationSpace); + builder.Append("("); + + var separator = String.Empty; + var isIndentedFormatting = options.Formatting == Formatting.Indented; + + foreach (var queryParameterInfo in _queryParameters) + { + if (isIndentedFormatting) + { + builder.AppendLine(separator); + builder.Append(GraphQlQueryHelper.GetIndentation(level, options.IndentationSize)); + } + else + builder.Append(separator); + + builder.Append("$"); + builder.Append(queryParameterInfo.ArgumentValue.Name); + builder.Append(":"); + builder.Append(indentationSpace); + + builder.Append(queryParameterInfo.ArgumentValue.GraphQlTypeName); + + if (!queryParameterInfo.ArgumentValue.GraphQlTypeName.EndsWith("!") && queryParameterInfo.ArgumentValue.Value is not null) + { + builder.Append(indentationSpace); + builder.Append("="); + builder.Append(indentationSpace); + builder.Append(GraphQlQueryHelper.BuildArgumentValue(queryParameterInfo.ArgumentValue.Value, queryParameterInfo.FormatMask, options, 0)); + } + + if (!isIndentedFormatting) + separator = ","; + } + + builder.Append(")"); + } + } + + protected void IncludeScalarField(string fieldName, string alias, IList args, GraphQlDirective[] directives) + { + _fieldCriteria[alias ?? fieldName] = new GraphQlScalarFieldCriteria(fieldName, alias, args, directives); + } + + protected void IncludeObjectField(string fieldName, string alias, GraphQlQueryBuilder objectFieldQueryBuilder, IList args, GraphQlDirective[] directives) + { + _fieldCriteria[alias ?? fieldName] = new GraphQlObjectFieldCriteria(fieldName, alias, objectFieldQueryBuilder, args, directives); + } + + protected void IncludeFragment(GraphQlQueryBuilder objectFieldQueryBuilder, GraphQlDirective[] directives) + { + _fragments = _fragments ?? new Dictionary(); + _fragments[objectFieldQueryBuilder.TypeName] = new GraphQlFragmentCriteria(objectFieldQueryBuilder, directives); + } + + protected void ExcludeField(string fieldName) + { + if (fieldName == null) + throw new ArgumentNullException(nameof(fieldName)); + + _fieldCriteria.Remove(fieldName); + } + + protected void IncludeFields(IEnumerable fields) + { + IncludeFields(fields, 0, new Dictionary()); + } + + private void IncludeFields(IEnumerable fields, int level, Dictionary parentTypeLevel) + { + global::System.Type builderType = null; + + foreach (var field in fields) + { + if (field.QueryBuilderType == null) + IncludeScalarField(field.Name, field.DefaultAlias, null, null); + else + { + if (_operationType != null && GetType() == field.QueryBuilderType || + parentTypeLevel.TryGetValue(field.QueryBuilderType, out var parentLevel) && parentLevel < level) + continue; + + if (builderType is null) + { + builderType = GetType(); + parentLevel = parentTypeLevel.TryGetValue(builderType, out parentLevel) ? parentLevel : level; + parentTypeLevel[builderType] = Math.Min(level, parentLevel); + } + + var queryBuilder = InitializeChildQueryBuilder(builderType, field.QueryBuilderType, level, parentTypeLevel); + + var includeFragmentMethods = field.QueryBuilderType.GetMethods().Where(IsIncludeFragmentMethod); + + foreach (var includeFragmentMethod in includeFragmentMethods) + includeFragmentMethod.Invoke( + queryBuilder, + new object[] { InitializeChildQueryBuilder(builderType, includeFragmentMethod.GetParameters()[0].ParameterType, level, parentTypeLevel) }); + + if (queryBuilder._fieldCriteria.Count > 0 || queryBuilder._fragments != null) + IncludeObjectField(field.Name, field.DefaultAlias, queryBuilder, null, null); + } + } + } + + private static GraphQlQueryBuilder InitializeChildQueryBuilder(global::System.Type parentQueryBuilderType, global::System.Type queryBuilderType, int level, Dictionary parentTypeLevel) + { + var queryBuilder = (GraphQlQueryBuilder)Activator.CreateInstance(queryBuilderType); + queryBuilder.IncludeFields( + queryBuilder.AllFields.Where(f => !f.RequiresParameters), + level + 1, + parentTypeLevel); + + return queryBuilder; + } + + private static bool IsIncludeFragmentMethod(MethodInfo methodInfo) + { + if (!methodInfo.Name.StartsWith("With") || !methodInfo.Name.EndsWith("Fragment")) + return false; + + var parameters = methodInfo.GetParameters(); + return parameters.Length == 1 && parameters[0].ParameterType.IsSubclassOf(typeof(GraphQlQueryBuilder)); + } + + protected void AddParameter(GraphQlQueryParameter parameter) + { + if (_queryParameters == null) + _queryParameters = new List(); + + _queryParameters.Add(new QueryBuilderArgumentInfo { ArgumentValue = parameter, FormatMask = parameter.FormatMask }); + } + + private abstract class GraphQlFieldCriteria + { + private readonly IList _args; + private readonly GraphQlDirective[] _directives; + + protected readonly string FieldName; + protected readonly string Alias; + + protected static string GetIndentation(Formatting formatting, int level, byte indentationSize) => + formatting == Formatting.Indented ? GraphQlQueryHelper.GetIndentation(level, indentationSize) : null; + + protected GraphQlFieldCriteria(string fieldName, string alias, IList args, GraphQlDirective[] directives) + { + GraphQlQueryHelper.ValidateGraphQlIdentifier(nameof(alias), alias); + FieldName = fieldName; + Alias = alias; + _args = args; + _directives = directives; + } + + public abstract string Build(GraphQlBuilderOptions options, int level); + + protected string BuildArgumentClause(GraphQlBuilderOptions options, int level) + { + var separator = options.Formatting == Formatting.Indented ? " " : null; + var argumentCount = _args?.Count ?? 0; + if (argumentCount == 0) + return String.Empty; + + var arguments = + _args.Select( + a => $"{a.ArgumentName}:{separator}{(a.ArgumentValue.Name == null ? GraphQlQueryHelper.BuildArgumentValue(a.ArgumentValue.Value, a.FormatMask, options, level) : $"${a.ArgumentValue.Name}")}"); + + return $"({String.Join($",{separator}", arguments)})"; + } + + protected string BuildDirectiveClause(GraphQlBuilderOptions options, int level) => + _directives == null ? null : String.Concat(_directives.Select(d => d == null ? null : GraphQlQueryHelper.BuildDirective(d, options, level))); + + protected static string BuildAliasPrefix(string alias, Formatting formatting) + { + var separator = formatting == Formatting.Indented ? " " : String.Empty; + return String.IsNullOrWhiteSpace(alias) ? null : $"{alias}:{separator}"; + } + } + + private class GraphQlScalarFieldCriteria : GraphQlFieldCriteria + { + public GraphQlScalarFieldCriteria(string fieldName, string alias, IList args, GraphQlDirective[] directives) + : base(fieldName, alias, args, directives) + { + } + + public override string Build(GraphQlBuilderOptions options, int level) => + GetIndentation(options.Formatting, level, options.IndentationSize) + + BuildAliasPrefix(Alias, options.Formatting) + + FieldName + + BuildArgumentClause(options, level) + + BuildDirectiveClause(options, level); + } + + private class GraphQlObjectFieldCriteria : GraphQlFieldCriteria + { + private readonly GraphQlQueryBuilder _objectQueryBuilder; + + public GraphQlObjectFieldCriteria(string fieldName, string alias, GraphQlQueryBuilder objectQueryBuilder, IList args, GraphQlDirective[] directives) + : base(fieldName, alias, args, directives) + { + _objectQueryBuilder = objectQueryBuilder; + } + + public override string Build(GraphQlBuilderOptions options, int level) => + _objectQueryBuilder._fieldCriteria.Count > 0 || _objectQueryBuilder._fragments?.Count > 0 + ? GetIndentation(options.Formatting, level, options.IndentationSize) + BuildAliasPrefix(Alias, options.Formatting) + FieldName + + BuildArgumentClause(options, level) + BuildDirectiveClause(options, level) + _objectQueryBuilder.Build(options, level + 1) + : null; + } + + private class GraphQlFragmentCriteria : GraphQlFieldCriteria + { + private readonly GraphQlQueryBuilder _objectQueryBuilder; + + public GraphQlFragmentCriteria(GraphQlQueryBuilder objectQueryBuilder, GraphQlDirective[] directives) : base(objectQueryBuilder.TypeName, null, null, directives) + { + _objectQueryBuilder = objectQueryBuilder; + } + + public override string Build(GraphQlBuilderOptions options, int level) => + _objectQueryBuilder._fieldCriteria.Count == 0 + ? null + : GetIndentation(options.Formatting, level, options.IndentationSize) + "..." + (options.Formatting == Formatting.Indented ? " " : null) + "on " + + FieldName + BuildArgumentClause(options, level) + BuildDirectiveClause(options, level) + _objectQueryBuilder.Build(options, level + 1); + } + } + + public abstract partial class GraphQlQueryBuilder : GraphQlQueryBuilder where TQueryBuilder : GraphQlQueryBuilder + { + protected GraphQlQueryBuilder(string operationType = null, string operationName = null) : base(operationType, operationName) + { + } + + /// + /// Includes all fields that don't require parameters into the query. + /// + public TQueryBuilder WithAllFields() + { + IncludeAllFields(); + return (TQueryBuilder)this; + } + + /// + /// Includes all scalar fields that don't require parameters into the query. + /// + public TQueryBuilder WithAllScalarFields() + { + IncludeFields(AllFields.Where(f => !f.IsComplex && !f.RequiresParameters)); + return (TQueryBuilder)this; + } + + public TQueryBuilder ExceptField(string fieldName) + { + ExcludeField(fieldName); + return (TQueryBuilder)this; + } + + /// + /// Includes "__typename" field; included automatically for interface and union types. + /// + public TQueryBuilder WithTypeName(string alias = null, params GraphQlDirective[] directives) + { + IncludeScalarField("__typename", alias, null, directives); + return (TQueryBuilder)this; + } + + protected TQueryBuilder WithScalarField(string fieldName, string alias, GraphQlDirective[] directives, IList args = null) + { + IncludeScalarField(fieldName, alias, args, directives); + return (TQueryBuilder)this; + } + + protected TQueryBuilder WithObjectField(string fieldName, string alias, GraphQlQueryBuilder queryBuilder, GraphQlDirective[] directives, IList args = null) + { + IncludeObjectField(fieldName, alias, queryBuilder, args, directives); + return (TQueryBuilder)this; + } + + protected TQueryBuilder WithFragment(GraphQlQueryBuilder queryBuilder, GraphQlDirective[] directives) + { + IncludeFragment(queryBuilder, directives); + return (TQueryBuilder)this; + } + + protected TQueryBuilder WithParameterInternal(GraphQlQueryParameter parameter) + { + AddParameter(parameter); + return (TQueryBuilder)this; + } + } + + public abstract class GraphQlResponse + { + public TDataContract Data { get; set; } + public ICollection Errors { get; set; } + } + + public class GraphQlQueryError + { + public string Message { get; set; } + public ICollection Locations { get; set; } + } + + public class GraphQlErrorLocation + { + public int Line { get; set; } + public int Column { get; set; } + } + #endregion + + #region GraphQL type helpers + public static class GraphQlTypes + { + public const string Boolean = "Boolean"; + public const string DateTime = "DateTime"; + public const string EmailAddress = "EmailAddress"; + public const string Id = "ID"; + public const string Int = "Int"; + public const string String = "String"; + public const string Uuid = "UUID"; + + public const string UserRole = "UserRole"; + + public const string AuthenticationError = "AuthenticationError"; + public const string Checkpoint = "Checkpoint"; + public const string LiveDoc = "LiveDoc"; + public const string LiveDocPullBulk = "LiveDocPullBulk"; + public const string Mutation = "Mutation"; + public const string PushLiveDocPayload = "PushLiveDocPayload"; + public const string PushUserPayload = "PushUserPayload"; + public const string PushWorkspacePayload = "PushWorkspacePayload"; + public const string Query = "Query"; + public const string Subscription = "Subscription"; + public const string UnauthorizedAccessError = "UnauthorizedAccessError"; + public const string User = "User"; + public const string UserPullBulk = "UserPullBulk"; + public const string Workspace = "Workspace"; + public const string WorkspacePullBulk = "WorkspacePullBulk"; + + public const string BooleanOperationFilterInput = "BooleanOperationFilterInput"; + public const string DateTimeOperationFilterInput = "DateTimeOperationFilterInput"; + public const string ListStringOperationFilterInput = "ListStringOperationFilterInput"; + public const string LiveDocFilterInput = "LiveDocFilterInput"; + public const string LiveDocInput = "LiveDocInput"; + public const string LiveDocInputCheckpoint = "LiveDocInputCheckpoint"; + public const string LiveDocInputHeaders = "LiveDocInputHeaders"; + public const string LiveDocInputPushRow = "LiveDocInputPushRow"; + public const string PushLiveDocInput = "PushLiveDocInput"; + public const string PushUserInput = "PushUserInput"; + public const string PushWorkspaceInput = "PushWorkspaceInput"; + public const string StringOperationFilterInput = "StringOperationFilterInput"; + public const string UserFilterInput = "UserFilterInput"; + public const string UserInput = "UserInput"; + public const string UserInputCheckpoint = "UserInputCheckpoint"; + public const string UserInputHeaders = "UserInputHeaders"; + public const string UserInputPushRow = "UserInputPushRow"; + public const string UserRoleOperationFilterInput = "UserRoleOperationFilterInput"; + public const string UuidOperationFilterInput = "UuidOperationFilterInput"; + public const string WorkspaceFilterInput = "WorkspaceFilterInput"; + public const string WorkspaceInput = "WorkspaceInput"; + public const string WorkspaceInputCheckpoint = "WorkspaceInputCheckpoint"; + public const string WorkspaceInputHeaders = "WorkspaceInputHeaders"; + public const string WorkspaceInputPushRow = "WorkspaceInputPushRow"; + + public const string PushLiveDocError = "PushLiveDocError"; + public const string PushUserError = "PushUserError"; + public const string PushWorkspaceError = "PushWorkspaceError"; + + public const string Error = "Error"; + + public static readonly IReadOnlyDictionary ReverseMapping = + new Dictionary + { + { typeof(string), "String" }, + { typeof(Guid), "UUID" }, + { typeof(DateTimeOffset), "DateTime" }, + { typeof(bool), "Boolean" }, + { typeof(BooleanOperationFilterInputGql), "BooleanOperationFilterInput" }, + { typeof(DateTimeOperationFilterInputGql), "DateTimeOperationFilterInput" }, + { typeof(ListStringOperationFilterInputGql), "ListStringOperationFilterInput" }, + { typeof(LiveDocFilterInputGql), "LiveDocFilterInput" }, + { typeof(LiveDocInputGql), "LiveDocInput" }, + { typeof(LiveDocInputCheckpointGql), "LiveDocInputCheckpoint" }, + { typeof(LiveDocInputHeadersGql), "LiveDocInputHeaders" }, + { typeof(LiveDocInputPushRowGql), "LiveDocInputPushRow" }, + { typeof(PushLiveDocInputGql), "PushLiveDocInput" }, + { typeof(PushUserInputGql), "PushUserInput" }, + { typeof(PushWorkspaceInputGql), "PushWorkspaceInput" }, + { typeof(StringOperationFilterInputGql), "StringOperationFilterInput" }, + { typeof(UserFilterInputGql), "UserFilterInput" }, + { typeof(UserInputGql), "UserInput" }, + { typeof(UserInputCheckpointGql), "UserInputCheckpoint" }, + { typeof(UserInputHeadersGql), "UserInputHeaders" }, + { typeof(UserInputPushRowGql), "UserInputPushRow" }, + { typeof(UserRoleOperationFilterInputGql), "UserRoleOperationFilterInput" }, + { typeof(UuidOperationFilterInputGql), "UuidOperationFilterInput" }, + { typeof(WorkspaceFilterInputGql), "WorkspaceFilterInput" }, + { typeof(WorkspaceInputGql), "WorkspaceInput" }, + { typeof(WorkspaceInputCheckpointGql), "WorkspaceInputCheckpoint" }, + { typeof(WorkspaceInputHeadersGql), "WorkspaceInputHeaders" }, + { typeof(WorkspaceInputPushRowGql), "WorkspaceInputPushRow" } + }; +} + #endregion + + #region enums + public enum UserRoleGql + { + StandardUser, + WorkspaceAdmin, + SystemAdmin + } + #endregion + + #nullable enable + #region directives + public class SkipDirective : GraphQlDirective + { + public SkipDirective(QueryBuilderParameter @if) : base("skip") + { + AddArgument("if", @if); + } + } + + public class IncludeDirective : GraphQlDirective + { + public IncludeDirective(QueryBuilderParameter @if) : base("include") + { + AddArgument("if", @if); + } + } + #endregion + + #region builder classes + public partial class UserPullBulkQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(UserQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "UserPullBulk"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public UserPullBulkQueryBuilderGql WithDocuments(UserQueryBuilderGql userQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, userQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public UserPullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); + + public UserPullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public UserPullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); + } + + public partial class WorkspacePullBulkQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(WorkspaceQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "WorkspacePullBulk"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public WorkspacePullBulkQueryBuilderGql WithDocuments(WorkspaceQueryBuilderGql workspaceQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, workspaceQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public WorkspacePullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); + + public WorkspacePullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public WorkspacePullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); + } + + public partial class LiveDocPullBulkQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "documents", IsComplex = true, QueryBuilderType = typeof(LiveDocQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "checkpoint", IsComplex = true, QueryBuilderType = typeof(CheckpointQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "LiveDocPullBulk"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public LiveDocPullBulkQueryBuilderGql WithDocuments(LiveDocQueryBuilderGql liveDocQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("documents", alias, liveDocQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public LiveDocPullBulkQueryBuilderGql ExceptDocuments() => ExceptField("documents"); + + public LiveDocPullBulkQueryBuilderGql WithCheckpoint(CheckpointQueryBuilderGql checkpointQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("checkpoint", alias, checkpointQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public LiveDocPullBulkQueryBuilderGql ExceptCheckpoint() => ExceptField("checkpoint"); + } + + public partial class QueryQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "pullUser", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(UserPullBulkQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "pullWorkspace", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(WorkspacePullBulkQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "pullLiveDoc", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(LiveDocPullBulkQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "Query"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public QueryQueryBuilderGql(string? operationName = null) : base("query", operationName) + { + } + + public QueryQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); + + public QueryQueryBuilderGql WithPullUser(UserPullBulkQueryBuilderGql userPullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (checkpoint != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); + + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); + if (where != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); + + return WithObjectField("pullUser", alias, userPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public QueryQueryBuilderGql ExceptPullUser() => ExceptField("pullUser"); + + public QueryQueryBuilderGql WithPullWorkspace(WorkspacePullBulkQueryBuilderGql workspacePullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (checkpoint != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); + + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); + if (where != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); + + return WithObjectField("pullWorkspace", alias, workspacePullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public QueryQueryBuilderGql ExceptPullWorkspace() => ExceptField("pullWorkspace"); + + public QueryQueryBuilderGql WithPullLiveDoc(LiveDocPullBulkQueryBuilderGql liveDocPullBulkQueryBuilder, QueryBuilderParameter limit, QueryBuilderParameter? checkpoint = null, QueryBuilderParameter? where = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (checkpoint != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "checkpoint", ArgumentValue = checkpoint} ); + + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "limit", ArgumentValue = limit} ); + if (where != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "where", ArgumentValue = where} ); + + return WithObjectField("pullLiveDoc", alias, liveDocPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public QueryQueryBuilderGql ExceptPullLiveDoc() => ExceptField("pullLiveDoc"); + } + + public partial class MutationQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "pushUser", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushUserPayloadQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "pushWorkspace", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushWorkspacePayloadQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "pushLiveDoc", RequiresParameters = true, IsComplex = true, QueryBuilderType = typeof(PushLiveDocPayloadQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "Mutation"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public MutationQueryBuilderGql(string? operationName = null) : base("mutation", operationName) + { + } + + public MutationQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); + + public MutationQueryBuilderGql WithPushUser(PushUserPayloadQueryBuilderGql pushUserPayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); + return WithObjectField("pushUser", alias, pushUserPayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public MutationQueryBuilderGql ExceptPushUser() => ExceptField("pushUser"); + + public MutationQueryBuilderGql WithPushWorkspace(PushWorkspacePayloadQueryBuilderGql pushWorkspacePayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); + return WithObjectField("pushWorkspace", alias, pushWorkspacePayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public MutationQueryBuilderGql ExceptPushWorkspace() => ExceptField("pushWorkspace"); + + public MutationQueryBuilderGql WithPushLiveDoc(PushLiveDocPayloadQueryBuilderGql pushLiveDocPayloadQueryBuilder, QueryBuilderParameter input, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "input", ArgumentValue = input} ); + return WithObjectField("pushLiveDoc", alias, pushLiveDocPayloadQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public MutationQueryBuilderGql ExceptPushLiveDoc() => ExceptField("pushLiveDoc"); + } + + public partial class SubscriptionQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "streamUser", IsComplex = true, QueryBuilderType = typeof(UserPullBulkQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "streamWorkspace", IsComplex = true, QueryBuilderType = typeof(WorkspacePullBulkQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "streamLiveDoc", IsComplex = true, QueryBuilderType = typeof(LiveDocPullBulkQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "Subscription"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public SubscriptionQueryBuilderGql(string? operationName = null) : base("subscription", operationName) + { + } + + public SubscriptionQueryBuilderGql WithParameter(GraphQlQueryParameter parameter) => WithParameterInternal(parameter); + + public SubscriptionQueryBuilderGql WithStreamUser(UserPullBulkQueryBuilderGql userPullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (headers != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); + + if (topics != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); + + return WithObjectField("streamUser", alias, userPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public SubscriptionQueryBuilderGql ExceptStreamUser() => ExceptField("streamUser"); + + public SubscriptionQueryBuilderGql WithStreamWorkspace(WorkspacePullBulkQueryBuilderGql workspacePullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (headers != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); + + if (topics != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); + + return WithObjectField("streamWorkspace", alias, workspacePullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public SubscriptionQueryBuilderGql ExceptStreamWorkspace() => ExceptField("streamWorkspace"); + + public SubscriptionQueryBuilderGql WithStreamLiveDoc(LiveDocPullBulkQueryBuilderGql liveDocPullBulkQueryBuilder, QueryBuilderParameter? headers = null, QueryBuilderParameter>? topics = null, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) + { + var args = new List(); + if (headers != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "headers", ArgumentValue = headers} ); + + if (topics != null) + args.Add(new QueryBuilderArgumentInfo { ArgumentName = "topics", ArgumentValue = topics} ); + + return WithObjectField("streamLiveDoc", alias, liveDocPullBulkQueryBuilder, new GraphQlDirective?[] { skip, include }, args); + } + + public SubscriptionQueryBuilderGql ExceptStreamLiveDoc() => ExceptField("streamLiveDoc"); + } + + public partial class UserQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "firstName" }, + new GraphQlFieldMetadata { Name = "lastName" }, + new GraphQlFieldMetadata { Name = "fullName" }, + new GraphQlFieldMetadata { Name = "email" }, + new GraphQlFieldMetadata { Name = "role" }, + new GraphQlFieldMetadata { Name = "jwtAccessToken" }, + new GraphQlFieldMetadata { Name = "workspaceId" }, + new GraphQlFieldMetadata { Name = "id" }, + new GraphQlFieldMetadata { Name = "isDeleted" }, + new GraphQlFieldMetadata { Name = "updatedAt" }, + new GraphQlFieldMetadata { Name = "topics", IsComplex = true } + }; + + protected override string TypeName { get; } = "User"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public UserQueryBuilderGql WithFirstName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("firstName", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptFirstName() => ExceptField("firstName"); + + public UserQueryBuilderGql WithLastName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("lastName", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptLastName() => ExceptField("lastName"); + + public UserQueryBuilderGql WithFullName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("fullName", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptFullName() => ExceptField("fullName"); + + public UserQueryBuilderGql WithEmail(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("email", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptEmail() => ExceptField("email"); + + public UserQueryBuilderGql WithRole(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("role", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptRole() => ExceptField("role"); + + public UserQueryBuilderGql WithJwtAccessToken(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("jwtAccessToken", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptJwtAccessToken() => ExceptField("jwtAccessToken"); + + public UserQueryBuilderGql WithWorkspaceId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("workspaceId", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptWorkspaceId() => ExceptField("workspaceId"); + + public UserQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptId() => ExceptField("id"); + + public UserQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); + + public UserQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); + + public UserQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); + + public UserQueryBuilderGql ExceptTopics() => ExceptField("topics"); + } + + public partial class CheckpointQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "lastDocumentId" }, + new GraphQlFieldMetadata { Name = "updatedAt" } + }; + + protected override string TypeName { get; } = "Checkpoint"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public CheckpointQueryBuilderGql WithLastDocumentId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("lastDocumentId", alias, new GraphQlDirective?[] { skip, include }); + + public CheckpointQueryBuilderGql ExceptLastDocumentId() => ExceptField("lastDocumentId"); + + public CheckpointQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); + + public CheckpointQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); + } + + public partial class AuthenticationErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "message" } + }; + + protected override string TypeName { get; } = "AuthenticationError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public AuthenticationErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); + + public AuthenticationErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); + } + + public partial class UnauthorizedAccessErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "message" } + }; + + protected override string TypeName { get; } = "UnauthorizedAccessError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public UnauthorizedAccessErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); + + public UnauthorizedAccessErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); + } + + public partial class WorkspaceQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "name" }, + new GraphQlFieldMetadata { Name = "id" }, + new GraphQlFieldMetadata { Name = "isDeleted" }, + new GraphQlFieldMetadata { Name = "updatedAt" }, + new GraphQlFieldMetadata { Name = "topics", IsComplex = true } + }; + + protected override string TypeName { get; } = "Workspace"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public WorkspaceQueryBuilderGql WithName(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("name", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptName() => ExceptField("name"); + + public WorkspaceQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptId() => ExceptField("id"); + + public WorkspaceQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); + + public WorkspaceQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); + + public WorkspaceQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); + + public WorkspaceQueryBuilderGql ExceptTopics() => ExceptField("topics"); + } + + public partial class LiveDocQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "content" }, + new GraphQlFieldMetadata { Name = "ownerId" }, + new GraphQlFieldMetadata { Name = "workspaceId" }, + new GraphQlFieldMetadata { Name = "id" }, + new GraphQlFieldMetadata { Name = "isDeleted" }, + new GraphQlFieldMetadata { Name = "updatedAt" }, + new GraphQlFieldMetadata { Name = "topics", IsComplex = true } + }; + + protected override string TypeName { get; } = "LiveDoc"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public LiveDocQueryBuilderGql WithContent(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("content", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptContent() => ExceptField("content"); + + public LiveDocQueryBuilderGql WithOwnerId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("ownerId", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptOwnerId() => ExceptField("ownerId"); + + public LiveDocQueryBuilderGql WithWorkspaceId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("workspaceId", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptWorkspaceId() => ExceptField("workspaceId"); + + public LiveDocQueryBuilderGql WithId(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("id", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptId() => ExceptField("id"); + + public LiveDocQueryBuilderGql WithIsDeleted(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("isDeleted", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptIsDeleted() => ExceptField("isDeleted"); + + public LiveDocQueryBuilderGql WithUpdatedAt(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("updatedAt", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptUpdatedAt() => ExceptField("updatedAt"); + + public LiveDocQueryBuilderGql WithTopics(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("topics", alias, new GraphQlDirective?[] { skip, include }); + + public LiveDocQueryBuilderGql ExceptTopics() => ExceptField("topics"); + } + + public partial class ErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "message" } + }; + + public ErrorQueryBuilderGql() => WithTypeName(); + + protected override string TypeName { get; } = "Error"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public ErrorQueryBuilderGql WithMessage(string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithScalarField("message", alias, new GraphQlDirective?[] { skip, include }); + + public ErrorQueryBuilderGql ExceptMessage() => ExceptField("message"); + + public ErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public ErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + } + + public partial class PushUserErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); + + public PushUserErrorQueryBuilderGql() => WithTypeName(); + + protected override string TypeName { get; } = "PushUserError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushUserErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushUserErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + } + + public partial class PushUserPayloadQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "user", IsComplex = true, QueryBuilderType = typeof(UserQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushUserErrorQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "PushUserPayload"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushUserPayloadQueryBuilderGql WithUser(UserQueryBuilderGql userQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("user", alias, userQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushUserPayloadQueryBuilderGql ExceptUser() => ExceptField("user"); + + public PushUserPayloadQueryBuilderGql WithErrors(PushUserErrorQueryBuilderGql pushUserErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushUserErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushUserPayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); + } + + public partial class PushWorkspaceErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); + + public PushWorkspaceErrorQueryBuilderGql() => WithTypeName(); + + protected override string TypeName { get; } = "PushWorkspaceError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushWorkspaceErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushWorkspaceErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + } + + public partial class PushWorkspacePayloadQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "workspace", IsComplex = true, QueryBuilderType = typeof(WorkspaceQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushWorkspaceErrorQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "PushWorkspacePayload"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushWorkspacePayloadQueryBuilderGql WithWorkspace(WorkspaceQueryBuilderGql workspaceQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("workspace", alias, workspaceQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushWorkspacePayloadQueryBuilderGql ExceptWorkspace() => ExceptField("workspace"); + + public PushWorkspacePayloadQueryBuilderGql WithErrors(PushWorkspaceErrorQueryBuilderGql pushWorkspaceErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushWorkspaceErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushWorkspacePayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); + } + + public partial class PushLiveDocErrorQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = Array.Empty(); + + public PushLiveDocErrorQueryBuilderGql() => WithTypeName(); + + protected override string TypeName { get; } = "PushLiveDocError"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushLiveDocErrorQueryBuilderGql WithAuthenticationErrorFragment(AuthenticationErrorQueryBuilderGql authenticationErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(authenticationErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushLiveDocErrorQueryBuilderGql WithUnauthorizedAccessErrorFragment(UnauthorizedAccessErrorQueryBuilderGql unauthorizedAccessErrorQueryBuilder, SkipDirective? skip = null, IncludeDirective? include = null) => WithFragment(unauthorizedAccessErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + } + + public partial class PushLiveDocPayloadQueryBuilderGql : GraphQlQueryBuilder + { + private static readonly GraphQlFieldMetadata[] AllFieldMetadata = + { + new GraphQlFieldMetadata { Name = "liveDoc", IsComplex = true, QueryBuilderType = typeof(LiveDocQueryBuilderGql) }, + new GraphQlFieldMetadata { Name = "errors", IsComplex = true, QueryBuilderType = typeof(PushLiveDocErrorQueryBuilderGql) } + }; + + protected override string TypeName { get; } = "PushLiveDocPayload"; + + public override IReadOnlyList AllFields { get; } = AllFieldMetadata; + + public PushLiveDocPayloadQueryBuilderGql WithLiveDoc(LiveDocQueryBuilderGql liveDocQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("liveDoc", alias, liveDocQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushLiveDocPayloadQueryBuilderGql ExceptLiveDoc() => ExceptField("liveDoc"); + + public PushLiveDocPayloadQueryBuilderGql WithErrors(PushLiveDocErrorQueryBuilderGql pushLiveDocErrorQueryBuilder, string? alias = null, SkipDirective? skip = null, IncludeDirective? include = null) => WithObjectField("errors", alias, pushLiveDocErrorQueryBuilder, new GraphQlDirective?[] { skip, include }); + + public PushLiveDocPayloadQueryBuilderGql ExceptErrors() => ExceptField("errors"); + } + #endregion + + #region input classes + public partial class UserInputCheckpointGql : IGraphQlInputObject + { + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _lastDocumentId; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastDocumentId + { + get => (QueryBuilderParameter?)_lastDocumentId.Value; + set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_updatedAt.Name != null) yield return _updatedAt; + if (_lastDocumentId.Name != null) yield return _lastDocumentId; + } + } + + public partial class UserInputPushRowGql : IGraphQlInputObject + { + private InputPropertyInfo _assumedMasterState; + private InputPropertyInfo _newDocumentState; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? AssumedMasterState + { + get => (QueryBuilderParameter?)_assumedMasterState.Value; + set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NewDocumentState + { + get => (QueryBuilderParameter?)_newDocumentState.Value; + set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_assumedMasterState.Name != null) yield return _assumedMasterState; + if (_newDocumentState.Name != null) yield return _newDocumentState; + } + } + + public partial class WorkspaceInputCheckpointGql : IGraphQlInputObject + { + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _lastDocumentId; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastDocumentId + { + get => (QueryBuilderParameter?)_lastDocumentId.Value; + set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_updatedAt.Name != null) yield return _updatedAt; + if (_lastDocumentId.Name != null) yield return _lastDocumentId; + } + } + + public partial class WorkspaceInputPushRowGql : IGraphQlInputObject + { + private InputPropertyInfo _assumedMasterState; + private InputPropertyInfo _newDocumentState; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? AssumedMasterState + { + get => (QueryBuilderParameter?)_assumedMasterState.Value; + set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NewDocumentState + { + get => (QueryBuilderParameter?)_newDocumentState.Value; + set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_assumedMasterState.Name != null) yield return _assumedMasterState; + if (_newDocumentState.Name != null) yield return _newDocumentState; + } + } + + public partial class LiveDocInputCheckpointGql : IGraphQlInputObject + { + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _lastDocumentId; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastDocumentId + { + get => (QueryBuilderParameter?)_lastDocumentId.Value; + set => _lastDocumentId = new InputPropertyInfo { Name = "lastDocumentId", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_updatedAt.Name != null) yield return _updatedAt; + if (_lastDocumentId.Name != null) yield return _lastDocumentId; + } + } + + public partial class LiveDocInputPushRowGql : IGraphQlInputObject + { + private InputPropertyInfo _assumedMasterState; + private InputPropertyInfo _newDocumentState; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? AssumedMasterState + { + get => (QueryBuilderParameter?)_assumedMasterState.Value; + set => _assumedMasterState = new InputPropertyInfo { Name = "assumedMasterState", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NewDocumentState + { + get => (QueryBuilderParameter?)_newDocumentState.Value; + set => _newDocumentState = new InputPropertyInfo { Name = "newDocumentState", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_assumedMasterState.Name != null) yield return _assumedMasterState; + if (_newDocumentState.Name != null) yield return _newDocumentState; + } + } + + public partial class UserFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _and; + private InputPropertyInfo _or; + private InputPropertyInfo _firstName; + private InputPropertyInfo _lastName; + private InputPropertyInfo _fullName; + private InputPropertyInfo _email; + private InputPropertyInfo _role; + private InputPropertyInfo _jwtAccessToken; + private InputPropertyInfo _workspaceId; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? And + { + get => (QueryBuilderParameter?>?)_and.Value; + set => _and = new InputPropertyInfo { Name = "and", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Or + { + get => (QueryBuilderParameter?>?)_or.Value; + set => _or = new InputPropertyInfo { Name = "or", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FirstName + { + get => (QueryBuilderParameter?)_firstName.Value; + set => _firstName = new InputPropertyInfo { Name = "firstName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastName + { + get => (QueryBuilderParameter?)_lastName.Value; + set => _lastName = new InputPropertyInfo { Name = "lastName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FullName + { + get => (QueryBuilderParameter?)_fullName.Value; + set => _fullName = new InputPropertyInfo { Name = "fullName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Email + { + get => (QueryBuilderParameter?)_email.Value; + set => _email = new InputPropertyInfo { Name = "email", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Role + { + get => (QueryBuilderParameter?)_role.Value; + set => _role = new InputPropertyInfo { Name = "role", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? JwtAccessToken + { + get => (QueryBuilderParameter?)_jwtAccessToken.Value; + set => _jwtAccessToken = new InputPropertyInfo { Name = "jwtAccessToken", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? WorkspaceId + { + get => (QueryBuilderParameter?)_workspaceId.Value; + set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Topics + { + get => (QueryBuilderParameter?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_and.Name != null) yield return _and; + if (_or.Name != null) yield return _or; + if (_firstName.Name != null) yield return _firstName; + if (_lastName.Name != null) yield return _lastName; + if (_fullName.Name != null) yield return _fullName; + if (_email.Name != null) yield return _email; + if (_role.Name != null) yield return _role; + if (_jwtAccessToken.Name != null) yield return _jwtAccessToken; + if (_workspaceId.Name != null) yield return _workspaceId; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class UserInputGql : IGraphQlInputObject + { + private InputPropertyInfo _firstName; + private InputPropertyInfo _lastName; + private InputPropertyInfo _fullName; + private InputPropertyInfo _email; + private InputPropertyInfo _role; + private InputPropertyInfo _jwtAccessToken; + private InputPropertyInfo _workspaceId; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FirstName + { + get => (QueryBuilderParameter?)_firstName.Value; + set => _firstName = new InputPropertyInfo { Name = "firstName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? LastName + { + get => (QueryBuilderParameter?)_lastName.Value; + set => _lastName = new InputPropertyInfo { Name = "lastName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? FullName + { + get => (QueryBuilderParameter?)_fullName.Value; + set => _fullName = new InputPropertyInfo { Name = "fullName", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Email + { + get => (QueryBuilderParameter?)_email.Value; + set => _email = new InputPropertyInfo { Name = "email", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Role + { + get => (QueryBuilderParameter?)_role.Value; + set => _role = new InputPropertyInfo { Name = "role", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? JwtAccessToken + { + get => (QueryBuilderParameter?)_jwtAccessToken.Value; + set => _jwtAccessToken = new InputPropertyInfo { Name = "jwtAccessToken", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? WorkspaceId + { + get => (QueryBuilderParameter?)_workspaceId.Value; + set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Topics + { + get => (QueryBuilderParameter?>?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_firstName.Name != null) yield return _firstName; + if (_lastName.Name != null) yield return _lastName; + if (_fullName.Name != null) yield return _fullName; + if (_email.Name != null) yield return _email; + if (_role.Name != null) yield return _role; + if (_jwtAccessToken.Name != null) yield return _jwtAccessToken; + if (_workspaceId.Name != null) yield return _workspaceId; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class UserInputHeadersGql : IGraphQlInputObject + { + private InputPropertyInfo _authorization; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Authorization + { + get => (QueryBuilderParameter?)_authorization.Value; + set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_authorization.Name != null) yield return _authorization; + } + } + + public partial class WorkspaceFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _and; + private InputPropertyInfo _or; + private InputPropertyInfo _name; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? And + { + get => (QueryBuilderParameter?>?)_and.Value; + set => _and = new InputPropertyInfo { Name = "and", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Or + { + get => (QueryBuilderParameter?>?)_or.Value; + set => _or = new InputPropertyInfo { Name = "or", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Name + { + get => (QueryBuilderParameter?)_name.Value; + set => _name = new InputPropertyInfo { Name = "name", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Topics + { + get => (QueryBuilderParameter?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_and.Name != null) yield return _and; + if (_or.Name != null) yield return _or; + if (_name.Name != null) yield return _name; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class WorkspaceInputGql : IGraphQlInputObject + { + private InputPropertyInfo _name; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Name + { + get => (QueryBuilderParameter?)_name.Value; + set => _name = new InputPropertyInfo { Name = "name", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Topics + { + get => (QueryBuilderParameter?>?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_name.Name != null) yield return _name; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class WorkspaceInputHeadersGql : IGraphQlInputObject + { + private InputPropertyInfo _authorization; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Authorization + { + get => (QueryBuilderParameter?)_authorization.Value; + set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_authorization.Name != null) yield return _authorization; + } + } + + public partial class LiveDocFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _and; + private InputPropertyInfo _or; + private InputPropertyInfo _content; + private InputPropertyInfo _ownerId; + private InputPropertyInfo _workspaceId; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? And + { + get => (QueryBuilderParameter?>?)_and.Value; + set => _and = new InputPropertyInfo { Name = "and", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Or + { + get => (QueryBuilderParameter?>?)_or.Value; + set => _or = new InputPropertyInfo { Name = "or", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Content + { + get => (QueryBuilderParameter?)_content.Value; + set => _content = new InputPropertyInfo { Name = "content", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? OwnerId + { + get => (QueryBuilderParameter?)_ownerId.Value; + set => _ownerId = new InputPropertyInfo { Name = "ownerId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? WorkspaceId + { + get => (QueryBuilderParameter?)_workspaceId.Value; + set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Topics + { + get => (QueryBuilderParameter?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_and.Name != null) yield return _and; + if (_or.Name != null) yield return _or; + if (_content.Name != null) yield return _content; + if (_ownerId.Name != null) yield return _ownerId; + if (_workspaceId.Name != null) yield return _workspaceId; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class LiveDocInputGql : IGraphQlInputObject + { + private InputPropertyInfo _content; + private InputPropertyInfo _ownerId; + private InputPropertyInfo _workspaceId; + private InputPropertyInfo _id; + private InputPropertyInfo _isDeleted; + private InputPropertyInfo _updatedAt; + private InputPropertyInfo _topics; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Content + { + get => (QueryBuilderParameter?)_content.Value; + set => _content = new InputPropertyInfo { Name = "content", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? OwnerId + { + get => (QueryBuilderParameter?)_ownerId.Value; + set => _ownerId = new InputPropertyInfo { Name = "ownerId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? WorkspaceId + { + get => (QueryBuilderParameter?)_workspaceId.Value; + set => _workspaceId = new InputPropertyInfo { Name = "workspaceId", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Id + { + get => (QueryBuilderParameter?)_id.Value; + set => _id = new InputPropertyInfo { Name = "id", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? IsDeleted + { + get => (QueryBuilderParameter?)_isDeleted.Value; + set => _isDeleted = new InputPropertyInfo { Name = "isDeleted", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? UpdatedAt + { + get => (QueryBuilderParameter?)_updatedAt.Value; + set => _updatedAt = new InputPropertyInfo { Name = "updatedAt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Topics + { + get => (QueryBuilderParameter?>?)_topics.Value; + set => _topics = new InputPropertyInfo { Name = "topics", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_content.Name != null) yield return _content; + if (_ownerId.Name != null) yield return _ownerId; + if (_workspaceId.Name != null) yield return _workspaceId; + if (_id.Name != null) yield return _id; + if (_isDeleted.Name != null) yield return _isDeleted; + if (_updatedAt.Name != null) yield return _updatedAt; + if (_topics.Name != null) yield return _topics; + } + } + + public partial class LiveDocInputHeadersGql : IGraphQlInputObject + { + private InputPropertyInfo _authorization; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Authorization + { + get => (QueryBuilderParameter?)_authorization.Value; + set => _authorization = new InputPropertyInfo { Name = "Authorization", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_authorization.Name != null) yield return _authorization; + } + } + + public partial class StringOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _and; + private InputPropertyInfo _or; + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + private InputPropertyInfo _contains; + private InputPropertyInfo _ncontains; + private InputPropertyInfo _in; + private InputPropertyInfo _nin; + private InputPropertyInfo _startsWith; + private InputPropertyInfo _nstartsWith; + private InputPropertyInfo _endsWith; + private InputPropertyInfo _nendsWith; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? And + { + get => (QueryBuilderParameter?>?)_and.Value; + set => _and = new InputPropertyInfo { Name = "and", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Or + { + get => (QueryBuilderParameter?>?)_or.Value; + set => _or = new InputPropertyInfo { Name = "or", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Contains + { + get => (QueryBuilderParameter?)_contains.Value; + set => _contains = new InputPropertyInfo { Name = "contains", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ncontains + { + get => (QueryBuilderParameter?)_ncontains.Value; + set => _ncontains = new InputPropertyInfo { Name = "ncontains", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? In + { + get => (QueryBuilderParameter?>?)_in.Value; + set => _in = new InputPropertyInfo { Name = "in", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Nin + { + get => (QueryBuilderParameter?>?)_nin.Value; + set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? StartsWith + { + get => (QueryBuilderParameter?)_startsWith.Value; + set => _startsWith = new InputPropertyInfo { Name = "startsWith", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NstartsWith + { + get => (QueryBuilderParameter?)_nstartsWith.Value; + set => _nstartsWith = new InputPropertyInfo { Name = "nstartsWith", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? EndsWith + { + get => (QueryBuilderParameter?)_endsWith.Value; + set => _endsWith = new InputPropertyInfo { Name = "endsWith", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? NendsWith + { + get => (QueryBuilderParameter?)_nendsWith.Value; + set => _nendsWith = new InputPropertyInfo { Name = "nendsWith", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_and.Name != null) yield return _and; + if (_or.Name != null) yield return _or; + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + if (_contains.Name != null) yield return _contains; + if (_ncontains.Name != null) yield return _ncontains; + if (_in.Name != null) yield return _in; + if (_nin.Name != null) yield return _nin; + if (_startsWith.Name != null) yield return _startsWith; + if (_nstartsWith.Name != null) yield return _nstartsWith; + if (_endsWith.Name != null) yield return _endsWith; + if (_nendsWith.Name != null) yield return _nendsWith; + } + } + + public partial class UserRoleOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + private InputPropertyInfo _in; + private InputPropertyInfo _nin; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? In + { + get => (QueryBuilderParameter?>?)_in.Value; + set => _in = new InputPropertyInfo { Name = "in", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Nin + { + get => (QueryBuilderParameter?>?)_nin.Value; + set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + if (_in.Name != null) yield return _in; + if (_nin.Name != null) yield return _nin; + } + } + + public partial class UuidOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + private InputPropertyInfo _in; + private InputPropertyInfo _nin; + private InputPropertyInfo _gt; + private InputPropertyInfo _ngt; + private InputPropertyInfo _gte; + private InputPropertyInfo _ngte; + private InputPropertyInfo _lt; + private InputPropertyInfo _nlt; + private InputPropertyInfo _lte; + private InputPropertyInfo _nlte; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? In + { + get => (QueryBuilderParameter?>?)_in.Value; + set => _in = new InputPropertyInfo { Name = "in", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Nin + { + get => (QueryBuilderParameter?>?)_nin.Value; + set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Gt + { + get => (QueryBuilderParameter?)_gt.Value; + set => _gt = new InputPropertyInfo { Name = "gt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ngt + { + get => (QueryBuilderParameter?)_ngt.Value; + set => _ngt = new InputPropertyInfo { Name = "ngt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Gte + { + get => (QueryBuilderParameter?)_gte.Value; + set => _gte = new InputPropertyInfo { Name = "gte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ngte + { + get => (QueryBuilderParameter?)_ngte.Value; + set => _ngte = new InputPropertyInfo { Name = "ngte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Lt + { + get => (QueryBuilderParameter?)_lt.Value; + set => _lt = new InputPropertyInfo { Name = "lt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Nlt + { + get => (QueryBuilderParameter?)_nlt.Value; + set => _nlt = new InputPropertyInfo { Name = "nlt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Lte + { + get => (QueryBuilderParameter?)_lte.Value; + set => _lte = new InputPropertyInfo { Name = "lte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Nlte + { + get => (QueryBuilderParameter?)_nlte.Value; + set => _nlte = new InputPropertyInfo { Name = "nlte", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + if (_in.Name != null) yield return _in; + if (_nin.Name != null) yield return _nin; + if (_gt.Name != null) yield return _gt; + if (_ngt.Name != null) yield return _ngt; + if (_gte.Name != null) yield return _gte; + if (_ngte.Name != null) yield return _ngte; + if (_lt.Name != null) yield return _lt; + if (_nlt.Name != null) yield return _nlt; + if (_lte.Name != null) yield return _lte; + if (_nlte.Name != null) yield return _nlte; + } + } + + public partial class BooleanOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + } + } + + public partial class DateTimeOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _eq; + private InputPropertyInfo _neq; + private InputPropertyInfo _in; + private InputPropertyInfo _nin; + private InputPropertyInfo _gt; + private InputPropertyInfo _ngt; + private InputPropertyInfo _gte; + private InputPropertyInfo _ngte; + private InputPropertyInfo _lt; + private InputPropertyInfo _nlt; + private InputPropertyInfo _lte; + private InputPropertyInfo _nlte; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Eq + { + get => (QueryBuilderParameter?)_eq.Value; + set => _eq = new InputPropertyInfo { Name = "eq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Neq + { + get => (QueryBuilderParameter?)_neq.Value; + set => _neq = new InputPropertyInfo { Name = "neq", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? In + { + get => (QueryBuilderParameter?>?)_in.Value; + set => _in = new InputPropertyInfo { Name = "in", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? Nin + { + get => (QueryBuilderParameter?>?)_nin.Value; + set => _nin = new InputPropertyInfo { Name = "nin", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Gt + { + get => (QueryBuilderParameter?)_gt.Value; + set => _gt = new InputPropertyInfo { Name = "gt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ngt + { + get => (QueryBuilderParameter?)_ngt.Value; + set => _ngt = new InputPropertyInfo { Name = "ngt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Gte + { + get => (QueryBuilderParameter?)_gte.Value; + set => _gte = new InputPropertyInfo { Name = "gte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Ngte + { + get => (QueryBuilderParameter?)_ngte.Value; + set => _ngte = new InputPropertyInfo { Name = "ngte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Lt + { + get => (QueryBuilderParameter?)_lt.Value; + set => _lt = new InputPropertyInfo { Name = "lt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Nlt + { + get => (QueryBuilderParameter?)_nlt.Value; + set => _nlt = new InputPropertyInfo { Name = "nlt", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Lte + { + get => (QueryBuilderParameter?)_lte.Value; + set => _lte = new InputPropertyInfo { Name = "lte", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Nlte + { + get => (QueryBuilderParameter?)_nlte.Value; + set => _nlte = new InputPropertyInfo { Name = "nlte", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_eq.Name != null) yield return _eq; + if (_neq.Name != null) yield return _neq; + if (_in.Name != null) yield return _in; + if (_nin.Name != null) yield return _nin; + if (_gt.Name != null) yield return _gt; + if (_ngt.Name != null) yield return _ngt; + if (_gte.Name != null) yield return _gte; + if (_ngte.Name != null) yield return _ngte; + if (_lt.Name != null) yield return _lt; + if (_nlt.Name != null) yield return _nlt; + if (_lte.Name != null) yield return _lte; + if (_nlte.Name != null) yield return _nlte; + } + } + + public partial class ListStringOperationFilterInputGql : IGraphQlInputObject + { + private InputPropertyInfo _all; + private InputPropertyInfo _none; + private InputPropertyInfo _some; + private InputPropertyInfo _any; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? All + { + get => (QueryBuilderParameter?)_all.Value; + set => _all = new InputPropertyInfo { Name = "all", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? None + { + get => (QueryBuilderParameter?)_none.Value; + set => _none = new InputPropertyInfo { Name = "none", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Some + { + get => (QueryBuilderParameter?)_some.Value; + set => _some = new InputPropertyInfo { Name = "some", Value = value }; + } + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter))] + #endif + public QueryBuilderParameter? Any + { + get => (QueryBuilderParameter?)_any.Value; + set => _any = new InputPropertyInfo { Name = "any", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_all.Name != null) yield return _all; + if (_none.Name != null) yield return _none; + if (_some.Name != null) yield return _some; + if (_any.Name != null) yield return _any; + } + } + + public partial class PushUserInputGql : IGraphQlInputObject + { + private InputPropertyInfo _userPushRow; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? UserPushRow + { + get => (QueryBuilderParameter?>?)_userPushRow.Value; + set => _userPushRow = new InputPropertyInfo { Name = "userPushRow", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_userPushRow.Name != null) yield return _userPushRow; + } + } + + public partial class PushWorkspaceInputGql : IGraphQlInputObject + { + private InputPropertyInfo _workspacePushRow; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? WorkspacePushRow + { + get => (QueryBuilderParameter?>?)_workspacePushRow.Value; + set => _workspacePushRow = new InputPropertyInfo { Name = "workspacePushRow", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_workspacePushRow.Name != null) yield return _workspacePushRow; + } + } + + public partial class PushLiveDocInputGql : IGraphQlInputObject + { + private InputPropertyInfo _liveDocPushRow; + + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(QueryBuilderParameterConverter?>))] + #endif + public QueryBuilderParameter?>? LiveDocPushRow + { + get => (QueryBuilderParameter?>?)_liveDocPushRow.Value; + set => _liveDocPushRow = new InputPropertyInfo { Name = "liveDocPushRow", Value = value }; + } + + IEnumerable IGraphQlInputObject.GetPropertyValues() + { + if (_liveDocPushRow.Name != null) yield return _liveDocPushRow; + } + } + #endregion + + #region data classes + public partial class UserPullBulkGql + { + public ICollection? Documents { get; set; } + public CheckpointGql? Checkpoint { get; set; } + } + + public partial class WorkspacePullBulkGql + { + public ICollection? Documents { get; set; } + public CheckpointGql? Checkpoint { get; set; } + } + + public partial class LiveDocPullBulkGql + { + public ICollection? Documents { get; set; } + public CheckpointGql? Checkpoint { get; set; } + } + + public partial class QueryGql + { + public UserPullBulkGql? PullUser { get; set; } + public WorkspacePullBulkGql? PullWorkspace { get; set; } + public LiveDocPullBulkGql? PullLiveDoc { get; set; } + } + + public partial class MutationGql + { + public PushUserPayloadGql? PushUser { get; set; } + public PushWorkspacePayloadGql? PushWorkspace { get; set; } + public PushLiveDocPayloadGql? PushLiveDoc { get; set; } + } + + public partial class SubscriptionGql + { + public UserPullBulkGql? StreamUser { get; set; } + public WorkspacePullBulkGql? StreamWorkspace { get; set; } + public LiveDocPullBulkGql? StreamLiveDoc { get; set; } + } + + public partial class UserGql + { + public string FirstName { get; set; } + public string LastName { get; set; } + public string? FullName { get; set; } + public string? Email { get; set; } + public LiveDocs.GraphQLApi.Security.UserRole Role { get; set; } + public string? JwtAccessToken { get; set; } + public Guid WorkspaceId { get; set; } + public Guid Id { get; set; } + public bool IsDeleted { get; set; } + public DateTimeOffset UpdatedAt { get; set; } + public ICollection? Topics { get; set; } + } + + public partial class CheckpointGql + { + public Guid? LastDocumentId { get; set; } + public DateTimeOffset? UpdatedAt { get; set; } + } + + [GraphQlObjectType("AuthenticationError")] + public partial class AuthenticationErrorGql : IPushUserErrorGql, IPushWorkspaceErrorGql, IPushLiveDocErrorGql, IErrorGql + { + public string Message { get; set; } + } + + [GraphQlObjectType("UnauthorizedAccessError")] + public partial class UnauthorizedAccessErrorGql : IPushUserErrorGql, IPushWorkspaceErrorGql, IPushLiveDocErrorGql, IErrorGql + { + public string Message { get; set; } + } + + public partial class WorkspaceGql + { + public string Name { get; set; } + public Guid Id { get; set; } + public bool IsDeleted { get; set; } + public DateTimeOffset UpdatedAt { get; set; } + public ICollection? Topics { get; set; } + } + + public partial class LiveDocGql + { + public string Content { get; set; } + public Guid OwnerId { get; set; } + public Guid WorkspaceId { get; set; } + public Guid Id { get; set; } + public bool IsDeleted { get; set; } + public DateTimeOffset UpdatedAt { get; set; } + public ICollection? Topics { get; set; } + } + + public partial interface IErrorGql + { + string Message { get; set; } + } + + public partial interface IPushUserErrorGql + { + } + + public partial class PushUserPayloadGql + { + public ICollection? User { get; set; } + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] + #endif + public ICollection? Errors { get; set; } + } + + public partial interface IPushWorkspaceErrorGql + { + } + + public partial class PushWorkspacePayloadGql + { + public ICollection? Workspace { get; set; } + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] + #endif + public ICollection? Errors { get; set; } + } + + public partial interface IPushLiveDocErrorGql + { + } + + public partial class PushLiveDocPayloadGql + { + public ICollection? LiveDoc { get; set; } + #if !GRAPHQL_GENERATOR_DISABLE_NEWTONSOFT_JSON + [JsonConverter(typeof(GraphQlInterfaceJsonConverter))] + #endif + public ICollection? Errors { get; set; } + } + #endregion + #nullable restore +}