From 9d8bccf21939af41a684674dcf55ba2ff74e5142 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 18 Jan 2024 23:06:27 +0530 Subject: [PATCH 01/28] adds feature flag for nested mutations --- src/Cli/Commands/InitOptions.cs | 5 ++ src/Cli/ConfigGenerator.cs | 42 ++++++++- .../GraphQLRuntimeOptionsConverterFactory.cs | 86 ++++++++++++++++++- .../NestedInsertOptionsConverter.cs | 57 ++++++++++++ .../NestedMutationOptionsConverter.cs | 71 +++++++++++++++ .../ObjectModel/GraphQLRuntimeOptions.cs | 2 +- src/Config/ObjectModel/NestedInsertOptions.cs | 18 ++++ .../ObjectModel/NestedMutationOptions.cs | 30 +++++++ src/Config/RuntimeConfigLoader.cs | 3 +- 9 files changed, 307 insertions(+), 7 deletions(-) create mode 100644 src/Config/Converters/NestedInsertOptionsConverter.cs create mode 100644 src/Config/Converters/NestedMutationOptionsConverter.cs create mode 100644 src/Config/ObjectModel/NestedInsertOptions.cs create mode 100644 src/Config/ObjectModel/NestedMutationOptions.cs diff --git a/src/Cli/Commands/InitOptions.cs b/src/Cli/Commands/InitOptions.cs index 1d7ec4bf59..c01720e868 100644 --- a/src/Cli/Commands/InitOptions.cs +++ b/src/Cli/Commands/InitOptions.cs @@ -37,6 +37,7 @@ public InitOptions( CliBool restEnabled = CliBool.None, CliBool graphqlEnabled = CliBool.None, CliBool restRequestBodyStrict = CliBool.None, + CliBool nestedInsertOperationEnabled = CliBool.None, string? config = null) : base(config) { @@ -59,6 +60,7 @@ public InitOptions( RestEnabled = restEnabled; GraphQLEnabled = graphqlEnabled; RestRequestBodyStrict = restRequestBodyStrict; + NestedInsertOperationEnabled = nestedInsertOperationEnabled; } [Option("database-type", Required = true, HelpText = "Type of database to connect. Supported values: mssql, cosmosdb_nosql, cosmosdb_postgresql, mysql, postgresql, dwsql")] @@ -120,6 +122,9 @@ public InitOptions( [Option("rest.request-body-strict", Required = false, HelpText = "(Default: true) Allow extraneous fields in the request body for REST.")] public CliBool RestRequestBodyStrict { get; } + [Option("graphql.nested-insert.enabled", Required = false, HelpText = "Enables Nested Insert operation for GraphQL. Supported values: true, false.")] + public CliBool NestedInsertOperationEnabled { get; } + public void Handler(ILogger logger, FileSystemRuntimeConfigLoader loader, IFileSystem fileSystem) { logger.LogInformation("{productName} {version}", PRODUCT_NAME, ProductInfo.GetProductVersion()); diff --git a/src/Cli/ConfigGenerator.cs b/src/Cli/ConfigGenerator.cs index 7ead54b2ff..d2bb01d0f6 100644 --- a/src/Cli/ConfigGenerator.cs +++ b/src/Cli/ConfigGenerator.cs @@ -114,6 +114,27 @@ public static bool TryCreateRuntimeConfig(InitOptions options, FileSystemRuntime return false; } + + + bool isNestedInsertEnabledForGraphQL; + + if(dbType is not DatabaseType.MSSQL && options.NestedInsertOperationEnabled is not CliBool.None) + { + _logger.LogWarning($"The option --graphql.nested-insert.enabled is not supported for {dbType.ToString()} database type and will not be honored."); + } + + if(dbType is not DatabaseType.MSSQL) + { + isNestedInsertEnabledForGraphQL = false; + } + else + { + if (!IsNestedInsertOperationEnabled(options.NestedInsertOperationEnabled, out isNestedInsertEnabledForGraphQL)) + { + return false; + } + } + switch (dbType) { case DatabaseType.CosmosDB_NoSQL: @@ -233,7 +254,7 @@ public static bool TryCreateRuntimeConfig(InitOptions options, FileSystemRuntime DataSource: dataSource, Runtime: new( Rest: new(restEnabled, restPath ?? RestRuntimeOptions.DEFAULT_PATH, options.RestRequestBodyStrict is CliBool.False ? false : true), - GraphQL: new(graphQLEnabled, graphQLPath), + GraphQL: new(Enabled: graphQLEnabled, Path: graphQLPath, NestedMutationOptions: new(new NestedInsertOptions(enabled: isNestedInsertEnabledForGraphQL))), Host: new( Cors: new(options.CorsOrigin?.ToArray() ?? Array.Empty()), Authentication: new( @@ -286,6 +307,25 @@ private static bool TryDetermineIfApiIsEnabled(bool apiDisabledOptionValue, CliB return true; } + private static bool IsNestedInsertOperationEnabled(CliBool nestedInsertsEnabledOptionValue, out bool isNestedInsertEnabledForGraphQL) + { + if(nestedInsertsEnabledOptionValue is CliBool.None) + { + isNestedInsertEnabledForGraphQL = false; + return true; + } + + if(bool.TryParse(nestedInsertsEnabledOptionValue.ToString(), out isNestedInsertEnabledForGraphQL)) + { + return true; + } + else + { + _logger.LogError("Invalid value used with the option --graphql.nested-insert.enabled. Supported values are true/false."); + return false; + } + } + /// /// This method will add a new Entity with the given REST and GraphQL endpoints, source, and permissions. /// It also supports fields that needs to be included or excluded for a given role and operation. diff --git a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs index 7bca48106a..9f50102ac1 100644 --- a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs +++ b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs @@ -35,11 +35,79 @@ private class GraphQLRuntimeOptionsConverter : JsonConverter c is GraphQLRuntimeOptionsConverterFactory)); + if(reader.TokenType == JsonTokenType.StartObject) + { + GraphQLRuntimeOptions graphQLRuntimeOptions = new(); + NestedMutationOptionsConverter nestedMutationOptionsConverter = options.GetConverter(typeof(NestedMutationOptions)) as NestedMutationOptionsConverter ?? + throw new JsonException("Failed to get nested mutation options converter"); + + while(reader.Read()) + { + + + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + string? propertyName = reader.GetString(); + reader.Read(); + switch (propertyName) + { + case "enabled": + if (reader.TokenType is JsonTokenType.True || reader.TokenType is JsonTokenType.False) + { + graphQLRuntimeOptions = graphQLRuntimeOptions with { Enabled = reader.GetBoolean() }; + } + else + { + throw new JsonException($"Unexpected type of value entered for enabled: {reader.TokenType}"); + } + + break; + + case "allow-introspection": + if (reader.TokenType is JsonTokenType.True || reader.TokenType is JsonTokenType.False) + { + graphQLRuntimeOptions = graphQLRuntimeOptions with { AllowIntrospection = reader.GetBoolean() }; + } + else + { + throw new JsonException($"Unexpected type of value entered for allow-introspection: {reader.TokenType}"); + } + + break; + case "path": + if (reader.TokenType is JsonTokenType.String) + { + string? path = reader.GetString(); + if (path is null) + { + path = "/graphql"; + } + + graphQLRuntimeOptions = graphQLRuntimeOptions with { Path = path }; + } + else + { + throw new JsonException($"Unexpected type of value entered for path: {reader.TokenType}"); + } + + break; - return JsonSerializer.Deserialize(ref reader, innerOptions); + case "nested-mutations": + graphQLRuntimeOptions = graphQLRuntimeOptions with { NestedMutationOptions = nestedMutationOptionsConverter.Read(ref reader, typeToConvert, options) }; + break; + + default: + throw new JsonException($"Unexpected property {propertyName}"); + } + } + + return graphQLRuntimeOptions; + } + + throw new JsonException("Failed to read the GraphQL Runtime Options"); } public override void Write(Utf8JsonWriter writer, GraphQLRuntimeOptions value, JsonSerializerOptions options) @@ -48,6 +116,16 @@ public override void Write(Utf8JsonWriter writer, GraphQLRuntimeOptions value, J writer.WriteBoolean("enabled", value.Enabled); writer.WriteString("path", value.Path); writer.WriteBoolean("allow-introspection", value.AllowIntrospection); + + if(value.NestedMutationOptions is not null) + { + + NestedMutationOptionsConverter nestedMutationOptionsConverter = options.GetConverter(typeof(NestedMutationOptions)) as NestedMutationOptionsConverter ?? + throw new JsonException("Failed to get nested mutation options converter"); + + nestedMutationOptionsConverter.Write(writer, value.NestedMutationOptions, options); + } + writer.WriteEndObject(); } } diff --git a/src/Config/Converters/NestedInsertOptionsConverter.cs b/src/Config/Converters/NestedInsertOptionsConverter.cs new file mode 100644 index 0000000000..9c12a1c2ea --- /dev/null +++ b/src/Config/Converters/NestedInsertOptionsConverter.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.DataApiBuilder.Config.ObjectModel; + +namespace Azure.DataApiBuilder.Config.Converters +{ + internal class NestedInsertOptionsConverter : JsonConverter + { + public override NestedInsertOptions? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if(reader.TokenType is JsonTokenType.StartObject) + { + NestedInsertOptions? nestedInsertOptions = new(enabled: false); + while(reader.Read()) + { + if(reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + string? propertyName = reader.GetString(); + switch (propertyName) + { + case "enabled": + reader.Read(); + if (reader.TokenType is JsonTokenType.True || reader.TokenType is JsonTokenType.False) + { + nestedInsertOptions = new(reader.GetBoolean()); + } + + break; + default: + throw new JsonException($"Unexpected property {propertyName}"); + + } + } + + return nestedInsertOptions; + } + + throw new JsonException(); + } + + public override void Write(Utf8JsonWriter writer, NestedInsertOptions value, JsonSerializerOptions options) + { + writer.WritePropertyName("inserts"); + + writer.WriteStartObject(); + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(value.Enabled); + writer.WriteEndObject(); + } + } +} diff --git a/src/Config/Converters/NestedMutationOptionsConverter.cs b/src/Config/Converters/NestedMutationOptionsConverter.cs new file mode 100644 index 0000000000..0d4b2e800c --- /dev/null +++ b/src/Config/Converters/NestedMutationOptionsConverter.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System.Text.Json; +using System.Text.Json.Serialization; +using Azure.DataApiBuilder.Config.ObjectModel; + +namespace Azure.DataApiBuilder.Config.Converters +{ + internal class NestedMutationOptionsConverter : JsonConverter + { + + private readonly NestedInsertOptionsConverter _nestedInsertOptionsConverter; + + public NestedMutationOptionsConverter(JsonSerializerOptions options) + { + _nestedInsertOptionsConverter = options.GetConverter(typeof(NestedInsertOptions)) as NestedInsertOptionsConverter ?? + throw new JsonException("Failed to get nested insert options converter"); + } + + public override NestedMutationOptions? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) + { + return new NestedMutationOptions(new(enabled: false)); + } + + if(reader.TokenType is JsonTokenType.StartObject) + { + NestedMutationOptions? nestedMutationOptions = new(new(enabled: false)); + + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + string? propertyName = reader.GetString(); + switch (propertyName) + { + case "inserts": + reader.Read(); + nestedMutationOptions = new(_nestedInsertOptionsConverter.Read(ref reader, typeToConvert, options)); + break; + + default: + throw new JsonException($"Unexpected property {propertyName}"); + } + } + + return nestedMutationOptions; + } + + throw new JsonException(); + } + public override void Write(Utf8JsonWriter writer, NestedMutationOptions value, JsonSerializerOptions options) + { + writer.WritePropertyName("nested-mutations"); + + writer.WriteStartObject(); + + if(value.NestedInsertOptions is not null) + { + _nestedInsertOptionsConverter.Write(writer, value.NestedInsertOptions, options); + } + + writer.WriteEndObject(); + } + } +} diff --git a/src/Config/ObjectModel/GraphQLRuntimeOptions.cs b/src/Config/ObjectModel/GraphQLRuntimeOptions.cs index 9969835cb2..a6a4fed1b6 100644 --- a/src/Config/ObjectModel/GraphQLRuntimeOptions.cs +++ b/src/Config/ObjectModel/GraphQLRuntimeOptions.cs @@ -3,7 +3,7 @@ namespace Azure.DataApiBuilder.Config.ObjectModel; -public record GraphQLRuntimeOptions(bool Enabled = true, string Path = GraphQLRuntimeOptions.DEFAULT_PATH, bool AllowIntrospection = true) +public record GraphQLRuntimeOptions(bool Enabled = true, string Path = GraphQLRuntimeOptions.DEFAULT_PATH, bool AllowIntrospection = true, NestedMutationOptions? NestedMutationOptions = null) { public const string DEFAULT_PATH = "/graphql"; } diff --git a/src/Config/ObjectModel/NestedInsertOptions.cs b/src/Config/ObjectModel/NestedInsertOptions.cs new file mode 100644 index 0000000000..c86afcc784 --- /dev/null +++ b/src/Config/ObjectModel/NestedInsertOptions.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +namespace Azure.DataApiBuilder.Config.ObjectModel; + +/// +/// +/// +/// +public class NestedInsertOptions +{ + public bool Enabled; + + public NestedInsertOptions(bool enabled) + { + Enabled = enabled; + } +}; + diff --git a/src/Config/ObjectModel/NestedMutationOptions.cs b/src/Config/ObjectModel/NestedMutationOptions.cs new file mode 100644 index 0000000000..56f8f1c391 --- /dev/null +++ b/src/Config/ObjectModel/NestedMutationOptions.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +using System.Text.Json.Serialization; + +namespace Azure.DataApiBuilder.Config.ObjectModel; + +/// +/// +/// +/// +public class NestedMutationOptions +{ + [JsonPropertyName("insert")] + public NestedInsertOptions? NestedInsertOptions; + + public NestedMutationOptions(NestedInsertOptions? nestedInsertOptions) + { + NestedInsertOptions = nestedInsertOptions; + } + + /// + /// + /// + /// + public bool IsNestedInsertOperationEnabled() + { + return NestedInsertOptions is not null && NestedInsertOptions.Enabled; + } + +} diff --git a/src/Config/RuntimeConfigLoader.cs b/src/Config/RuntimeConfigLoader.cs index 71994b530b..aaf50d8f9d 100644 --- a/src/Config/RuntimeConfigLoader.cs +++ b/src/Config/RuntimeConfigLoader.cs @@ -170,7 +170,8 @@ public static JsonSerializerOptions GetSerializationOptions( options.Converters.Add(new EntityRestOptionsConverterFactory(replaceEnvVar)); options.Converters.Add(new EntityActionConverterFactory()); options.Converters.Add(new DataSourceFilesConverter()); - options.Converters.Add(new EntityCacheOptionsConverterFactory()); + options.Converters.Add(new NestedInsertOptionsConverter()); + options.Converters.Add(new NestedMutationOptionsConverter(options)); if (replaceEnvVar) { From 76d7a0b31d0e13d82c4daa93cb7ae89a3aa67fbd Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Sun, 21 Jan 2024 11:51:09 +0530 Subject: [PATCH 02/28] updates schema file, adds tests --- schemas/dab.draft.schema.json | 17 +++++ src/Cli.Tests/ConfigGeneratorTests.cs | 9 ++- src/Cli.Tests/EndToEndTests.cs | 38 +++++++++++ src/Cli.Tests/InitTests.cs | 67 +++++++++++++++++++ ...stMethodsAndGraphQLOperations.verified.txt | 7 +- ...tyWithSourceAsStoredProcedure.verified.txt | 7 +- ...tityWithSourceWithDefaultType.verified.txt | 7 +- ...dingEntityWithoutIEnumerables.verified.txt | 7 +- ...ests.TestInitForCosmosDBNoSql.verified.txt | 7 +- ...toredProcedureWithRestMethods.verified.txt | 7 +- ...stMethodsAndGraphQLOperations.verified.txt | 7 +- ...itTests.CosmosDbNoSqlDatabase.verified.txt | 7 +- ...ts.CosmosDbPostgreSqlDatabase.verified.txt | 7 +- ...ionProviders_171ea8114ff71814.verified.txt | 7 +- ...ionProviders_2df7a1794712f154.verified.txt | 7 +- ...ionProviders_59fe1a10aa78899d.verified.txt | 7 +- ...ionProviders_b95b637ea87f16a7.verified.txt | 7 +- ...tStartingSlashWillHaveItAdded.verified.txt | 7 +- .../InitTests.MsSQLDatabase.verified.txt | 7 +- ...tStartingSlashWillHaveItAdded.verified.txt | 7 +- ...ConfigWithoutConnectionString.verified.txt | 7 +- ...lCharactersInConnectionString.verified.txt | 7 +- ...ationOptions_04b5a22faa9af0c2.verified.txt | 45 +++++++++++++ ...ationOptions_0da408c47700b645.verified.txt | 45 +++++++++++++ ...ationOptions_100a98e42d6c45f0.verified.txt | 40 +++++++++++ ...ationOptions_21d4a6937b2bc36a.verified.txt | 35 ++++++++++ ...ationOptions_22893dadb964b4af.verified.txt | 40 +++++++++++ ...ationOptions_35456ee67000cfc1.verified.txt | 45 +++++++++++++ ...ationOptions_3b403406754557bb.verified.txt | 35 ++++++++++ ...ationOptions_655da17b77dca6b2.verified.txt | 35 ++++++++++ ...ationOptions_6858c1155ee18e5e.verified.txt | 40 +++++++++++ ...ationOptions_6ba1b21c030acd10.verified.txt | 35 ++++++++++ ...ationOptions_95909ef1e107976f.verified.txt | 35 ++++++++++ ...ationOptions_b45936ff6c917e83.verified.txt | 40 +++++++++++ ...ationOptions_c0e7d8f970983332.verified.txt | 35 ++++++++++ ...ationOptions_d63742004cbc9104.verified.txt | 40 +++++++++++ ...ationOptions_ddefe887c139451b.verified.txt | 35 ++++++++++ ...ationOptions_e3caca2552d13d9e.verified.txt | 40 +++++++++++ ...ationOptions_e4c5f76237e4ebdf.verified.txt | 35 ++++++++++ ...ationOptions_ef60a809ce923334.verified.txt | 35 ++++++++++ .../Caching/CachingConfigProcessingTests.cs | 7 +- 41 files changed, 933 insertions(+), 21 deletions(-) create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_04b5a22faa9af0c2.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0da408c47700b645.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_100a98e42d6c45f0.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_21d4a6937b2bc36a.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_22893dadb964b4af.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35456ee67000cfc1.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_3b403406754557bb.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_655da17b77dca6b2.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6858c1155ee18e5e.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6ba1b21c030acd10.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_95909ef1e107976f.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b45936ff6c917e83.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0e7d8f970983332.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d63742004cbc9104.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ddefe887c139451b.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e3caca2552d13d9e.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e4c5f76237e4ebdf.verified.txt create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef60a809ce923334.verified.txt diff --git a/schemas/dab.draft.schema.json b/schemas/dab.draft.schema.json index 7f4e1164b1..fd45381038 100644 --- a/schemas/dab.draft.schema.json +++ b/schemas/dab.draft.schema.json @@ -175,6 +175,23 @@ "enabled": { "type": "boolean", "description": "Allow enabling/disabling GraphQL requests for all entities." + }, + "nested-mutations": { + "type": "object", + "description": "Feature flags for nested mutation operations", + "properties": { + "inserts":{ + "type": "object", + "description": "Options for nested insert operations", + "properties": { + "enabled": { + "type": "boolean", + "description": "Allow enabling/disabling nested insert operations for all entities.", + "default": false + } + } + } + } } } }, diff --git a/src/Cli.Tests/ConfigGeneratorTests.cs b/src/Cli.Tests/ConfigGeneratorTests.cs index 52c2019d39..b4920b5890 100644 --- a/src/Cli.Tests/ConfigGeneratorTests.cs +++ b/src/Cli.Tests/ConfigGeneratorTests.cs @@ -161,8 +161,13 @@ public void TestSpecialCharactersInConnectionString() ""graphql"": { ""enabled"": true, ""path"": ""/An_"", - ""allow-introspection"": true - }, + ""allow-introspection"": true, + ""nested-mutations"": { + ""inserts"": { + ""enabled"": false + } + } + }, ""host"": { ""cors"": { ""origins"": [], diff --git a/src/Cli.Tests/EndToEndTests.cs b/src/Cli.Tests/EndToEndTests.cs index d9381979bc..a51ff5d0dd 100644 --- a/src/Cli.Tests/EndToEndTests.cs +++ b/src/Cli.Tests/EndToEndTests.cs @@ -131,6 +131,44 @@ public void TestInitializingRestAndGraphQLGlobalSettings() Assert.IsTrue(runtimeConfig.Runtime.GraphQL?.Enabled); } + /// + /// Test to validate the successful generation of config file with the --graphql.nested-insert.enabled option of the init command. + /// + /// Value for the nested insert enabled flag in the init command. + /// Expected value for the nested insert enabled flag in the config file. + [DataTestMethod] + [DataRow(CliBool.True, true, DisplayName = "Nested Insert operation is enabled the config file by specifying '--graphql.nested-insert.enabled true'")] + [DataRow(CliBool.False , false , DisplayName = "Nested Insert operation is disabled the config file by specifying '--graphql.nested-insert.enabled false'")] + [DataRow(null, false, DisplayName = " '--graphql.nested-insert' option is not used in the init command. When not enabled explicitly, the nested insert operation will be disabled.")] + public void TestEnablingNestedInsertOperation(CliBool? isNestedInsertsEnabled, bool expectedValueForNestedInsertEnabledFlag) + { + List args = new(){ "init", "-c", TEST_RUNTIME_CONFIG_FILE, "--connection-string", SAMPLE_TEST_CONN_STRING, "--database-type", "mssql"}; + + if (isNestedInsertsEnabled is not null) + { + args.Add("--graphql.nested-insert.enabled"); + args.Add(isNestedInsertsEnabled.ToString()!); + } + + Program.Execute(args.ToArray(), _cliLogger!, _fileSystem!, _runtimeConfigLoader!); + + Assert.IsTrue(_runtimeConfigLoader!.TryLoadConfig( + TEST_RUNTIME_CONFIG_FILE, + out RuntimeConfig? runtimeConfig, + replaceEnvVar: true)); + + SqlConnectionStringBuilder builder = new(runtimeConfig.DataSource.ConnectionString); + Assert.AreEqual(ProductInfo.GetDataApiBuilderApplicationName(), builder.ApplicationName); + + Assert.IsNotNull(runtimeConfig); + Assert.AreEqual(DatabaseType.MSSQL, runtimeConfig.DataSource.DatabaseType); + Assert.IsNotNull(runtimeConfig.Runtime); + Assert.IsNotNull(runtimeConfig.Runtime.GraphQL); + Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions); + Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedInsertOptions); + Assert.AreEqual(expectedValueForNestedInsertEnabledFlag, runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedInsertOptions.Enabled); + } + /// /// Test to verify adding a new Entity. /// diff --git a/src/Cli.Tests/InitTests.cs b/src/Cli.Tests/InitTests.cs index 31cff258a7..83b3394b5f 100644 --- a/src/Cli.Tests/InitTests.cs +++ b/src/Cli.Tests/InitTests.cs @@ -409,6 +409,73 @@ public Task GraphQLPathWithoutStartingSlashWillHaveItAdded() return ExecuteVerifyTest(options); } + /// + /// Test to validate the config is correctly generated with different database types and various options for --graphql.nested-insert.enabled flag. + /// + [DataTestMethod] + [DataRow(DatabaseType.MSSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-insert.enabled true' for MsSQL database type")] + [DataRow(DatabaseType.MSSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-insert.enabled false' for MsSQL database type")] + [DataRow(DatabaseType.MSSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-insert.enabled' option for MsSQL database type")] + [DataRow(DatabaseType.PostgreSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-insert.enabled true' for PostgreSQL database type")] + [DataRow(DatabaseType.PostgreSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-insert.enabled false' for PostgreSQL database type")] + [DataRow(DatabaseType.PostgreSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-insert.enabled' option for PostgreSQL database type")] + [DataRow(DatabaseType.MySQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-insert.enabled true' for MySQL database type")] + [DataRow(DatabaseType.MySQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-insert.enabled false' for MySQL database type")] + [DataRow(DatabaseType.MySQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-insert.enabled' option for MySQL database type")] + [DataRow(DatabaseType.CosmosDB_NoSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-insert.enabled true' for CosmosDB_NoSQL database type")] + [DataRow(DatabaseType.CosmosDB_NoSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-insert.enabled false' for CosmosDB_NoSQL database type")] + [DataRow(DatabaseType.CosmosDB_NoSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-insert.enabled' option for CosmosDB_NoSQL database type")] + [DataRow(DatabaseType.CosmosDB_PostgreSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-insert.enabled true' for CosmosDB_PostgreSQL database type")] + [DataRow(DatabaseType.CosmosDB_PostgreSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-insert.enabled false' for CosmosDB_PostgreSQL database type")] + [DataRow(DatabaseType.CosmosDB_PostgreSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-insert.enabled' option for CosmosDB_PostgreSQL database type")] + [DataRow(DatabaseType.DWSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-insert.enabled true' for DWSQL database type")] + [DataRow(DatabaseType.DWSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-insert.enabled false' for DWSQL database type")] + [DataRow(DatabaseType.DWSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-insert.enabled' option for DWSQL database type")] + public Task VerifyCorrectConfigGenerationWithNestedMutationOptions(DatabaseType databaseTye, CliBool isNestedInsertEnabled) + { + InitOptions options; + + if(databaseTye is DatabaseType.CosmosDB_NoSQL) + { + // A scheme file is added since its mandatory for CosmosDB_NoSQL + ((MockFileSystem)_fileSystem!).AddFile(TEST_SCHEMA_FILE, new MockFileData("")); + + options = new( + databaseType: databaseTye, + connectionString: "testconnectionstring", + cosmosNoSqlDatabase: "testdb", + cosmosNoSqlContainer: "testcontainer", + graphQLSchemaPath: TEST_SCHEMA_FILE, + setSessionContext: true, + hostMode: HostMode.Development, + corsOrigin: new List() { "http://localhost:3000", "http://nolocalhost:80" }, + authenticationProvider: EasyAuthType.StaticWebApps.ToString(), + restPath: "rest-api", + config: TEST_RUNTIME_CONFIG_FILE, + nestedInsertOperationEnabled: isNestedInsertEnabled); + } + else + { + options = new( + databaseType: databaseTye, + connectionString: "testconnectionstring", + cosmosNoSqlDatabase: null, + cosmosNoSqlContainer: null, + graphQLSchemaPath: null, + setSessionContext: true, + hostMode: HostMode.Development, + corsOrigin: new List() { "http://localhost:3000", "http://nolocalhost:80" }, + authenticationProvider: EasyAuthType.StaticWebApps.ToString(), + restPath: "rest-api", + config: TEST_RUNTIME_CONFIG_FILE, + nestedInsertOperationEnabled: isNestedInsertEnabled); + } + + VerifySettings verifySettings = new(); + verifySettings.UseHashedParameters(databaseTye, isNestedInsertEnabled); + return ExecuteVerifyTest(options, verifySettings); + } + private Task ExecuteVerifyTest(InitOptions options, VerifySettings? settings = null) { Assert.IsTrue(TryCreateRuntimeConfig(options, _runtimeConfigLoader!, _fileSystem!, out RuntimeConfig? runtimeConfig)); diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt index afe0ce1492..eb5e8c7ab3 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt index a0b925bb98..c5bac41231 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt index abb8337b09..6b9f4fb93e 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt index 8be1c1b798..47c5fec537 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt index 5936c8d178..618466dabe 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt @@ -21,7 +21,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt index 0e47344173..26374009ac 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt index e17f584185..2878b0d220 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt b/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt index 9d3b2f032e..999a0737f7 100644 --- a/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt @@ -21,7 +21,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt b/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt index ca3b61588b..d0b5af02d1 100644 --- a/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt index ae4661a514..193b309dfc 100644 --- a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt index be42e49181..b0625e704e 100644 --- a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt index 64ff9bb7f4..d5a7a8a515 100644 --- a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt index 426212619d..a2fa13d814 100644 --- a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt b/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt index e059818092..6ff80a59b7 100644 --- a/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /abc, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt b/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt index 71f3c51816..046c829c0d 100644 --- a/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt b/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt index be05f603ed..241b6de745 100644 --- a/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt b/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt index d746cb30a4..f28102764e 100644 --- a/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt b/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt index 64ff9bb7f4..d5a7a8a515 100644 --- a/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_04b5a22faa9af0c2.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_04b5a22faa9af0c2.verified.txt new file mode 100644 index 0000000000..00cfe240a7 --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_04b5a22faa9af0c2.verified.txt @@ -0,0 +1,45 @@ +{ + DataSource: { + Options: { + container: { + ValueKind: String + }, + database: { + ValueKind: String + }, + schema: { + ValueKind: String + } + } + }, + Runtime: { + Rest: { + Enabled: false, + Path: /api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0da408c47700b645.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0da408c47700b645.verified.txt new file mode 100644 index 0000000000..00cfe240a7 --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0da408c47700b645.verified.txt @@ -0,0 +1,45 @@ +{ + DataSource: { + Options: { + container: { + ValueKind: String + }, + database: { + ValueKind: String + }, + schema: { + ValueKind: String + } + } + }, + Runtime: { + Rest: { + Enabled: false, + Path: /api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_100a98e42d6c45f0.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_100a98e42d6c45f0.verified.txt new file mode 100644 index 0000000000..ba87c874cd --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_100a98e42d6c45f0.verified.txt @@ -0,0 +1,40 @@ +{ + DataSource: { + DatabaseType: DWSQL, + Options: { + set-session-context: { + ValueKind: True + } + } + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_21d4a6937b2bc36a.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_21d4a6937b2bc36a.verified.txt new file mode 100644 index 0000000000..ee72beaf0e --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_21d4a6937b2bc36a.verified.txt @@ -0,0 +1,35 @@ +{ + DataSource: { + DatabaseType: PostgreSQL + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_22893dadb964b4af.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_22893dadb964b4af.verified.txt new file mode 100644 index 0000000000..ba87c874cd --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_22893dadb964b4af.verified.txt @@ -0,0 +1,40 @@ +{ + DataSource: { + DatabaseType: DWSQL, + Options: { + set-session-context: { + ValueKind: True + } + } + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35456ee67000cfc1.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35456ee67000cfc1.verified.txt new file mode 100644 index 0000000000..00cfe240a7 --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35456ee67000cfc1.verified.txt @@ -0,0 +1,45 @@ +{ + DataSource: { + Options: { + container: { + ValueKind: String + }, + database: { + ValueKind: String + }, + schema: { + ValueKind: String + } + } + }, + Runtime: { + Rest: { + Enabled: false, + Path: /api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_3b403406754557bb.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_3b403406754557bb.verified.txt new file mode 100644 index 0000000000..f56e099074 --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_3b403406754557bb.verified.txt @@ -0,0 +1,35 @@ +{ + DataSource: { + DatabaseType: MySQL + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_655da17b77dca6b2.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_655da17b77dca6b2.verified.txt new file mode 100644 index 0000000000..ee72beaf0e --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_655da17b77dca6b2.verified.txt @@ -0,0 +1,35 @@ +{ + DataSource: { + DatabaseType: PostgreSQL + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6858c1155ee18e5e.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6858c1155ee18e5e.verified.txt new file mode 100644 index 0000000000..527fcdb389 --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6858c1155ee18e5e.verified.txt @@ -0,0 +1,40 @@ +{ + DataSource: { + DatabaseType: MSSQL, + Options: { + set-session-context: { + ValueKind: True + } + } + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: true + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6ba1b21c030acd10.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6ba1b21c030acd10.verified.txt new file mode 100644 index 0000000000..ee72beaf0e --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6ba1b21c030acd10.verified.txt @@ -0,0 +1,35 @@ +{ + DataSource: { + DatabaseType: PostgreSQL + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_95909ef1e107976f.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_95909ef1e107976f.verified.txt new file mode 100644 index 0000000000..6eb1242793 --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_95909ef1e107976f.verified.txt @@ -0,0 +1,35 @@ +{ + DataSource: { + DatabaseType: CosmosDB_PostgreSQL + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b45936ff6c917e83.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b45936ff6c917e83.verified.txt new file mode 100644 index 0000000000..046c829c0d --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b45936ff6c917e83.verified.txt @@ -0,0 +1,40 @@ +{ + DataSource: { + DatabaseType: MSSQL, + Options: { + set-session-context: { + ValueKind: True + } + } + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0e7d8f970983332.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0e7d8f970983332.verified.txt new file mode 100644 index 0000000000..6eb1242793 --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0e7d8f970983332.verified.txt @@ -0,0 +1,35 @@ +{ + DataSource: { + DatabaseType: CosmosDB_PostgreSQL + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d63742004cbc9104.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d63742004cbc9104.verified.txt new file mode 100644 index 0000000000..ba87c874cd --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d63742004cbc9104.verified.txt @@ -0,0 +1,40 @@ +{ + DataSource: { + DatabaseType: DWSQL, + Options: { + set-session-context: { + ValueKind: True + } + } + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ddefe887c139451b.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ddefe887c139451b.verified.txt new file mode 100644 index 0000000000..f56e099074 --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ddefe887c139451b.verified.txt @@ -0,0 +1,35 @@ +{ + DataSource: { + DatabaseType: MySQL + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e3caca2552d13d9e.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e3caca2552d13d9e.verified.txt new file mode 100644 index 0000000000..046c829c0d --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e3caca2552d13d9e.verified.txt @@ -0,0 +1,40 @@ +{ + DataSource: { + DatabaseType: MSSQL, + Options: { + set-session-context: { + ValueKind: True + } + } + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e4c5f76237e4ebdf.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e4c5f76237e4ebdf.verified.txt new file mode 100644 index 0000000000..6eb1242793 --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e4c5f76237e4ebdf.verified.txt @@ -0,0 +1,35 @@ +{ + DataSource: { + DatabaseType: CosmosDB_PostgreSQL + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef60a809ce923334.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef60a809ce923334.verified.txt new file mode 100644 index 0000000000..f56e099074 --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef60a809ce923334.verified.txt @@ -0,0 +1,35 @@ +{ + DataSource: { + DatabaseType: MySQL + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Service.Tests/Caching/CachingConfigProcessingTests.cs b/src/Service.Tests/Caching/CachingConfigProcessingTests.cs index 98f7c2d75f..232dd50acb 100644 --- a/src/Service.Tests/Caching/CachingConfigProcessingTests.cs +++ b/src/Service.Tests/Caching/CachingConfigProcessingTests.cs @@ -416,7 +416,12 @@ private static string GetRawConfigJson(string globalCacheConfig, string entityCa ""graphql"": { ""enabled"": true, ""path"": ""/An_"", - ""allow-introspection"": true + ""allow-introspection"": true, + ""nested-mutations"": { + ""inserts"": { + ""enabled"": false + } + } }, ""host"": { ""cors"": { From 5a09b89628fe53c50d239fd669521cb11615c07b Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Sun, 21 Jan 2024 12:18:29 +0530 Subject: [PATCH 03/28] updates ref config files, adds method and class descriptions --- src/Cli.Tests/EndToEndTests.cs | 4 ++-- src/Cli.Tests/InitTests.cs | 2 +- src/Cli/ConfigGenerator.cs | 19 ++++++++++----- .../GraphQLRuntimeOptionsConverterFactory.cs | 13 +++++------ .../NestedInsertOptionsConverter.cs | 23 +++++++++++-------- .../NestedMutationOptionsConverter.cs | 12 +++++++--- src/Config/ObjectModel/NestedInsertOptions.cs | 4 ++-- .../ObjectModel/NestedMutationOptions.cs | 7 +++--- .../Multidab-config.CosmosDb_NoSql.json | 7 +++++- src/Service.Tests/Multidab-config.MsSql.json | 7 +++++- src/Service.Tests/Multidab-config.MySql.json | 7 +++++- .../Multidab-config.PostgreSql.json | 7 +++++- ...ReadingRuntimeConfigForCosmos.verified.txt | 7 +++++- ...tReadingRuntimeConfigForMsSql.verified.txt | 7 +++++- ...tReadingRuntimeConfigForMySql.verified.txt | 7 +++++- ...ingRuntimeConfigForPostgreSql.verified.txt | 7 +++++- .../dab-config.CosmosDb_NoSql.json | 7 +++++- src/Service.Tests/dab-config.DwSql.json | 7 +++++- src/Service.Tests/dab-config.MsSql.json | 7 +++++- src/Service.Tests/dab-config.MySql.json | 7 +++++- src/Service.Tests/dab-config.PostgreSql.json | 7 +++++- 21 files changed, 129 insertions(+), 46 deletions(-) diff --git a/src/Cli.Tests/EndToEndTests.cs b/src/Cli.Tests/EndToEndTests.cs index a51ff5d0dd..7c176fe4a9 100644 --- a/src/Cli.Tests/EndToEndTests.cs +++ b/src/Cli.Tests/EndToEndTests.cs @@ -138,11 +138,11 @@ public void TestInitializingRestAndGraphQLGlobalSettings() /// Expected value for the nested insert enabled flag in the config file. [DataTestMethod] [DataRow(CliBool.True, true, DisplayName = "Nested Insert operation is enabled the config file by specifying '--graphql.nested-insert.enabled true'")] - [DataRow(CliBool.False , false , DisplayName = "Nested Insert operation is disabled the config file by specifying '--graphql.nested-insert.enabled false'")] + [DataRow(CliBool.False, false, DisplayName = "Nested Insert operation is disabled the config file by specifying '--graphql.nested-insert.enabled false'")] [DataRow(null, false, DisplayName = " '--graphql.nested-insert' option is not used in the init command. When not enabled explicitly, the nested insert operation will be disabled.")] public void TestEnablingNestedInsertOperation(CliBool? isNestedInsertsEnabled, bool expectedValueForNestedInsertEnabledFlag) { - List args = new(){ "init", "-c", TEST_RUNTIME_CONFIG_FILE, "--connection-string", SAMPLE_TEST_CONN_STRING, "--database-type", "mssql"}; + List args = new() { "init", "-c", TEST_RUNTIME_CONFIG_FILE, "--connection-string", SAMPLE_TEST_CONN_STRING, "--database-type", "mssql" }; if (isNestedInsertsEnabled is not null) { diff --git a/src/Cli.Tests/InitTests.cs b/src/Cli.Tests/InitTests.cs index 83b3394b5f..b9c5a26f22 100644 --- a/src/Cli.Tests/InitTests.cs +++ b/src/Cli.Tests/InitTests.cs @@ -435,7 +435,7 @@ public Task VerifyCorrectConfigGenerationWithNestedMutationOptions(DatabaseType { InitOptions options; - if(databaseTye is DatabaseType.CosmosDB_NoSQL) + if (databaseTye is DatabaseType.CosmosDB_NoSQL) { // A scheme file is added since its mandatory for CosmosDB_NoSQL ((MockFileSystem)_fileSystem!).AddFile(TEST_SCHEMA_FILE, new MockFileData("")); diff --git a/src/Cli/ConfigGenerator.cs b/src/Cli/ConfigGenerator.cs index d2bb01d0f6..7ec2e2c562 100644 --- a/src/Cli/ConfigGenerator.cs +++ b/src/Cli/ConfigGenerator.cs @@ -114,17 +114,19 @@ public static bool TryCreateRuntimeConfig(InitOptions options, FileSystemRuntime return false; } - - bool isNestedInsertEnabledForGraphQL; - if(dbType is not DatabaseType.MSSQL && options.NestedInsertOperationEnabled is not CliBool.None) + // Nested mutation operations are applicable only for MSSQL database. When the option --graphql.nested-insert.enabled is specified for other database types, + // a warning is logged. + if (dbType is not DatabaseType.MSSQL && options.NestedInsertOperationEnabled is not CliBool.None) { _logger.LogWarning($"The option --graphql.nested-insert.enabled is not supported for {dbType.ToString()} database type and will not be honored."); } - if(dbType is not DatabaseType.MSSQL) + if (dbType is not DatabaseType.MSSQL) { + // Nested mutation operations are applicable only for MSSQL database. When the option --graphql.nested-insert.enabled is specified for other database types, + // it is not honored. isNestedInsertEnabledForGraphQL = false; } else @@ -307,15 +309,20 @@ private static bool TryDetermineIfApiIsEnabled(bool apiDisabledOptionValue, CliB return true; } + /// + /// Helper method to determine if the nested insert operation is enabled or not based on the inputs from dab init command. + /// + /// Input value for --graphql.nested-insert.enabled option of the init command + /// Boolean value indicating if nested insert operation is enabled. private static bool IsNestedInsertOperationEnabled(CliBool nestedInsertsEnabledOptionValue, out bool isNestedInsertEnabledForGraphQL) { - if(nestedInsertsEnabledOptionValue is CliBool.None) + if (nestedInsertsEnabledOptionValue is CliBool.None) { isNestedInsertEnabledForGraphQL = false; return true; } - if(bool.TryParse(nestedInsertsEnabledOptionValue.ToString(), out isNestedInsertEnabledForGraphQL)) + if (bool.TryParse(nestedInsertsEnabledOptionValue.ToString(), out isNestedInsertEnabledForGraphQL)) { return true; } diff --git a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs index 9f50102ac1..dbadf27539 100644 --- a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs +++ b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs @@ -35,15 +35,14 @@ private class GraphQLRuntimeOptionsConverter : JsonConverter + /// Converter for the nested insert operation options. + /// internal class NestedInsertOptionsConverter : JsonConverter { + /// public override NestedInsertOptions? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - if(reader.TokenType is JsonTokenType.StartObject) + if (reader.TokenType is JsonTokenType.StartObject) { NestedInsertOptions? nestedInsertOptions = new(enabled: false); - while(reader.Read()) + while (reader.Read()) { - if(reader.TokenType == JsonTokenType.EndObject) + if (reader.TokenType == JsonTokenType.EndObject) { break; } @@ -25,13 +29,13 @@ internal class NestedInsertOptionsConverter : JsonConverter switch (propertyName) { case "enabled": - reader.Read(); - if (reader.TokenType is JsonTokenType.True || reader.TokenType is JsonTokenType.False) - { - nestedInsertOptions = new(reader.GetBoolean()); - } + reader.Read(); + if (reader.TokenType is JsonTokenType.True || reader.TokenType is JsonTokenType.False) + { + nestedInsertOptions = new(reader.GetBoolean()); + } - break; + break; default: throw new JsonException($"Unexpected property {propertyName}"); @@ -44,6 +48,7 @@ internal class NestedInsertOptionsConverter : JsonConverter throw new JsonException(); } + /// public override void Write(Utf8JsonWriter writer, NestedInsertOptions value, JsonSerializerOptions options) { writer.WritePropertyName("inserts"); diff --git a/src/Config/Converters/NestedMutationOptionsConverter.cs b/src/Config/Converters/NestedMutationOptionsConverter.cs index 0d4b2e800c..31e45beef1 100644 --- a/src/Config/Converters/NestedMutationOptionsConverter.cs +++ b/src/Config/Converters/NestedMutationOptionsConverter.cs @@ -7,6 +7,9 @@ namespace Azure.DataApiBuilder.Config.Converters { + /// + /// Converter for the nested mutation options. + /// internal class NestedMutationOptionsConverter : JsonConverter { @@ -18,6 +21,7 @@ public NestedMutationOptionsConverter(JsonSerializerOptions options) throw new JsonException("Failed to get nested insert options converter"); } + /// public override NestedMutationOptions? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { if (reader.TokenType == JsonTokenType.Null) @@ -25,7 +29,7 @@ public NestedMutationOptionsConverter(JsonSerializerOptions options) return new NestedMutationOptions(new(enabled: false)); } - if(reader.TokenType is JsonTokenType.StartObject) + if (reader.TokenType is JsonTokenType.StartObject) { NestedMutationOptions? nestedMutationOptions = new(new(enabled: false)); @@ -51,16 +55,18 @@ public NestedMutationOptionsConverter(JsonSerializerOptions options) return nestedMutationOptions; } - + throw new JsonException(); } + + /// public override void Write(Utf8JsonWriter writer, NestedMutationOptions value, JsonSerializerOptions options) { writer.WritePropertyName("nested-mutations"); writer.WriteStartObject(); - if(value.NestedInsertOptions is not null) + if (value.NestedInsertOptions is not null) { _nestedInsertOptionsConverter.Write(writer, value.NestedInsertOptions, options); } diff --git a/src/Config/ObjectModel/NestedInsertOptions.cs b/src/Config/ObjectModel/NestedInsertOptions.cs index c86afcc784..be9ca9529e 100644 --- a/src/Config/ObjectModel/NestedInsertOptions.cs +++ b/src/Config/ObjectModel/NestedInsertOptions.cs @@ -3,9 +3,9 @@ namespace Azure.DataApiBuilder.Config.ObjectModel; /// -/// +/// Options for nested insert operations. /// -/// +/// Indicates whether nested insert operation is enabled. public class NestedInsertOptions { public bool Enabled; diff --git a/src/Config/ObjectModel/NestedMutationOptions.cs b/src/Config/ObjectModel/NestedMutationOptions.cs index 56f8f1c391..8a940e789f 100644 --- a/src/Config/ObjectModel/NestedMutationOptions.cs +++ b/src/Config/ObjectModel/NestedMutationOptions.cs @@ -5,11 +5,12 @@ namespace Azure.DataApiBuilder.Config.ObjectModel; /// -/// +/// Class that holds the options for all nested mutation operations. /// /// public class NestedMutationOptions { + // Options for nested insert operation. [JsonPropertyName("insert")] public NestedInsertOptions? NestedInsertOptions; @@ -19,9 +20,9 @@ public NestedMutationOptions(NestedInsertOptions? nestedInsertOptions) } /// - /// + /// Helper function that checks if nested insert operation is enabled. /// - /// + /// True/False depending on whether nested insert operation is enabled/disabled. public bool IsNestedInsertOperationEnabled() { return NestedInsertOptions is not null && NestedInsertOptions.Enabled; diff --git a/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json b/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json index f9190ca2c9..fb633e0f85 100644 --- a/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json +++ b/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json @@ -17,7 +17,12 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true + "allow-introspection": true, + "nested-mutations": { + "inserts": { + "enabled": false + } + } }, "host": { "cors": { diff --git a/src/Service.Tests/Multidab-config.MsSql.json b/src/Service.Tests/Multidab-config.MsSql.json index 00aaac2ed2..f1ac6227d0 100644 --- a/src/Service.Tests/Multidab-config.MsSql.json +++ b/src/Service.Tests/Multidab-config.MsSql.json @@ -15,7 +15,12 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true + "allow-introspection": true, + "nested-mutations": { + "inserts": { + "enabled": false + } + } }, "host": { "cors": { diff --git a/src/Service.Tests/Multidab-config.MySql.json b/src/Service.Tests/Multidab-config.MySql.json index efd7e7c973..66974c677c 100644 --- a/src/Service.Tests/Multidab-config.MySql.json +++ b/src/Service.Tests/Multidab-config.MySql.json @@ -12,7 +12,12 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true + "allow-introspection": true, + "nested-mutations": { + "inserts": { + "enabled": false + } + } }, "host": { "cors": { diff --git a/src/Service.Tests/Multidab-config.PostgreSql.json b/src/Service.Tests/Multidab-config.PostgreSql.json index 106e6d5ac2..83b018659c 100644 --- a/src/Service.Tests/Multidab-config.PostgreSql.json +++ b/src/Service.Tests/Multidab-config.PostgreSql.json @@ -12,7 +12,12 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true + "allow-introspection": true, + "nested-mutations": { + "inserts": { + "enabled": false + } + } }, "host": { "cors": { diff --git a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt index 8b3feb4dc8..37224aee4c 100644 --- a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt +++ b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt @@ -21,7 +21,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt index e03f6f6151..ff50884f92 100644 --- a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt +++ b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt @@ -16,7 +16,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt index 4becd3b370..37fbeac242 100644 --- a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt +++ b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt index 25038524fb..485fe3b131 100644 --- a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt +++ b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedInsertOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Service.Tests/dab-config.CosmosDb_NoSql.json b/src/Service.Tests/dab-config.CosmosDb_NoSql.json index ae25b21164..dda5325998 100644 --- a/src/Service.Tests/dab-config.CosmosDb_NoSql.json +++ b/src/Service.Tests/dab-config.CosmosDb_NoSql.json @@ -18,7 +18,12 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true + "allow-introspection": true, + "nested-mutations": { + "inserts": { + "enabled": false + } + } }, "host": { "cors": { diff --git a/src/Service.Tests/dab-config.DwSql.json b/src/Service.Tests/dab-config.DwSql.json index a82cf82c09..7edccbebcb 100644 --- a/src/Service.Tests/dab-config.DwSql.json +++ b/src/Service.Tests/dab-config.DwSql.json @@ -16,7 +16,12 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true + "allow-introspection": true, + "nested-mutations": { + "inserts": { + "enabled": false + } + } }, "host": { "cors": { diff --git a/src/Service.Tests/dab-config.MsSql.json b/src/Service.Tests/dab-config.MsSql.json index f8d277b1f5..298b8ccd6e 100644 --- a/src/Service.Tests/dab-config.MsSql.json +++ b/src/Service.Tests/dab-config.MsSql.json @@ -16,7 +16,12 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true + "allow-introspection": true, + "nested-mutations": { + "inserts": { + "enabled": false + } + } }, "host": { "cors": { diff --git a/src/Service.Tests/dab-config.MySql.json b/src/Service.Tests/dab-config.MySql.json index ed56cf5ff9..a98919af15 100644 --- a/src/Service.Tests/dab-config.MySql.json +++ b/src/Service.Tests/dab-config.MySql.json @@ -14,7 +14,12 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true + "allow-introspection": true, + "nested-mutations": { + "inserts": { + "enabled": false + } + } }, "host": { "cors": { diff --git a/src/Service.Tests/dab-config.PostgreSql.json b/src/Service.Tests/dab-config.PostgreSql.json index 5ddd2805bb..c1cc194196 100644 --- a/src/Service.Tests/dab-config.PostgreSql.json +++ b/src/Service.Tests/dab-config.PostgreSql.json @@ -14,7 +14,12 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true + "allow-introspection": true, + "nested-mutations": { + "inserts": { + "enabled": false + } + } }, "host": { "cors": { From c54e4545bcf9249f6e6b8dae1d435d47a8d8f4ed Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 24 Jan 2024 18:35:58 +0530 Subject: [PATCH 04/28] updates parsing logic to handle env vars, fixes tests --- .../GraphQLRuntimeOptionsConverterFactory.cs | 24 +++++++++++++++++-- src/Config/RuntimeConfigLoader.cs | 3 ++- ...untimeConfigLoaderJsonDeserializerTests.cs | 7 +++++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs index dbadf27539..75fa8338c3 100644 --- a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs +++ b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs @@ -9,6 +9,10 @@ namespace Azure.DataApiBuilder.Config.Converters; internal class GraphQLRuntimeOptionsConverterFactory : JsonConverterFactory { + // Determines whether to replace environment variable with its + // value or not while deserializing. + private bool _replaceEnvVar; + /// public override bool CanConvert(Type typeToConvert) { @@ -18,11 +22,27 @@ public override bool CanConvert(Type typeToConvert) /// public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) { - return new GraphQLRuntimeOptionsConverter(); + return new GraphQLRuntimeOptionsConverter(_replaceEnvVar); + } + + internal GraphQLRuntimeOptionsConverterFactory(bool replaceEnvVar) + { + _replaceEnvVar = replaceEnvVar; } private class GraphQLRuntimeOptionsConverter : JsonConverter { + // Determines whether to replace environment variable with its + // value or not while deserializing. + private bool _replaceEnvVar; + + /// Whether to replace environment variable with its + /// value or not while deserializing. + internal GraphQLRuntimeOptionsConverter(bool replaceEnvVar) + { + _replaceEnvVar = replaceEnvVar; + } + public override GraphQLRuntimeOptions? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { if (reader.TokenType == JsonTokenType.True || reader.TokenType == JsonTokenType.Null) @@ -79,7 +99,7 @@ private class GraphQLRuntimeOptionsConverter : JsonConverter Date: Wed, 31 Jan 2024 17:33:51 +0530 Subject: [PATCH 05/28] updates insert => create --- schemas/dab.draft.schema.json | 6 +-- src/Cli.Tests/EndToEndTests.cs | 24 +++++----- src/Cli.Tests/InitTests.cs | 46 +++++++++---------- ...stMethodsAndGraphQLOperations.verified.txt | 2 +- ...tyWithSourceAsStoredProcedure.verified.txt | 2 +- ...tityWithSourceWithDefaultType.verified.txt | 2 +- ...dingEntityWithoutIEnumerables.verified.txt | 2 +- ...ests.TestInitForCosmosDBNoSql.verified.txt | 2 +- ...toredProcedureWithRestMethods.verified.txt | 2 +- ...stMethodsAndGraphQLOperations.verified.txt | 2 +- ...itTests.CosmosDbNoSqlDatabase.verified.txt | 2 +- ...ts.CosmosDbPostgreSqlDatabase.verified.txt | 2 +- ...ionProviders_171ea8114ff71814.verified.txt | 2 +- ...ionProviders_2df7a1794712f154.verified.txt | 2 +- ...ionProviders_59fe1a10aa78899d.verified.txt | 2 +- ...ionProviders_b95b637ea87f16a7.verified.txt | 2 +- ...tStartingSlashWillHaveItAdded.verified.txt | 2 +- .../InitTests.MsSQLDatabase.verified.txt | 2 +- ...tStartingSlashWillHaveItAdded.verified.txt | 2 +- ...ConfigWithoutConnectionString.verified.txt | 2 +- ...lCharactersInConnectionString.verified.txt | 2 +- ...ationOptions_04b5a22faa9af0c2.verified.txt | 2 +- ...ationOptions_0da408c47700b645.verified.txt | 2 +- ...ationOptions_100a98e42d6c45f0.verified.txt | 2 +- ...ationOptions_21d4a6937b2bc36a.verified.txt | 2 +- ...ationOptions_22893dadb964b4af.verified.txt | 2 +- ...ationOptions_35456ee67000cfc1.verified.txt | 2 +- ...ationOptions_3b403406754557bb.verified.txt | 2 +- ...ationOptions_655da17b77dca6b2.verified.txt | 2 +- ...ationOptions_6858c1155ee18e5e.verified.txt | 2 +- ...ationOptions_6ba1b21c030acd10.verified.txt | 2 +- ...ationOptions_95909ef1e107976f.verified.txt | 2 +- ...ationOptions_b45936ff6c917e83.verified.txt | 2 +- ...ationOptions_c0e7d8f970983332.verified.txt | 2 +- ...ationOptions_d63742004cbc9104.verified.txt | 2 +- ...ationOptions_ddefe887c139451b.verified.txt | 2 +- ...ationOptions_e3caca2552d13d9e.verified.txt | 2 +- ...ationOptions_e4c5f76237e4ebdf.verified.txt | 2 +- ...ationOptions_ef60a809ce923334.verified.txt | 2 +- src/Cli/Commands/InitOptions.cs | 8 ++-- src/Cli/ConfigGenerator.cs | 32 ++++++------- .../NestedInsertOptionsConverter.cs | 14 +++--- .../NestedMutationOptionsConverter.cs | 12 ++--- src/Config/ObjectModel/NestedInsertOptions.cs | 8 ++-- .../ObjectModel/NestedMutationOptions.cs | 18 ++++---- src/Config/RuntimeConfigLoader.cs | 2 +- ...ReadingRuntimeConfigForCosmos.verified.txt | 2 +- ...tReadingRuntimeConfigForMsSql.verified.txt | 2 +- ...tReadingRuntimeConfigForMySql.verified.txt | 2 +- ...ingRuntimeConfigForPostgreSql.verified.txt | 2 +- 50 files changed, 125 insertions(+), 125 deletions(-) diff --git a/schemas/dab.draft.schema.json b/schemas/dab.draft.schema.json index fd45381038..2de96cb25a 100644 --- a/schemas/dab.draft.schema.json +++ b/schemas/dab.draft.schema.json @@ -180,13 +180,13 @@ "type": "object", "description": "Feature flags for nested mutation operations", "properties": { - "inserts":{ + "create":{ "type": "object", - "description": "Options for nested insert operations", + "description": "Options for nested create operations", "properties": { "enabled": { "type": "boolean", - "description": "Allow enabling/disabling nested insert operations for all entities.", + "description": "Allow enabling/disabling nested create operations for all entities.", "default": false } } diff --git a/src/Cli.Tests/EndToEndTests.cs b/src/Cli.Tests/EndToEndTests.cs index 7c176fe4a9..0cbe22721b 100644 --- a/src/Cli.Tests/EndToEndTests.cs +++ b/src/Cli.Tests/EndToEndTests.cs @@ -132,22 +132,22 @@ public void TestInitializingRestAndGraphQLGlobalSettings() } /// - /// Test to validate the successful generation of config file with the --graphql.nested-insert.enabled option of the init command. + /// Test to validate the successful generation of config file with the --graphql.nested-create.enabled option of the init command. /// - /// Value for the nested insert enabled flag in the init command. - /// Expected value for the nested insert enabled flag in the config file. + /// Value for the nested create enabled flag in the init command. + /// Expected value for the nested create enabled flag in the config file. [DataTestMethod] - [DataRow(CliBool.True, true, DisplayName = "Nested Insert operation is enabled the config file by specifying '--graphql.nested-insert.enabled true'")] - [DataRow(CliBool.False, false, DisplayName = "Nested Insert operation is disabled the config file by specifying '--graphql.nested-insert.enabled false'")] - [DataRow(null, false, DisplayName = " '--graphql.nested-insert' option is not used in the init command. When not enabled explicitly, the nested insert operation will be disabled.")] - public void TestEnablingNestedInsertOperation(CliBool? isNestedInsertsEnabled, bool expectedValueForNestedInsertEnabledFlag) + [DataRow(CliBool.True, true, DisplayName = "Nested Create operation is enabled the config file by specifying '--graphql.nested-create.enabled true'")] + [DataRow(CliBool.False, false, DisplayName = "Nested Create operation is disabled the config file by specifying '--graphql.nested-create.enabled false'")] + [DataRow(null, false, DisplayName = " '--graphql.nested-create' option is not used in the init command. When not enabled explicitly, the nested create operation will be disabled.")] + public void TestEnablingNestedCreateOperation(CliBool? isNestedCreateEnabled, bool expectedValueForNestedCreateEnabledFlag) { List args = new() { "init", "-c", TEST_RUNTIME_CONFIG_FILE, "--connection-string", SAMPLE_TEST_CONN_STRING, "--database-type", "mssql" }; - if (isNestedInsertsEnabled is not null) + if (isNestedCreateEnabled is not null) { - args.Add("--graphql.nested-insert.enabled"); - args.Add(isNestedInsertsEnabled.ToString()!); + args.Add("--graphql.nested-create.enabled"); + args.Add(isNestedCreateEnabled.ToString()!); } Program.Execute(args.ToArray(), _cliLogger!, _fileSystem!, _runtimeConfigLoader!); @@ -165,8 +165,8 @@ public void TestEnablingNestedInsertOperation(CliBool? isNestedInsertsEnabled, b Assert.IsNotNull(runtimeConfig.Runtime); Assert.IsNotNull(runtimeConfig.Runtime.GraphQL); Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions); - Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedInsertOptions); - Assert.AreEqual(expectedValueForNestedInsertEnabledFlag, runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedInsertOptions.Enabled); + Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedCreateOptions); + Assert.AreEqual(expectedValueForNestedCreateEnabledFlag, runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedCreateOptions.Enabled); } /// diff --git a/src/Cli.Tests/InitTests.cs b/src/Cli.Tests/InitTests.cs index b9c5a26f22..adac0090d7 100644 --- a/src/Cli.Tests/InitTests.cs +++ b/src/Cli.Tests/InitTests.cs @@ -410,28 +410,28 @@ public Task GraphQLPathWithoutStartingSlashWillHaveItAdded() } /// - /// Test to validate the config is correctly generated with different database types and various options for --graphql.nested-insert.enabled flag. + /// Test to validate the config is correctly generated with different database types and various options for --graphql.nested-create.enabled flag. /// [DataTestMethod] - [DataRow(DatabaseType.MSSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-insert.enabled true' for MsSQL database type")] - [DataRow(DatabaseType.MSSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-insert.enabled false' for MsSQL database type")] - [DataRow(DatabaseType.MSSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-insert.enabled' option for MsSQL database type")] - [DataRow(DatabaseType.PostgreSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-insert.enabled true' for PostgreSQL database type")] - [DataRow(DatabaseType.PostgreSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-insert.enabled false' for PostgreSQL database type")] - [DataRow(DatabaseType.PostgreSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-insert.enabled' option for PostgreSQL database type")] - [DataRow(DatabaseType.MySQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-insert.enabled true' for MySQL database type")] - [DataRow(DatabaseType.MySQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-insert.enabled false' for MySQL database type")] - [DataRow(DatabaseType.MySQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-insert.enabled' option for MySQL database type")] - [DataRow(DatabaseType.CosmosDB_NoSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-insert.enabled true' for CosmosDB_NoSQL database type")] - [DataRow(DatabaseType.CosmosDB_NoSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-insert.enabled false' for CosmosDB_NoSQL database type")] - [DataRow(DatabaseType.CosmosDB_NoSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-insert.enabled' option for CosmosDB_NoSQL database type")] - [DataRow(DatabaseType.CosmosDB_PostgreSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-insert.enabled true' for CosmosDB_PostgreSQL database type")] - [DataRow(DatabaseType.CosmosDB_PostgreSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-insert.enabled false' for CosmosDB_PostgreSQL database type")] - [DataRow(DatabaseType.CosmosDB_PostgreSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-insert.enabled' option for CosmosDB_PostgreSQL database type")] - [DataRow(DatabaseType.DWSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-insert.enabled true' for DWSQL database type")] - [DataRow(DatabaseType.DWSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-insert.enabled false' for DWSQL database type")] - [DataRow(DatabaseType.DWSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-insert.enabled' option for DWSQL database type")] - public Task VerifyCorrectConfigGenerationWithNestedMutationOptions(DatabaseType databaseTye, CliBool isNestedInsertEnabled) + [DataRow(DatabaseType.MSSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-create.enabled true' for MsSQL database type")] + [DataRow(DatabaseType.MSSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-create.enabled false' for MsSQL database type")] + [DataRow(DatabaseType.MSSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-create.enabled' option for MsSQL database type")] + [DataRow(DatabaseType.PostgreSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-create.enabled true' for PostgreSQL database type")] + [DataRow(DatabaseType.PostgreSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-create.enabled false' for PostgreSQL database type")] + [DataRow(DatabaseType.PostgreSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-create.enabled' option for PostgreSQL database type")] + [DataRow(DatabaseType.MySQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-create.enabled true' for MySQL database type")] + [DataRow(DatabaseType.MySQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-create.enabled false' for MySQL database type")] + [DataRow(DatabaseType.MySQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-create.enabled' option for MySQL database type")] + [DataRow(DatabaseType.CosmosDB_NoSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-create.enabled true' for CosmosDB_NoSQL database type")] + [DataRow(DatabaseType.CosmosDB_NoSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-create.enabled false' for CosmosDB_NoSQL database type")] + [DataRow(DatabaseType.CosmosDB_NoSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-create.enabled' option for CosmosDB_NoSQL database type")] + [DataRow(DatabaseType.CosmosDB_PostgreSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-create.enabled true' for CosmosDB_PostgreSQL database type")] + [DataRow(DatabaseType.CosmosDB_PostgreSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-create.enabled false' for CosmosDB_PostgreSQL database type")] + [DataRow(DatabaseType.CosmosDB_PostgreSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-create.enabled' option for CosmosDB_PostgreSQL database type")] + [DataRow(DatabaseType.DWSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-create.enabled true' for DWSQL database type")] + [DataRow(DatabaseType.DWSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-create.enabled false' for DWSQL database type")] + [DataRow(DatabaseType.DWSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-create.enabled' option for DWSQL database type")] + public Task VerifyCorrectConfigGenerationWithNestedMutationOptions(DatabaseType databaseTye, CliBool isNestedCreateEnabled) { InitOptions options; @@ -452,7 +452,7 @@ public Task VerifyCorrectConfigGenerationWithNestedMutationOptions(DatabaseType authenticationProvider: EasyAuthType.StaticWebApps.ToString(), restPath: "rest-api", config: TEST_RUNTIME_CONFIG_FILE, - nestedInsertOperationEnabled: isNestedInsertEnabled); + nestedCreateOperationEnabled: isNestedCreateEnabled); } else { @@ -468,11 +468,11 @@ public Task VerifyCorrectConfigGenerationWithNestedMutationOptions(DatabaseType authenticationProvider: EasyAuthType.StaticWebApps.ToString(), restPath: "rest-api", config: TEST_RUNTIME_CONFIG_FILE, - nestedInsertOperationEnabled: isNestedInsertEnabled); + nestedCreateOperationEnabled: isNestedCreateEnabled); } VerifySettings verifySettings = new(); - verifySettings.UseHashedParameters(databaseTye, isNestedInsertEnabled); + verifySettings.UseHashedParameters(databaseTye, isNestedCreateEnabled); return ExecuteVerifyTest(options, verifySettings); } diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt index eb5e8c7ab3..8f1d291a7e 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt index c5bac41231..dfc69e67ff 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt index 6b9f4fb93e..402bd5d689 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt index 47c5fec537..e04b023cb0 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt index 618466dabe..7067ee6c7c 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt @@ -23,7 +23,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt index 26374009ac..e4b1569adf 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt index 2878b0d220..fbe53a416e 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt b/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt index 999a0737f7..fb495e4173 100644 --- a/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt @@ -23,7 +23,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt b/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt index d0b5af02d1..a21edcc430 100644 --- a/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt @@ -13,7 +13,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt index 193b309dfc..d817f87ce9 100644 --- a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt index b0625e704e..8eb7d578da 100644 --- a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt index d5a7a8a515..2d8beed8fd 100644 --- a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt index a2fa13d814..6359191974 100644 --- a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt b/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt index 6ff80a59b7..a1f1896e4a 100644 --- a/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt @@ -18,7 +18,7 @@ Path: /abc, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt b/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt index 046c829c0d..8d8fa23fcf 100644 --- a/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt b/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt index 241b6de745..2ebda06748 100644 --- a/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt b/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt index f28102764e..397882b07c 100644 --- a/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt b/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt index d5a7a8a515..2d8beed8fd 100644 --- a/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_04b5a22faa9af0c2.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_04b5a22faa9af0c2.verified.txt index 00cfe240a7..8baee75774 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_04b5a22faa9af0c2.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_04b5a22faa9af0c2.verified.txt @@ -23,7 +23,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0da408c47700b645.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0da408c47700b645.verified.txt index 00cfe240a7..8baee75774 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0da408c47700b645.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0da408c47700b645.verified.txt @@ -23,7 +23,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_100a98e42d6c45f0.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_100a98e42d6c45f0.verified.txt index ba87c874cd..19267264a5 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_100a98e42d6c45f0.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_100a98e42d6c45f0.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_21d4a6937b2bc36a.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_21d4a6937b2bc36a.verified.txt index ee72beaf0e..55823bfbe0 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_21d4a6937b2bc36a.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_21d4a6937b2bc36a.verified.txt @@ -13,7 +13,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_22893dadb964b4af.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_22893dadb964b4af.verified.txt index ba87c874cd..19267264a5 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_22893dadb964b4af.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_22893dadb964b4af.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35456ee67000cfc1.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35456ee67000cfc1.verified.txt index 00cfe240a7..8baee75774 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35456ee67000cfc1.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35456ee67000cfc1.verified.txt @@ -23,7 +23,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_3b403406754557bb.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_3b403406754557bb.verified.txt index f56e099074..026cc88661 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_3b403406754557bb.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_3b403406754557bb.verified.txt @@ -13,7 +13,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_655da17b77dca6b2.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_655da17b77dca6b2.verified.txt index ee72beaf0e..55823bfbe0 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_655da17b77dca6b2.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_655da17b77dca6b2.verified.txt @@ -13,7 +13,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6858c1155ee18e5e.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6858c1155ee18e5e.verified.txt index 527fcdb389..d439dfaa24 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6858c1155ee18e5e.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6858c1155ee18e5e.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: true } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6ba1b21c030acd10.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6ba1b21c030acd10.verified.txt index ee72beaf0e..55823bfbe0 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6ba1b21c030acd10.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6ba1b21c030acd10.verified.txt @@ -13,7 +13,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_95909ef1e107976f.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_95909ef1e107976f.verified.txt index 6eb1242793..794686467c 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_95909ef1e107976f.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_95909ef1e107976f.verified.txt @@ -13,7 +13,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b45936ff6c917e83.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b45936ff6c917e83.verified.txt index 046c829c0d..8d8fa23fcf 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b45936ff6c917e83.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b45936ff6c917e83.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0e7d8f970983332.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0e7d8f970983332.verified.txt index 6eb1242793..794686467c 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0e7d8f970983332.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0e7d8f970983332.verified.txt @@ -13,7 +13,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d63742004cbc9104.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d63742004cbc9104.verified.txt index ba87c874cd..19267264a5 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d63742004cbc9104.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d63742004cbc9104.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ddefe887c139451b.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ddefe887c139451b.verified.txt index f56e099074..026cc88661 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ddefe887c139451b.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ddefe887c139451b.verified.txt @@ -13,7 +13,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e3caca2552d13d9e.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e3caca2552d13d9e.verified.txt index 046c829c0d..8d8fa23fcf 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e3caca2552d13d9e.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e3caca2552d13d9e.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e4c5f76237e4ebdf.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e4c5f76237e4ebdf.verified.txt index 6eb1242793..794686467c 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e4c5f76237e4ebdf.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e4c5f76237e4ebdf.verified.txt @@ -13,7 +13,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef60a809ce923334.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef60a809ce923334.verified.txt index f56e099074..026cc88661 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef60a809ce923334.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef60a809ce923334.verified.txt @@ -13,7 +13,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Cli/Commands/InitOptions.cs b/src/Cli/Commands/InitOptions.cs index c01720e868..929562d7e6 100644 --- a/src/Cli/Commands/InitOptions.cs +++ b/src/Cli/Commands/InitOptions.cs @@ -37,7 +37,7 @@ public InitOptions( CliBool restEnabled = CliBool.None, CliBool graphqlEnabled = CliBool.None, CliBool restRequestBodyStrict = CliBool.None, - CliBool nestedInsertOperationEnabled = CliBool.None, + CliBool nestedCreateOperationEnabled = CliBool.None, string? config = null) : base(config) { @@ -60,7 +60,7 @@ public InitOptions( RestEnabled = restEnabled; GraphQLEnabled = graphqlEnabled; RestRequestBodyStrict = restRequestBodyStrict; - NestedInsertOperationEnabled = nestedInsertOperationEnabled; + NestedCreateOperationEnabled = nestedCreateOperationEnabled; } [Option("database-type", Required = true, HelpText = "Type of database to connect. Supported values: mssql, cosmosdb_nosql, cosmosdb_postgresql, mysql, postgresql, dwsql")] @@ -122,8 +122,8 @@ public InitOptions( [Option("rest.request-body-strict", Required = false, HelpText = "(Default: true) Allow extraneous fields in the request body for REST.")] public CliBool RestRequestBodyStrict { get; } - [Option("graphql.nested-insert.enabled", Required = false, HelpText = "Enables Nested Insert operation for GraphQL. Supported values: true, false.")] - public CliBool NestedInsertOperationEnabled { get; } + [Option("graphql.nested-insert.enabled", Required = false, HelpText = "Enables Nested Create operation for GraphQL. Supported values: true, false.")] + public CliBool NestedCreateOperationEnabled { get; } public void Handler(ILogger logger, FileSystemRuntimeConfigLoader loader, IFileSystem fileSystem) { diff --git a/src/Cli/ConfigGenerator.cs b/src/Cli/ConfigGenerator.cs index 7ec2e2c562..a4f72d7d59 100644 --- a/src/Cli/ConfigGenerator.cs +++ b/src/Cli/ConfigGenerator.cs @@ -114,24 +114,24 @@ public static bool TryCreateRuntimeConfig(InitOptions options, FileSystemRuntime return false; } - bool isNestedInsertEnabledForGraphQL; + bool isNestedCreateEnabledForGraphQL; - // Nested mutation operations are applicable only for MSSQL database. When the option --graphql.nested-insert.enabled is specified for other database types, + // Nested mutation operations are applicable only for MSSQL database. When the option --graphql.nested-create.enabled is specified for other database types, // a warning is logged. - if (dbType is not DatabaseType.MSSQL && options.NestedInsertOperationEnabled is not CliBool.None) + if (dbType is not DatabaseType.MSSQL && options.NestedCreateOperationEnabled is not CliBool.None) { - _logger.LogWarning($"The option --graphql.nested-insert.enabled is not supported for {dbType.ToString()} database type and will not be honored."); + _logger.LogWarning($"The option --graphql.nested-create.enabled is not supported for {dbType.ToString()} database type and will not be honored."); } if (dbType is not DatabaseType.MSSQL) { - // Nested mutation operations are applicable only for MSSQL database. When the option --graphql.nested-insert.enabled is specified for other database types, + // Nested mutation operations are applicable only for MSSQL database. When the option --graphql.nested-create.enabled is specified for other database types, // it is not honored. - isNestedInsertEnabledForGraphQL = false; + isNestedCreateEnabledForGraphQL = false; } else { - if (!IsNestedInsertOperationEnabled(options.NestedInsertOperationEnabled, out isNestedInsertEnabledForGraphQL)) + if (!IsNestedCreateOperationEnabled(options.NestedCreateOperationEnabled, out isNestedCreateEnabledForGraphQL)) { return false; } @@ -256,7 +256,7 @@ public static bool TryCreateRuntimeConfig(InitOptions options, FileSystemRuntime DataSource: dataSource, Runtime: new( Rest: new(restEnabled, restPath ?? RestRuntimeOptions.DEFAULT_PATH, options.RestRequestBodyStrict is CliBool.False ? false : true), - GraphQL: new(Enabled: graphQLEnabled, Path: graphQLPath, NestedMutationOptions: new(new NestedInsertOptions(enabled: isNestedInsertEnabledForGraphQL))), + GraphQL: new(Enabled: graphQLEnabled, Path: graphQLPath, NestedMutationOptions: new(new NestedCreateOptions(enabled: isNestedCreateEnabledForGraphQL))), Host: new( Cors: new(options.CorsOrigin?.ToArray() ?? Array.Empty()), Authentication: new( @@ -310,25 +310,25 @@ private static bool TryDetermineIfApiIsEnabled(bool apiDisabledOptionValue, CliB } /// - /// Helper method to determine if the nested insert operation is enabled or not based on the inputs from dab init command. + /// Helper method to determine if the nested create operation is enabled or not based on the inputs from dab init command. /// - /// Input value for --graphql.nested-insert.enabled option of the init command - /// Boolean value indicating if nested insert operation is enabled. - private static bool IsNestedInsertOperationEnabled(CliBool nestedInsertsEnabledOptionValue, out bool isNestedInsertEnabledForGraphQL) + /// Input value for --graphql.nested-create.enabled option of the init command + /// Boolean value indicating if nested create operation is enabled. + private static bool IsNestedCreateOperationEnabled(CliBool nestedCreateEnabledOptionValue, out bool isNestedCreateEnabledForGraphQL) { - if (nestedInsertsEnabledOptionValue is CliBool.None) + if (nestedCreateEnabledOptionValue is CliBool.None) { - isNestedInsertEnabledForGraphQL = false; + isNestedCreateEnabledForGraphQL = false; return true; } - if (bool.TryParse(nestedInsertsEnabledOptionValue.ToString(), out isNestedInsertEnabledForGraphQL)) + if (bool.TryParse(nestedCreateEnabledOptionValue.ToString(), out isNestedCreateEnabledForGraphQL)) { return true; } else { - _logger.LogError("Invalid value used with the option --graphql.nested-insert.enabled. Supported values are true/false."); + _logger.LogError("Invalid value used with the option --graphql.nested-create.enabled. Supported values are true/false."); return false; } } diff --git a/src/Config/Converters/NestedInsertOptionsConverter.cs b/src/Config/Converters/NestedInsertOptionsConverter.cs index aab345bc5a..ce82787253 100644 --- a/src/Config/Converters/NestedInsertOptionsConverter.cs +++ b/src/Config/Converters/NestedInsertOptionsConverter.cs @@ -8,16 +8,16 @@ namespace Azure.DataApiBuilder.Config.Converters { /// - /// Converter for the nested insert operation options. + /// Converter for the nested create operation options. /// - internal class NestedInsertOptionsConverter : JsonConverter + internal class NestedCreateOptionsConverter : JsonConverter { /// - public override NestedInsertOptions? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override NestedCreateOptions? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { if (reader.TokenType is JsonTokenType.StartObject) { - NestedInsertOptions? nestedInsertOptions = new(enabled: false); + NestedCreateOptions? nestedCreateOptions = new(enabled: false); while (reader.Read()) { if (reader.TokenType == JsonTokenType.EndObject) @@ -32,7 +32,7 @@ internal class NestedInsertOptionsConverter : JsonConverter reader.Read(); if (reader.TokenType is JsonTokenType.True || reader.TokenType is JsonTokenType.False) { - nestedInsertOptions = new(reader.GetBoolean()); + nestedCreateOptions = new(reader.GetBoolean()); } break; @@ -42,14 +42,14 @@ internal class NestedInsertOptionsConverter : JsonConverter } } - return nestedInsertOptions; + return nestedCreateOptions; } throw new JsonException(); } /// - public override void Write(Utf8JsonWriter writer, NestedInsertOptions value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, NestedCreateOptions value, JsonSerializerOptions options) { writer.WritePropertyName("inserts"); diff --git a/src/Config/Converters/NestedMutationOptionsConverter.cs b/src/Config/Converters/NestedMutationOptionsConverter.cs index 31e45beef1..87ebbded39 100644 --- a/src/Config/Converters/NestedMutationOptionsConverter.cs +++ b/src/Config/Converters/NestedMutationOptionsConverter.cs @@ -13,12 +13,12 @@ namespace Azure.DataApiBuilder.Config.Converters internal class NestedMutationOptionsConverter : JsonConverter { - private readonly NestedInsertOptionsConverter _nestedInsertOptionsConverter; + private readonly NestedCreateOptionsConverter _nestedCreateOptionsConverter; public NestedMutationOptionsConverter(JsonSerializerOptions options) { - _nestedInsertOptionsConverter = options.GetConverter(typeof(NestedInsertOptions)) as NestedInsertOptionsConverter ?? - throw new JsonException("Failed to get nested insert options converter"); + _nestedCreateOptionsConverter = options.GetConverter(typeof(NestedCreateOptions)) as NestedCreateOptionsConverter ?? + throw new JsonException("Failed to get nested create options converter"); } /// @@ -45,7 +45,7 @@ public NestedMutationOptionsConverter(JsonSerializerOptions options) { case "inserts": reader.Read(); - nestedMutationOptions = new(_nestedInsertOptionsConverter.Read(ref reader, typeToConvert, options)); + nestedMutationOptions = new(_nestedCreateOptionsConverter.Read(ref reader, typeToConvert, options)); break; default: @@ -66,9 +66,9 @@ public override void Write(Utf8JsonWriter writer, NestedMutationOptions value, J writer.WriteStartObject(); - if (value.NestedInsertOptions is not null) + if (value.NestedCreateOptions is not null) { - _nestedInsertOptionsConverter.Write(writer, value.NestedInsertOptions, options); + _nestedCreateOptionsConverter.Write(writer, value.NestedCreateOptions, options); } writer.WriteEndObject(); diff --git a/src/Config/ObjectModel/NestedInsertOptions.cs b/src/Config/ObjectModel/NestedInsertOptions.cs index be9ca9529e..7d0f57650f 100644 --- a/src/Config/ObjectModel/NestedInsertOptions.cs +++ b/src/Config/ObjectModel/NestedInsertOptions.cs @@ -3,14 +3,14 @@ namespace Azure.DataApiBuilder.Config.ObjectModel; /// -/// Options for nested insert operations. +/// Options for nested create operations. /// -/// Indicates whether nested insert operation is enabled. -public class NestedInsertOptions +/// Indicates whether nested create operation is enabled. +public class NestedCreateOptions { public bool Enabled; - public NestedInsertOptions(bool enabled) + public NestedCreateOptions(bool enabled) { Enabled = enabled; } diff --git a/src/Config/ObjectModel/NestedMutationOptions.cs b/src/Config/ObjectModel/NestedMutationOptions.cs index 8a940e789f..aaddf47033 100644 --- a/src/Config/ObjectModel/NestedMutationOptions.cs +++ b/src/Config/ObjectModel/NestedMutationOptions.cs @@ -7,25 +7,25 @@ namespace Azure.DataApiBuilder.Config.ObjectModel; /// /// Class that holds the options for all nested mutation operations. /// -/// +/// public class NestedMutationOptions { - // Options for nested insert operation. + // Options for nested create operation. [JsonPropertyName("insert")] - public NestedInsertOptions? NestedInsertOptions; + public NestedCreateOptions? NestedCreateOptions; - public NestedMutationOptions(NestedInsertOptions? nestedInsertOptions) + public NestedMutationOptions(NestedCreateOptions? nestedCreateOptions) { - NestedInsertOptions = nestedInsertOptions; + NestedCreateOptions = nestedCreateOptions; } /// - /// Helper function that checks if nested insert operation is enabled. + /// Helper function that checks if nested create operation is enabled. /// - /// True/False depending on whether nested insert operation is enabled/disabled. - public bool IsNestedInsertOperationEnabled() + /// True/False depending on whether nested create operation is enabled/disabled. + public bool IsNestedCreateOperationEnabled() { - return NestedInsertOptions is not null && NestedInsertOptions.Enabled; + return NestedCreateOptions is not null && NestedCreateOptions.Enabled; } } diff --git a/src/Config/RuntimeConfigLoader.cs b/src/Config/RuntimeConfigLoader.cs index 6585c822e1..c0970b0570 100644 --- a/src/Config/RuntimeConfigLoader.cs +++ b/src/Config/RuntimeConfigLoader.cs @@ -171,7 +171,7 @@ public static JsonSerializerOptions GetSerializationOptions( options.Converters.Add(new EntityActionConverterFactory()); options.Converters.Add(new DataSourceFilesConverter()); options.Converters.Add(new EntityCacheOptionsConverterFactory()); - options.Converters.Add(new NestedInsertOptionsConverter()); + options.Converters.Add(new NestedCreateOptionsConverter()); options.Converters.Add(new NestedMutationOptionsConverter(options)); if (replaceEnvVar) diff --git a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt index 37224aee4c..f84215f831 100644 --- a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt +++ b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt @@ -23,7 +23,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt index ff50884f92..85a48828ba 100644 --- a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt +++ b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt @@ -18,7 +18,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt index 37fbeac242..a31ec817d7 100644 --- a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt +++ b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt @@ -13,7 +13,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } diff --git a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt index 485fe3b131..7560165a49 100644 --- a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt +++ b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt @@ -13,7 +13,7 @@ Path: /graphql, AllowIntrospection: true, NestedMutationOptions: { - NestedInsertOptions: { + NestedCreateOptions: { Enabled: false } } From 49b5ab054c474113177d3b59e74f20da092eead6 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 31 Jan 2024 18:01:51 +0530 Subject: [PATCH 06/28] fixes tests after rename to create --- ...rationWithNestedMutationOptions_006393390a22abfb.verified.txt} | 0 ...rationWithNestedMutationOptions_0e28ff568df4ed15.verified.txt} | 0 ...rationWithNestedMutationOptions_0fd9cba82534c237.verified.txt} | 0 ...rationWithNestedMutationOptions_133f003acce05eae.verified.txt} | 0 ...rationWithNestedMutationOptions_27460cc9fbf8650b.verified.txt} | 0 ...rationWithNestedMutationOptions_35696f184b0ec6f0.verified.txt} | 0 ...rationWithNestedMutationOptions_430e98b7b6c534ac.verified.txt} | 0 ...rationWithNestedMutationOptions_6b62611a0ec627c5.verified.txt} | 0 ...rationWithNestedMutationOptions_6c2edccea07d2ce2.verified.txt} | 0 ...rationWithNestedMutationOptions_703634cf0548aabb.verified.txt} | 0 ...rationWithNestedMutationOptions_7fe3b7f45757ca5f.verified.txt} | 0 ...rationWithNestedMutationOptions_a4d884205a16e6eb.verified.txt} | 0 ...rationWithNestedMutationOptions_afe08f9d8663606a.verified.txt} | 0 ...rationWithNestedMutationOptions_b70fba8f0fbe5327.verified.txt} | 0 ...rationWithNestedMutationOptions_ccc197d5c7f17780.verified.txt} | 0 ...rationWithNestedMutationOptions_ce73834769c5b7be.verified.txt} | 0 ...rationWithNestedMutationOptions_d13d241b5273a6bb.verified.txt} | 0 ...rationWithNestedMutationOptions_ef00caa21de52a86.verified.txt} | 0 18 files changed, 0 insertions(+), 0 deletions(-) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_3b403406754557bb.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_006393390a22abfb.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ddefe887c139451b.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0e28ff568df4ed15.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_100a98e42d6c45f0.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0fd9cba82534c237.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_22893dadb964b4af.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_133f003acce05eae.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_04b5a22faa9af0c2.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_27460cc9fbf8650b.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_95909ef1e107976f.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35696f184b0ec6f0.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6858c1155ee18e5e.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_430e98b7b6c534ac.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d63742004cbc9104.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6b62611a0ec627c5.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0da408c47700b645.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6c2edccea07d2ce2.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_21d4a6937b2bc36a.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_703634cf0548aabb.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b45936ff6c917e83.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_7fe3b7f45757ca5f.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_655da17b77dca6b2.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_a4d884205a16e6eb.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0e7d8f970983332.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_afe08f9d8663606a.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e3caca2552d13d9e.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b70fba8f0fbe5327.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35456ee67000cfc1.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ccc197d5c7f17780.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef60a809ce923334.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ce73834769c5b7be.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e4c5f76237e4ebdf.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d13d241b5273a6bb.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6ba1b21c030acd10.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef00caa21de52a86.verified.txt} (100%) diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_3b403406754557bb.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_006393390a22abfb.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_3b403406754557bb.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_006393390a22abfb.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ddefe887c139451b.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0e28ff568df4ed15.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ddefe887c139451b.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0e28ff568df4ed15.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_100a98e42d6c45f0.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0fd9cba82534c237.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_100a98e42d6c45f0.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0fd9cba82534c237.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_22893dadb964b4af.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_133f003acce05eae.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_22893dadb964b4af.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_133f003acce05eae.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_04b5a22faa9af0c2.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_27460cc9fbf8650b.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_04b5a22faa9af0c2.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_27460cc9fbf8650b.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_95909ef1e107976f.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35696f184b0ec6f0.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_95909ef1e107976f.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35696f184b0ec6f0.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6858c1155ee18e5e.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_430e98b7b6c534ac.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6858c1155ee18e5e.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_430e98b7b6c534ac.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d63742004cbc9104.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6b62611a0ec627c5.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d63742004cbc9104.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6b62611a0ec627c5.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0da408c47700b645.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6c2edccea07d2ce2.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0da408c47700b645.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6c2edccea07d2ce2.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_21d4a6937b2bc36a.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_703634cf0548aabb.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_21d4a6937b2bc36a.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_703634cf0548aabb.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b45936ff6c917e83.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_7fe3b7f45757ca5f.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b45936ff6c917e83.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_7fe3b7f45757ca5f.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_655da17b77dca6b2.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_a4d884205a16e6eb.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_655da17b77dca6b2.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_a4d884205a16e6eb.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0e7d8f970983332.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_afe08f9d8663606a.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0e7d8f970983332.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_afe08f9d8663606a.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e3caca2552d13d9e.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b70fba8f0fbe5327.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e3caca2552d13d9e.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b70fba8f0fbe5327.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35456ee67000cfc1.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ccc197d5c7f17780.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_35456ee67000cfc1.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ccc197d5c7f17780.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef60a809ce923334.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ce73834769c5b7be.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef60a809ce923334.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ce73834769c5b7be.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e4c5f76237e4ebdf.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d13d241b5273a6bb.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_e4c5f76237e4ebdf.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d13d241b5273a6bb.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6ba1b21c030acd10.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef00caa21de52a86.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6ba1b21c030acd10.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef00caa21de52a86.verified.txt From 9b803c60521344b94cd75e2ee8d213a04a51dd4e Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 31 Jan 2024 18:23:34 +0530 Subject: [PATCH 07/28] renames the option to use create instead of insert --- src/Cli/Commands/InitOptions.cs | 2 +- ...nsertOptionsConverter.cs => NestedCreateOptionsConverter.cs} | 2 +- src/Config/Converters/NestedMutationOptionsConverter.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/Config/Converters/{NestedInsertOptionsConverter.cs => NestedCreateOptionsConverter.cs} (97%) diff --git a/src/Cli/Commands/InitOptions.cs b/src/Cli/Commands/InitOptions.cs index 929562d7e6..322b50c16a 100644 --- a/src/Cli/Commands/InitOptions.cs +++ b/src/Cli/Commands/InitOptions.cs @@ -122,7 +122,7 @@ public InitOptions( [Option("rest.request-body-strict", Required = false, HelpText = "(Default: true) Allow extraneous fields in the request body for REST.")] public CliBool RestRequestBodyStrict { get; } - [Option("graphql.nested-insert.enabled", Required = false, HelpText = "Enables Nested Create operation for GraphQL. Supported values: true, false.")] + [Option("graphql.nested-create.enabled", Required = false, HelpText = "Enables Nested Create operation for GraphQL. Supported values: true, false.")] public CliBool NestedCreateOperationEnabled { get; } public void Handler(ILogger logger, FileSystemRuntimeConfigLoader loader, IFileSystem fileSystem) diff --git a/src/Config/Converters/NestedInsertOptionsConverter.cs b/src/Config/Converters/NestedCreateOptionsConverter.cs similarity index 97% rename from src/Config/Converters/NestedInsertOptionsConverter.cs rename to src/Config/Converters/NestedCreateOptionsConverter.cs index ce82787253..33611a38d6 100644 --- a/src/Config/Converters/NestedInsertOptionsConverter.cs +++ b/src/Config/Converters/NestedCreateOptionsConverter.cs @@ -51,7 +51,7 @@ internal class NestedCreateOptionsConverter : JsonConverter /// public override void Write(Utf8JsonWriter writer, NestedCreateOptions value, JsonSerializerOptions options) { - writer.WritePropertyName("inserts"); + writer.WritePropertyName("create"); writer.WriteStartObject(); writer.WritePropertyName("enabled"); diff --git a/src/Config/Converters/NestedMutationOptionsConverter.cs b/src/Config/Converters/NestedMutationOptionsConverter.cs index 87ebbded39..45c67c0119 100644 --- a/src/Config/Converters/NestedMutationOptionsConverter.cs +++ b/src/Config/Converters/NestedMutationOptionsConverter.cs @@ -43,7 +43,7 @@ public NestedMutationOptionsConverter(JsonSerializerOptions options) string? propertyName = reader.GetString(); switch (propertyName) { - case "inserts": + case "create": reader.Read(); nestedMutationOptions = new(_nestedCreateOptionsConverter.Read(ref reader, typeToConvert, options)); break; From f361623973f515a7d21c9b8d9da991cfa3136413 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 31 Jan 2024 18:28:12 +0530 Subject: [PATCH 08/28] updates sample config files --- src/Service.Tests/Caching/CachingConfigProcessingTests.cs | 2 +- src/Service.Tests/Multidab-config.CosmosDb_NoSql.json | 2 +- src/Service.Tests/Multidab-config.MsSql.json | 2 +- src/Service.Tests/Multidab-config.MySql.json | 2 +- src/Service.Tests/Multidab-config.PostgreSql.json | 2 +- src/Service.Tests/dab-config.CosmosDb_NoSql.json | 2 +- src/Service.Tests/dab-config.DwSql.json | 2 +- src/Service.Tests/dab-config.MsSql.json | 2 +- src/Service.Tests/dab-config.MySql.json | 2 +- src/Service.Tests/dab-config.PostgreSql.json | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Service.Tests/Caching/CachingConfigProcessingTests.cs b/src/Service.Tests/Caching/CachingConfigProcessingTests.cs index 232dd50acb..0571eaed5a 100644 --- a/src/Service.Tests/Caching/CachingConfigProcessingTests.cs +++ b/src/Service.Tests/Caching/CachingConfigProcessingTests.cs @@ -418,7 +418,7 @@ private static string GetRawConfigJson(string globalCacheConfig, string entityCa ""path"": ""/An_"", ""allow-introspection"": true, ""nested-mutations"": { - ""inserts"": { + ""create"": { ""enabled"": false } } diff --git a/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json b/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json index fb633e0f85..67d10ce4e4 100644 --- a/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json +++ b/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json @@ -19,7 +19,7 @@ "path": "/graphql", "allow-introspection": true, "nested-mutations": { - "inserts": { + "create": { "enabled": false } } diff --git a/src/Service.Tests/Multidab-config.MsSql.json b/src/Service.Tests/Multidab-config.MsSql.json index f1ac6227d0..05898c266f 100644 --- a/src/Service.Tests/Multidab-config.MsSql.json +++ b/src/Service.Tests/Multidab-config.MsSql.json @@ -17,7 +17,7 @@ "path": "/graphql", "allow-introspection": true, "nested-mutations": { - "inserts": { + "create": { "enabled": false } } diff --git a/src/Service.Tests/Multidab-config.MySql.json b/src/Service.Tests/Multidab-config.MySql.json index 66974c677c..d5748f5cb6 100644 --- a/src/Service.Tests/Multidab-config.MySql.json +++ b/src/Service.Tests/Multidab-config.MySql.json @@ -14,7 +14,7 @@ "path": "/graphql", "allow-introspection": true, "nested-mutations": { - "inserts": { + "create": { "enabled": false } } diff --git a/src/Service.Tests/Multidab-config.PostgreSql.json b/src/Service.Tests/Multidab-config.PostgreSql.json index 83b018659c..0fd13d8898 100644 --- a/src/Service.Tests/Multidab-config.PostgreSql.json +++ b/src/Service.Tests/Multidab-config.PostgreSql.json @@ -14,7 +14,7 @@ "path": "/graphql", "allow-introspection": true, "nested-mutations": { - "inserts": { + "create": { "enabled": false } } diff --git a/src/Service.Tests/dab-config.CosmosDb_NoSql.json b/src/Service.Tests/dab-config.CosmosDb_NoSql.json index dda5325998..7ebb4a0ad4 100644 --- a/src/Service.Tests/dab-config.CosmosDb_NoSql.json +++ b/src/Service.Tests/dab-config.CosmosDb_NoSql.json @@ -20,7 +20,7 @@ "path": "/graphql", "allow-introspection": true, "nested-mutations": { - "inserts": { + "create": { "enabled": false } } diff --git a/src/Service.Tests/dab-config.DwSql.json b/src/Service.Tests/dab-config.DwSql.json index 7edccbebcb..2f14494cb8 100644 --- a/src/Service.Tests/dab-config.DwSql.json +++ b/src/Service.Tests/dab-config.DwSql.json @@ -18,7 +18,7 @@ "path": "/graphql", "allow-introspection": true, "nested-mutations": { - "inserts": { + "create": { "enabled": false } } diff --git a/src/Service.Tests/dab-config.MsSql.json b/src/Service.Tests/dab-config.MsSql.json index 298b8ccd6e..a38930c0f9 100644 --- a/src/Service.Tests/dab-config.MsSql.json +++ b/src/Service.Tests/dab-config.MsSql.json @@ -18,7 +18,7 @@ "path": "/graphql", "allow-introspection": true, "nested-mutations": { - "inserts": { + "create": { "enabled": false } } diff --git a/src/Service.Tests/dab-config.MySql.json b/src/Service.Tests/dab-config.MySql.json index a98919af15..495ff1a3de 100644 --- a/src/Service.Tests/dab-config.MySql.json +++ b/src/Service.Tests/dab-config.MySql.json @@ -16,7 +16,7 @@ "path": "/graphql", "allow-introspection": true, "nested-mutations": { - "inserts": { + "create": { "enabled": false } } diff --git a/src/Service.Tests/dab-config.PostgreSql.json b/src/Service.Tests/dab-config.PostgreSql.json index c1cc194196..57fa83c0cf 100644 --- a/src/Service.Tests/dab-config.PostgreSql.json +++ b/src/Service.Tests/dab-config.PostgreSql.json @@ -16,7 +16,7 @@ "path": "/graphql", "allow-introspection": true, "nested-mutations": { - "inserts": { + "create": { "enabled": false } } From a241277804cf4e1e11e6716c1f2ee90f70789ab0 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 31 Jan 2024 18:50:09 +0530 Subject: [PATCH 09/28] addressing review comments --- src/Cli/ConfigGenerator.cs | 2 ++ src/Config/ObjectModel/GraphQLRuntimeOptions.cs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Cli/ConfigGenerator.cs b/src/Cli/ConfigGenerator.cs index a4f72d7d59..b22ec66dc2 100644 --- a/src/Cli/ConfigGenerator.cs +++ b/src/Cli/ConfigGenerator.cs @@ -118,6 +118,8 @@ public static bool TryCreateRuntimeConfig(InitOptions options, FileSystemRuntime // Nested mutation operations are applicable only for MSSQL database. When the option --graphql.nested-create.enabled is specified for other database types, // a warning is logged. + // When nested mutation operations are extended for other database types, this option should be honored. + // Issue #2001: https://github.com/Azure/data-api-builder/issues/2001 tracks the work for the same. if (dbType is not DatabaseType.MSSQL && options.NestedCreateOperationEnabled is not CliBool.None) { _logger.LogWarning($"The option --graphql.nested-create.enabled is not supported for {dbType.ToString()} database type and will not be honored."); diff --git a/src/Config/ObjectModel/GraphQLRuntimeOptions.cs b/src/Config/ObjectModel/GraphQLRuntimeOptions.cs index a6a4fed1b6..9033d269e6 100644 --- a/src/Config/ObjectModel/GraphQLRuntimeOptions.cs +++ b/src/Config/ObjectModel/GraphQLRuntimeOptions.cs @@ -3,7 +3,10 @@ namespace Azure.DataApiBuilder.Config.ObjectModel; -public record GraphQLRuntimeOptions(bool Enabled = true, string Path = GraphQLRuntimeOptions.DEFAULT_PATH, bool AllowIntrospection = true, NestedMutationOptions? NestedMutationOptions = null) +public record GraphQLRuntimeOptions(bool Enabled = true, + string Path = GraphQLRuntimeOptions.DEFAULT_PATH, + bool AllowIntrospection = true, + NestedMutationOptions? NestedMutationOptions = null) { public const string DEFAULT_PATH = "/graphql"; } From cf35d11ec45cb7a12c628709ca5f25c176f64816 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 31 Jan 2024 19:04:30 +0530 Subject: [PATCH 10/28] fixing tests --- src/Cli.Tests/ConfigGeneratorTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cli.Tests/ConfigGeneratorTests.cs b/src/Cli.Tests/ConfigGeneratorTests.cs index b4920b5890..0056953336 100644 --- a/src/Cli.Tests/ConfigGeneratorTests.cs +++ b/src/Cli.Tests/ConfigGeneratorTests.cs @@ -163,7 +163,7 @@ public void TestSpecialCharactersInConnectionString() ""path"": ""/An_"", ""allow-introspection"": true, ""nested-mutations"": { - ""inserts"": { + ""create"": { ""enabled"": false } } From 156ecb5118f5ad1d3c5072df76d6c3e56290164c Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 1 Feb 2024 14:40:01 +0530 Subject: [PATCH 11/28] adds a sanity test to ensure old config works --- .../Configuration/ConfigurationTests.cs | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/src/Service.Tests/Configuration/ConfigurationTests.cs b/src/Service.Tests/Configuration/ConfigurationTests.cs index 8c8805e424..a2c5588989 100644 --- a/src/Service.Tests/Configuration/ConfigurationTests.cs +++ b/src/Service.Tests/Configuration/ConfigurationTests.cs @@ -1579,6 +1579,110 @@ public async Task TestSPRestDefaultsForManuallyConstructedConfigs( } } + /// + /// + /// + [TestMethod] + public async Task SanityTestForRestAndGQLRequestsWithoutNestedMutationFeatureFlagSection() + { + // Hard-coded json string for Book entity + string entityJson = @" + { + ""entities"": { + ""Book"": { + ""source"": { + ""object"": ""books"", + ""type"": ""table"" + }, + ""graphql"": { + ""enabled"": true, + ""type"": { + ""singular"": ""book"", + ""plural"": ""books"" + } + }, + ""rest"":{ + ""enabled"": true + }, + ""permissions"": [ + { + ""role"": ""anonymous"", + ""actions"": [ + { + ""action"": ""create"" + }, + { + ""action"": ""read"" + }, + { + ""action"": ""update"" + }, + { + ""action"": ""delete"" + } + ] + } + ], + ""mappings"": null, + ""relationships"": null + } + } + }"; + + // The config file is constructed by merging the hard-coded json strings to mimic the scenario where config file is + // hand-edited (instead of using CLI) by the users. + string configJson = TestHelper.AddPropertiesToJson(TestHelper.BASE_CONFIG, entityJson); + RuntimeConfigLoader.TryParseConfig(configJson, out RuntimeConfig deserializedConfig, logger: null, GetConnectionStringFromEnvironmentConfig(environment: TestCategory.MSSQL)); + string configFileName = "custom-config.json"; + File.WriteAllText(configFileName, deserializedConfig.ToJson()); + string[] args = new[] + { + $"--ConfigFileName={configFileName}" + }; + + using (TestServer server = new(Program.CreateWebHostBuilder(args))) + using (HttpClient client = server.CreateClient()) + { + try{ + + // Perform a REST GET API request + // 1. To validate that DAB engine deserialized the config without the nested mutation feature flag section correctly. + // 2. To validate that REST GET requests are executed correctly. + HttpRequestMessage restRequest = new(HttpMethod.Get, "api/Book"); + HttpResponseMessage restResponse = await client.SendAsync(restRequest); + Assert.AreEqual(HttpStatusCode.OK, restResponse.StatusCode); + + // Perform a GraphQL API request + // 1. To validate that DAB engine successfully deserialized the config without the nested mutation feature flag section. + // 2. To validate that DAB engine executes GraphQL requests successfully. + string query = @"{ + book_by_pk(id: 1) { + id, + title, + publisher_id + } + }"; + + object payload = new { query }; + + HttpRequestMessage graphQLRequest = new(HttpMethod.Post, "/graphql") + { + Content = JsonContent.Create(payload) + }; + + HttpResponseMessage graphQLResponse = await client.SendAsync(graphQLRequest); + Assert.AreEqual(HttpStatusCode.OK, graphQLResponse.StatusCode); + Assert.IsNotNull(graphQLResponse.Content); + string body = await graphQLResponse.Content.ReadAsStringAsync(); + Assert.IsFalse(body.Contains("errors")); + } + catch(Exception ex) + { + Assert.Fail($"Unexpected exception : {ex}" ); + } + } + } + /// /// Test to validate that when an entity which will return a paginated response is queried, and a custom runtime base route is configured in the runtime configuration, /// then the generated nextLink in the response would contain the rest base-route just before the rest path. For the subsequent query, the rest base-route will be trimmed From 122241cc90a9488608be30c394bdca9f964b35d1 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 1 Feb 2024 14:53:04 +0530 Subject: [PATCH 12/28] updates graphqlql runtime initialization logic --- ...stingNameButWithDifferentCase.verified.txt | 7 +++++- ...ldProperties_70de36ebf1478d0d.verified.txt | 7 +++++- ...ldProperties_9f612e68879149a3.verified.txt | 7 +++++- ...ldProperties_bea2d26f3e5462d8.verified.txt | 7 +++++- ...AddNewEntityWhenEntitiesEmpty.verified.txt | 7 +++++- ...NewEntityWhenEntitiesNotEmpty.verified.txt | 7 +++++- ...esWithSourceAsStoredProcedure.verified.txt | 7 +++++- ...aphQLOptions_0c9cbb8942b4a4e5.verified.txt | 7 +++++- ...aphQLOptions_286d268a654ece27.verified.txt | 7 +++++- ...aphQLOptions_3048323e01b42681.verified.txt | 7 +++++- ...aphQLOptions_3440d150a2282b9c.verified.txt | 7 +++++- ...aphQLOptions_381c28d25063be0c.verified.txt | 7 +++++- ...aphQLOptions_458373311f6ed4ed.verified.txt | 7 +++++- ...aphQLOptions_66799c963a6306ae.verified.txt | 7 +++++- ...aphQLOptions_66f598295b8682fd.verified.txt | 7 +++++- ...aphQLOptions_73f95f7e2cd3ed71.verified.txt | 7 +++++- ...aphQLOptions_79d59edde7f6a272.verified.txt | 7 +++++- ...aphQLOptions_7ec82512a1df5293.verified.txt | 7 +++++- ...aphQLOptions_cbb6e5548e4d3535.verified.txt | 7 +++++- ...aphQLOptions_dc629052f38cea32.verified.txt | 7 +++++- ...aphQLOptions_e4a97c7e3507d2c6.verified.txt | 7 +++++- ...aphQLOptions_f8d0d0c2a38bd3b8.verified.txt | 7 +++++- ...stMethodsAndGraphQLOperations.verified.txt | 7 +++++- ...SourceObject_036a859f50ce167c.verified.txt | 7 +++++- ...SourceObject_103655d39b48d89f.verified.txt | 7 +++++- ...SourceObject_442649c7ef2176bd.verified.txt | 7 +++++- ...SourceObject_7f2338fdc84aafc3.verified.txt | 7 +++++- ...SourceObject_a70c086a74142c82.verified.txt | 7 +++++- ...SourceObject_c26902b0e44f97cd.verified.txt | 7 +++++- ...EntityByAddingNewRelationship.verified.txt | 7 +++++- ...EntityByModifyingRelationship.verified.txt | 7 +++++- ...ts.TestUpdateEntityPermission.verified.txt | 7 +++++- ...tityPermissionByAddingNewRole.verified.txt | 7 +++++- ...ermissionHavingWildcardAction.verified.txt | 7 +++++- ...yPermissionWithExistingAction.verified.txt | 7 +++++- ...yPermissionWithWildcardAction.verified.txt | 7 +++++- ....TestUpdateEntityWithMappings.verified.txt | 7 +++++- ...ldProperties_088d6237033e0a7c.verified.txt | 7 +++++- ...ldProperties_3ea32fdef7aed1b4.verified.txt | 7 +++++- ...ldProperties_4d25c2c012107597.verified.txt | 7 +++++- ...ithSpecialCharacterInMappings.verified.txt | 7 +++++- ...ts.TestUpdateExistingMappings.verified.txt | 7 +++++- ...eEntityTests.TestUpdatePolicy.verified.txt | 7 +++++- ...edProcedures_10ea92e3b25ab0c9.verified.txt | 7 +++++- ...edProcedures_127bb81593f835fe.verified.txt | 7 +++++- ...edProcedures_386efa1a113fac6b.verified.txt | 7 +++++- ...edProcedures_53db4712d83be8e6.verified.txt | 7 +++++- ...edProcedures_5e9ddd8c7c740efd.verified.txt | 7 +++++- ...edProcedures_6c5b3bfc72e5878a.verified.txt | 7 +++++- ...edProcedures_8398059a743d7027.verified.txt | 7 +++++- ...edProcedures_a49380ce6d1fd8ba.verified.txt | 7 +++++- ...edProcedures_c9b12fe27be53878.verified.txt | 7 +++++- ...edProcedures_d19603117eb8b51b.verified.txt | 7 +++++- ...edProcedures_d770d682c5802737.verified.txt | 7 +++++- ...edProcedures_ef8cc721c9dfc7e4.verified.txt | 7 +++++- ...edProcedures_f3897e2254996db0.verified.txt | 7 +++++- ...edProcedures_f4cadb897fc5b0fe.verified.txt | 7 +++++- ...edProcedures_f59b2a65fc1e18a3.verified.txt | 7 +++++- ...SourceObject_574e1995f787740f.verified.txt | 7 +++++- ...SourceObject_a13a9ca73b21f261.verified.txt | 7 +++++- ...SourceObject_a5ce76c8bea25cc8.verified.txt | 7 +++++- ...SourceObject_bba111332a1f973f.verified.txt | 7 +++++- ...UpdateDatabaseSourceKeyFields.verified.txt | 7 +++++- ...ests.UpdateDatabaseSourceName.verified.txt | 7 +++++- ...pdateDatabaseSourceParameters.verified.txt | 7 +++++- .../GraphQLRuntimeOptionsConverterFactory.cs | 7 +++--- .../Configuration/ConfigurationTests.cs | 22 ++++++------------- ...untimeConfigLoaderJsonDeserializerTests.cs | 2 +- 68 files changed, 402 insertions(+), 84 deletions(-) diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithAnExistingNameButWithDifferentCase.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithAnExistingNameButWithDifferentCase.verified.txt index 44fbbaa18b..8986c8338b 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithAnExistingNameButWithDifferentCase.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithAnExistingNameButWithDifferentCase.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_70de36ebf1478d0d.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_70de36ebf1478d0d.verified.txt index 7c701037fd..0482c1fa7e 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_70de36ebf1478d0d.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_70de36ebf1478d0d.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_9f612e68879149a3.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_9f612e68879149a3.verified.txt index cec0a3d8ab..17344eb3dd 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_9f612e68879149a3.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_9f612e68879149a3.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_bea2d26f3e5462d8.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_bea2d26f3e5462d8.verified.txt index c318861497..887a57eadd 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_bea2d26f3e5462d8.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_bea2d26f3e5462d8.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesEmpty.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesEmpty.verified.txt index 8d8f226805..8e4abd2be4 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesEmpty.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesEmpty.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesNotEmpty.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesNotEmpty.verified.txt index 4e3184736d..e325efe050 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesNotEmpty.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesNotEmpty.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesWithSourceAsStoredProcedure.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesWithSourceAsStoredProcedure.verified.txt index 17e8de5193..91c7acf0eb 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesWithSourceAsStoredProcedure.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesWithSourceAsStoredProcedure.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_0c9cbb8942b4a4e5.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_0c9cbb8942b4a4e5.verified.txt index c7cb996d03..dcaf587172 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_0c9cbb8942b4a4e5.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_0c9cbb8942b4a4e5.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_286d268a654ece27.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_286d268a654ece27.verified.txt index 13beb6bc7c..59c18000b0 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_286d268a654ece27.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_286d268a654ece27.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3048323e01b42681.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3048323e01b42681.verified.txt index bdd7c8f7a0..796105e568 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3048323e01b42681.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3048323e01b42681.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3440d150a2282b9c.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3440d150a2282b9c.verified.txt index 20d7bcd624..fb7f8fd745 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3440d150a2282b9c.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3440d150a2282b9c.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_381c28d25063be0c.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_381c28d25063be0c.verified.txt index 13beb6bc7c..59c18000b0 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_381c28d25063be0c.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_381c28d25063be0c.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_458373311f6ed4ed.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_458373311f6ed4ed.verified.txt index b87e804456..04644e8e0a 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_458373311f6ed4ed.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_458373311f6ed4ed.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66799c963a6306ae.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66799c963a6306ae.verified.txt index 18c5f966c5..79d2940a0f 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66799c963a6306ae.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66799c963a6306ae.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66f598295b8682fd.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66f598295b8682fd.verified.txt index 1cd138d10f..b3c39a3354 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66f598295b8682fd.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66f598295b8682fd.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_73f95f7e2cd3ed71.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_73f95f7e2cd3ed71.verified.txt index c7cb996d03..dcaf587172 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_73f95f7e2cd3ed71.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_73f95f7e2cd3ed71.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_79d59edde7f6a272.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_79d59edde7f6a272.verified.txt index b87e804456..04644e8e0a 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_79d59edde7f6a272.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_79d59edde7f6a272.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_7ec82512a1df5293.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_7ec82512a1df5293.verified.txt index c7cb996d03..dcaf587172 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_7ec82512a1df5293.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_7ec82512a1df5293.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_cbb6e5548e4d3535.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_cbb6e5548e4d3535.verified.txt index c7cb996d03..dcaf587172 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_cbb6e5548e4d3535.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_cbb6e5548e4d3535.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_dc629052f38cea32.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_dc629052f38cea32.verified.txt index 612a65c14a..2e7c289550 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_dc629052f38cea32.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_dc629052f38cea32.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_e4a97c7e3507d2c6.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_e4a97c7e3507d2c6.verified.txt index 87b7a7697c..9e86b78ae5 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_e4a97c7e3507d2c6.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_e4a97c7e3507d2c6.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_f8d0d0c2a38bd3b8.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_f8d0d0c2a38bd3b8.verified.txt index 1cd138d10f..b3c39a3354 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_f8d0d0c2a38bd3b8.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_f8d0d0c2a38bd3b8.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt index 9aca5ba640..69ea1a57ee 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_036a859f50ce167c.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_036a859f50ce167c.verified.txt index a78465898d..6e7d7cf324 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_036a859f50ce167c.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_036a859f50ce167c.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_103655d39b48d89f.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_103655d39b48d89f.verified.txt index d3ed32cf42..6b14e1e295 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_103655d39b48d89f.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_103655d39b48d89f.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_442649c7ef2176bd.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_442649c7ef2176bd.verified.txt index a78465898d..6e7d7cf324 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_442649c7ef2176bd.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_442649c7ef2176bd.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_7f2338fdc84aafc3.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_7f2338fdc84aafc3.verified.txt index b6b9269e87..1c3247fb7a 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_7f2338fdc84aafc3.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_7f2338fdc84aafc3.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_a70c086a74142c82.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_a70c086a74142c82.verified.txt index 17e8de5193..91c7acf0eb 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_a70c086a74142c82.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_a70c086a74142c82.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_c26902b0e44f97cd.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_c26902b0e44f97cd.verified.txt index 2b4a7b8518..79d0ec36b3 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_c26902b0e44f97cd.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_c26902b0e44f97cd.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByAddingNewRelationship.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByAddingNewRelationship.verified.txt index 2789572051..39660eb2b3 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByAddingNewRelationship.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByAddingNewRelationship.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByModifyingRelationship.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByModifyingRelationship.verified.txt index 092dec7745..f2751a0894 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByModifyingRelationship.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByModifyingRelationship.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermission.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermission.verified.txt index 1a77d65bcd..68298b3179 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermission.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermission.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionByAddingNewRole.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionByAddingNewRole.verified.txt index 6775db8dde..ee8e61131f 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionByAddingNewRole.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionByAddingNewRole.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionHavingWildcardAction.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionHavingWildcardAction.verified.txt index 64517082ad..fc09a05703 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionHavingWildcardAction.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionHavingWildcardAction.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithExistingAction.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithExistingAction.verified.txt index 52dc99399e..6485bb2dd7 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithExistingAction.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithExistingAction.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithWildcardAction.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithWildcardAction.verified.txt index 92b5917b92..902e86d4ff 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithWildcardAction.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithWildcardAction.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithMappings.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithMappings.verified.txt index 63ba7e2898..f7b0536eb3 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithMappings.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithMappings.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_088d6237033e0a7c.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_088d6237033e0a7c.verified.txt index 7c701037fd..0482c1fa7e 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_088d6237033e0a7c.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_088d6237033e0a7c.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_3ea32fdef7aed1b4.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_3ea32fdef7aed1b4.verified.txt index c318861497..887a57eadd 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_3ea32fdef7aed1b4.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_3ea32fdef7aed1b4.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_4d25c2c012107597.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_4d25c2c012107597.verified.txt index cdf30a00c9..5c283d076c 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_4d25c2c012107597.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_4d25c2c012107597.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithSpecialCharacterInMappings.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithSpecialCharacterInMappings.verified.txt index 8dcadec7b1..24d5d77bac 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithSpecialCharacterInMappings.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithSpecialCharacterInMappings.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateExistingMappings.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateExistingMappings.verified.txt index 13e994a5cc..b60e3f079a 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateExistingMappings.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateExistingMappings.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdatePolicy.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdatePolicy.verified.txt index c8002a2fbc..0d8c22933c 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdatePolicy.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdatePolicy.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_10ea92e3b25ab0c9.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_10ea92e3b25ab0c9.verified.txt index b87e804456..04644e8e0a 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_10ea92e3b25ab0c9.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_10ea92e3b25ab0c9.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_127bb81593f835fe.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_127bb81593f835fe.verified.txt index 1cd138d10f..b3c39a3354 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_127bb81593f835fe.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_127bb81593f835fe.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_386efa1a113fac6b.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_386efa1a113fac6b.verified.txt index c7cb996d03..dcaf587172 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_386efa1a113fac6b.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_386efa1a113fac6b.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_53db4712d83be8e6.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_53db4712d83be8e6.verified.txt index 20d7bcd624..fb7f8fd745 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_53db4712d83be8e6.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_53db4712d83be8e6.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_5e9ddd8c7c740efd.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_5e9ddd8c7c740efd.verified.txt index 13beb6bc7c..59c18000b0 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_5e9ddd8c7c740efd.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_5e9ddd8c7c740efd.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_6c5b3bfc72e5878a.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_6c5b3bfc72e5878a.verified.txt index c7cb996d03..dcaf587172 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_6c5b3bfc72e5878a.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_6c5b3bfc72e5878a.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_8398059a743d7027.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_8398059a743d7027.verified.txt index c7cb996d03..dcaf587172 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_8398059a743d7027.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_8398059a743d7027.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_a49380ce6d1fd8ba.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_a49380ce6d1fd8ba.verified.txt index bdd7c8f7a0..796105e568 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_a49380ce6d1fd8ba.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_a49380ce6d1fd8ba.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_c9b12fe27be53878.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_c9b12fe27be53878.verified.txt index e8fc427339..e881ead483 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_c9b12fe27be53878.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_c9b12fe27be53878.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d19603117eb8b51b.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d19603117eb8b51b.verified.txt index 13beb6bc7c..59c18000b0 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d19603117eb8b51b.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d19603117eb8b51b.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d770d682c5802737.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d770d682c5802737.verified.txt index b87e804456..04644e8e0a 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d770d682c5802737.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d770d682c5802737.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_ef8cc721c9dfc7e4.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_ef8cc721c9dfc7e4.verified.txt index 87b7a7697c..9e86b78ae5 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_ef8cc721c9dfc7e4.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_ef8cc721c9dfc7e4.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f3897e2254996db0.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f3897e2254996db0.verified.txt index 18c5f966c5..79d2940a0f 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f3897e2254996db0.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f3897e2254996db0.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f4cadb897fc5b0fe.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f4cadb897fc5b0fe.verified.txt index 612a65c14a..2e7c289550 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f4cadb897fc5b0fe.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f4cadb897fc5b0fe.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f59b2a65fc1e18a3.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f59b2a65fc1e18a3.verified.txt index 1cd138d10f..b3c39a3354 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f59b2a65fc1e18a3.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f59b2a65fc1e18a3.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_574e1995f787740f.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_574e1995f787740f.verified.txt index a78465898d..6e7d7cf324 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_574e1995f787740f.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_574e1995f787740f.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a13a9ca73b21f261.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a13a9ca73b21f261.verified.txt index d3ed32cf42..6b14e1e295 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a13a9ca73b21f261.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a13a9ca73b21f261.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a5ce76c8bea25cc8.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a5ce76c8bea25cc8.verified.txt index d3ed32cf42..6b14e1e295 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a5ce76c8bea25cc8.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a5ce76c8bea25cc8.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_bba111332a1f973f.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_bba111332a1f973f.verified.txt index ba28cd7509..12593a6aca 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_bba111332a1f973f.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_bba111332a1f973f.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceKeyFields.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceKeyFields.verified.txt index 697074cedf..d022d2ad5d 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceKeyFields.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceKeyFields.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceName.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceName.verified.txt index 967a59f1f9..cf0c9367b8 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceName.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceName.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceParameters.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceParameters.verified.txt index 016527cd68..2c60ba6563 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceParameters.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceParameters.verified.txt @@ -11,7 +11,12 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true + AllowIntrospection: true, + NestedMutationOptions: { + NestedCreateOptions: { + Enabled: false + } + } }, Host: { Cors: { diff --git a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs index 75fa8338c3..9e0e6382e5 100644 --- a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs +++ b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs @@ -47,17 +47,18 @@ internal GraphQLRuntimeOptionsConverter(bool replaceEnvVar) { if (reader.TokenType == JsonTokenType.True || reader.TokenType == JsonTokenType.Null) { - return new GraphQLRuntimeOptions(); + return new GraphQLRuntimeOptions(NestedMutationOptions: new(nestedCreateOptions: new(enabled: false))); } if (reader.TokenType == JsonTokenType.False) { - return new GraphQLRuntimeOptions(Enabled: false); + return new GraphQLRuntimeOptions(Enabled: false, NestedMutationOptions: new(nestedCreateOptions: new(enabled: false))); } if (reader.TokenType == JsonTokenType.StartObject) { - GraphQLRuntimeOptions graphQLRuntimeOptions = new(); + // Initialize with Nested Mutation operations disabled by default + GraphQLRuntimeOptions graphQLRuntimeOptions = new(NestedMutationOptions: new(nestedCreateOptions: new(enabled: false))); NestedMutationOptionsConverter nestedMutationOptionsConverter = options.GetConverter(typeof(NestedMutationOptions)) as NestedMutationOptionsConverter ?? throw new JsonException("Failed to get nested mutation options converter"); diff --git a/src/Service.Tests/Configuration/ConfigurationTests.cs b/src/Service.Tests/Configuration/ConfigurationTests.cs index a2c5588989..38a98932d0 100644 --- a/src/Service.Tests/Configuration/ConfigurationTests.cs +++ b/src/Service.Tests/Configuration/ConfigurationTests.cs @@ -1585,8 +1585,8 @@ public async Task TestSPRestDefaultsForManuallyConstructedConfigs( [TestMethod] public async Task SanityTestForRestAndGQLRequestsWithoutNestedMutationFeatureFlagSection() { - // Hard-coded json string for Book entity - string entityJson = @" + // Hard-coded json string for Book entity + string entityJson = @" { ""entities"": { ""Book"": { @@ -1608,17 +1608,8 @@ public async Task SanityTestForRestAndGQLRequestsWithoutNestedMutationFeatureFla { ""role"": ""anonymous"", ""actions"": [ - { - ""action"": ""create"" - }, { ""action"": ""read"" - }, - { - ""action"": ""update"" - }, - { - ""action"": ""delete"" } ] } @@ -1643,8 +1634,9 @@ public async Task SanityTestForRestAndGQLRequestsWithoutNestedMutationFeatureFla using (TestServer server = new(Program.CreateWebHostBuilder(args))) using (HttpClient client = server.CreateClient()) { - try{ - + try + { + // Perform a REST GET API request // 1. To validate that DAB engine deserialized the config without the nested mutation feature flag section correctly. // 2. To validate that REST GET requests are executed correctly. @@ -1676,9 +1668,9 @@ public async Task SanityTestForRestAndGQLRequestsWithoutNestedMutationFeatureFla string body = await graphQLResponse.Content.ReadAsStringAsync(); Assert.IsFalse(body.Contains("errors")); } - catch(Exception ex) + catch (Exception ex) { - Assert.Fail($"Unexpected exception : {ex}" ); + Assert.Fail($"Unexpected exception : {ex}"); } } } diff --git a/src/Service.Tests/Unittests/RuntimeConfigLoaderJsonDeserializerTests.cs b/src/Service.Tests/Unittests/RuntimeConfigLoaderJsonDeserializerTests.cs index 68e3c18f42..756ea8a568 100644 --- a/src/Service.Tests/Unittests/RuntimeConfigLoaderJsonDeserializerTests.cs +++ b/src/Service.Tests/Unittests/RuntimeConfigLoaderJsonDeserializerTests.cs @@ -313,7 +313,7 @@ public static string GetModifiedJsonString(string[] reps, string enumString) ""path"": """ + reps[++index % reps.Length] + @""", ""allow-introspection"": true, ""nested-mutations"": { - ""inserts"": { + ""create"": { ""enabled"": false } } From a78426cdb1bac52260c9eba742eb3c785227f529 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 1 Feb 2024 15:36:43 +0530 Subject: [PATCH 13/28] adds test summary, test category --- .../Configuration/ConfigurationTests.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Service.Tests/Configuration/ConfigurationTests.cs b/src/Service.Tests/Configuration/ConfigurationTests.cs index 38a98932d0..30947de37a 100644 --- a/src/Service.Tests/Configuration/ConfigurationTests.cs +++ b/src/Service.Tests/Configuration/ConfigurationTests.cs @@ -1580,9 +1580,22 @@ public async Task TestSPRestDefaultsForManuallyConstructedConfigs( } /// + /// Sanity check to validate that DAB engine works fine when used with a config file without the nested + /// mutations feature flag section. + /// The runtime graphql section of the config file used looks like this: + /// + /// "graphql": { + /// "path": "/graphql", + /// "allow-introspection": true + /// } + /// + /// Without the nested mutations feature flag section, DAB engine should be able to + /// 1. Successfully deserialize the config file. + /// 2. Process REST and GraphQL API requests. /// /// [TestMethod] + [TestCategory(TestCategory.MSSQL)] public async Task SanityTestForRestAndGQLRequestsWithoutNestedMutationFeatureFlagSection() { // Hard-coded json string for Book entity From 7eb21a178b72da9ac720d1e3d24e83d9aed5d282 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 6 Feb 2024 12:12:45 +0530 Subject: [PATCH 14/28] adds logic to not write out nested mutation open when null --- src/Cli/ConfigGenerator.cs | 18 +++++++++--------- .../GraphQLRuntimeOptionsConverterFactory.cs | 6 +++--- .../Converters/NestedCreateOptionsConverter.cs | 10 ++++++++-- .../NestedMutationOptionsConverter.cs | 12 +++++++++--- src/Config/ObjectModel/NestedInsertOptions.cs | 3 +++ .../ObjectModel/NestedMutationOptions.cs | 4 ++-- .../Caching/CachingConfigProcessingTests.cs | 7 +------ 7 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/Cli/ConfigGenerator.cs b/src/Cli/ConfigGenerator.cs index 406c2bd022..8c98b9c7b4 100644 --- a/src/Cli/ConfigGenerator.cs +++ b/src/Cli/ConfigGenerator.cs @@ -119,24 +119,24 @@ public static bool TryCreateRuntimeConfig(InitOptions options, FileSystemRuntime // Nested mutation operations are applicable only for MSSQL database. When the option --graphql.nested-create.enabled is specified for other database types, // a warning is logged. // When nested mutation operations are extended for other database types, this option should be honored. - // Issue #2001: https://github.com/Azure/data-api-builder/issues/2001 tracks the work for the same. + // Tracked by issue #2001: https://github.com/Azure/data-api-builder/issues/2001. if (dbType is not DatabaseType.MSSQL && options.NestedCreateOperationEnabled is not CliBool.None) { _logger.LogWarning($"The option --graphql.nested-create.enabled is not supported for {dbType.ToString()} database type and will not be honored."); } - if (dbType is not DatabaseType.MSSQL) - { - // Nested mutation operations are applicable only for MSSQL database. When the option --graphql.nested-create.enabled is specified for other database types, - // it is not honored. - isNestedCreateEnabledForGraphQL = false; - } - else + NestedMutationOptions? nestedMutationOptions = null; + + // Nested mutation operations are applicable only for MSSQL database. When the option --graphql.nested-create.enabled is specified for other database types, + // it is not honored. + if (dbType is DatabaseType.MSSQL && options.NestedCreateOperationEnabled is not CliBool.None) { if (!IsNestedCreateOperationEnabled(options.NestedCreateOperationEnabled, out isNestedCreateEnabledForGraphQL)) { return false; } + + nestedMutationOptions = new(nestedCreateOptions: new NestedCreateOptions(enabled: isNestedCreateEnabledForGraphQL)); } switch (dbType) @@ -258,7 +258,7 @@ public static bool TryCreateRuntimeConfig(InitOptions options, FileSystemRuntime DataSource: dataSource, Runtime: new( Rest: new(restEnabled, restPath ?? RestRuntimeOptions.DEFAULT_PATH, options.RestRequestBodyStrict is CliBool.False ? false : true), - GraphQL: new(Enabled: graphQLEnabled, Path: graphQLPath, NestedMutationOptions: new(new NestedCreateOptions(enabled: isNestedCreateEnabledForGraphQL))), + GraphQL: new(Enabled: graphQLEnabled, Path: graphQLPath, NestedMutationOptions: nestedMutationOptions), Host: new( Cors: new(options.CorsOrigin?.ToArray() ?? Array.Empty()), Authentication: new( diff --git a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs index 9e0e6382e5..60a30bb305 100644 --- a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs +++ b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs @@ -47,18 +47,18 @@ internal GraphQLRuntimeOptionsConverter(bool replaceEnvVar) { if (reader.TokenType == JsonTokenType.True || reader.TokenType == JsonTokenType.Null) { - return new GraphQLRuntimeOptions(NestedMutationOptions: new(nestedCreateOptions: new(enabled: false))); + return new GraphQLRuntimeOptions(); } if (reader.TokenType == JsonTokenType.False) { - return new GraphQLRuntimeOptions(Enabled: false, NestedMutationOptions: new(nestedCreateOptions: new(enabled: false))); + return new GraphQLRuntimeOptions(Enabled: false); } if (reader.TokenType == JsonTokenType.StartObject) { // Initialize with Nested Mutation operations disabled by default - GraphQLRuntimeOptions graphQLRuntimeOptions = new(NestedMutationOptions: new(nestedCreateOptions: new(enabled: false))); + GraphQLRuntimeOptions graphQLRuntimeOptions = new(); NestedMutationOptionsConverter nestedMutationOptionsConverter = options.GetConverter(typeof(NestedMutationOptions)) as NestedMutationOptionsConverter ?? throw new JsonException("Failed to get nested mutation options converter"); diff --git a/src/Config/Converters/NestedCreateOptionsConverter.cs b/src/Config/Converters/NestedCreateOptionsConverter.cs index 33611a38d6..51e8c139f6 100644 --- a/src/Config/Converters/NestedCreateOptionsConverter.cs +++ b/src/Config/Converters/NestedCreateOptionsConverter.cs @@ -17,7 +17,7 @@ internal class NestedCreateOptionsConverter : JsonConverter { if (reader.TokenType is JsonTokenType.StartObject) { - NestedCreateOptions? nestedCreateOptions = new(enabled: false); + NestedCreateOptions? nestedCreateOptions = null; while (reader.Read()) { if (reader.TokenType == JsonTokenType.EndObject) @@ -49,8 +49,14 @@ internal class NestedCreateOptionsConverter : JsonConverter } /// - public override void Write(Utf8JsonWriter writer, NestedCreateOptions value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, NestedCreateOptions? value, JsonSerializerOptions options) { + // If the value is null, it is not written to the config file. + if(value is null) + { + return; + } + writer.WritePropertyName("create"); writer.WriteStartObject(); diff --git a/src/Config/Converters/NestedMutationOptionsConverter.cs b/src/Config/Converters/NestedMutationOptionsConverter.cs index 45c67c0119..263fdbaf1b 100644 --- a/src/Config/Converters/NestedMutationOptionsConverter.cs +++ b/src/Config/Converters/NestedMutationOptionsConverter.cs @@ -26,12 +26,12 @@ public NestedMutationOptionsConverter(JsonSerializerOptions options) { if (reader.TokenType == JsonTokenType.Null) { - return new NestedMutationOptions(new(enabled: false)); + return null; } if (reader.TokenType is JsonTokenType.StartObject) { - NestedMutationOptions? nestedMutationOptions = new(new(enabled: false)); + NestedMutationOptions? nestedMutationOptions = null; while (reader.Read()) { @@ -60,8 +60,14 @@ public NestedMutationOptionsConverter(JsonSerializerOptions options) } /// - public override void Write(Utf8JsonWriter writer, NestedMutationOptions value, JsonSerializerOptions options) + public override void Write(Utf8JsonWriter writer, NestedMutationOptions? value, JsonSerializerOptions options) { + // If the nested mutation options is null, it is not written to the config file. + if(value is null) + { + return; + } + writer.WritePropertyName("nested-mutations"); writer.WriteStartObject(); diff --git a/src/Config/ObjectModel/NestedInsertOptions.cs b/src/Config/ObjectModel/NestedInsertOptions.cs index 7d0f57650f..8439646766 100644 --- a/src/Config/ObjectModel/NestedInsertOptions.cs +++ b/src/Config/ObjectModel/NestedInsertOptions.cs @@ -8,6 +8,9 @@ namespace Azure.DataApiBuilder.Config.ObjectModel; /// Indicates whether nested create operation is enabled. public class NestedCreateOptions { + /// + /// Indicates whether nested create operation is enabled. + /// public bool Enabled; public NestedCreateOptions(bool enabled) diff --git a/src/Config/ObjectModel/NestedMutationOptions.cs b/src/Config/ObjectModel/NestedMutationOptions.cs index aaddf47033..a5698786d4 100644 --- a/src/Config/ObjectModel/NestedMutationOptions.cs +++ b/src/Config/ObjectModel/NestedMutationOptions.cs @@ -7,14 +7,14 @@ namespace Azure.DataApiBuilder.Config.ObjectModel; /// /// Class that holds the options for all nested mutation operations. /// -/// +/// Options for nested create operation. public class NestedMutationOptions { // Options for nested create operation. [JsonPropertyName("insert")] public NestedCreateOptions? NestedCreateOptions; - public NestedMutationOptions(NestedCreateOptions? nestedCreateOptions) + public NestedMutationOptions(NestedCreateOptions? nestedCreateOptions = null) { NestedCreateOptions = nestedCreateOptions; } diff --git a/src/Service.Tests/Caching/CachingConfigProcessingTests.cs b/src/Service.Tests/Caching/CachingConfigProcessingTests.cs index 0571eaed5a..98f7c2d75f 100644 --- a/src/Service.Tests/Caching/CachingConfigProcessingTests.cs +++ b/src/Service.Tests/Caching/CachingConfigProcessingTests.cs @@ -416,12 +416,7 @@ private static string GetRawConfigJson(string globalCacheConfig, string entityCa ""graphql"": { ""enabled"": true, ""path"": ""/An_"", - ""allow-introspection"": true, - ""nested-mutations"": { - ""create"": { - ""enabled"": false - } - } + ""allow-introspection"": true }, ""host"": { ""cors"": { From c4898cc407b6f2a3aad6fd85d55d0a6e1b1317ea Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 6 Feb 2024 13:45:48 +0530 Subject: [PATCH 15/28] updates tests --- src/Cli.Tests/ConfigGeneratorTests.cs | 7 +- src/Cli.Tests/EndToEndTests.cs | 74 +++++++++---------- src/Cli.Tests/InitTests.cs | 10 +-- ...stingNameButWithDifferentCase.verified.txt | 7 +- ...ldProperties_70de36ebf1478d0d.verified.txt | 7 +- ...ldProperties_9f612e68879149a3.verified.txt | 7 +- ...ldProperties_bea2d26f3e5462d8.verified.txt | 7 +- ...AddNewEntityWhenEntitiesEmpty.verified.txt | 7 +- ...NewEntityWhenEntitiesNotEmpty.verified.txt | 7 +- ...esWithSourceAsStoredProcedure.verified.txt | 7 +- ...aphQLOptions_0c9cbb8942b4a4e5.verified.txt | 7 +- ...aphQLOptions_286d268a654ece27.verified.txt | 7 +- ...aphQLOptions_3048323e01b42681.verified.txt | 7 +- ...aphQLOptions_3440d150a2282b9c.verified.txt | 7 +- ...aphQLOptions_381c28d25063be0c.verified.txt | 7 +- ...aphQLOptions_458373311f6ed4ed.verified.txt | 7 +- ...aphQLOptions_66799c963a6306ae.verified.txt | 7 +- ...aphQLOptions_66f598295b8682fd.verified.txt | 7 +- ...aphQLOptions_73f95f7e2cd3ed71.verified.txt | 7 +- ...aphQLOptions_79d59edde7f6a272.verified.txt | 7 +- ...aphQLOptions_7ec82512a1df5293.verified.txt | 7 +- ...aphQLOptions_cbb6e5548e4d3535.verified.txt | 7 +- ...aphQLOptions_dc629052f38cea32.verified.txt | 7 +- ...aphQLOptions_e4a97c7e3507d2c6.verified.txt | 7 +- ...aphQLOptions_f8d0d0c2a38bd3b8.verified.txt | 7 +- ...stMethodsAndGraphQLOperations.verified.txt | 7 +- ...stMethodsAndGraphQLOperations.verified.txt | 7 +- ...tyWithSourceAsStoredProcedure.verified.txt | 7 +- ...tityWithSourceWithDefaultType.verified.txt | 7 +- ...dingEntityWithoutIEnumerables.verified.txt | 7 +- ...ests.TestInitForCosmosDBNoSql.verified.txt | 7 +- ...toredProcedureWithRestMethods.verified.txt | 7 +- ...stMethodsAndGraphQLOperations.verified.txt | 7 +- ...itTests.CosmosDbNoSqlDatabase.verified.txt | 7 +- ...ts.CosmosDbPostgreSqlDatabase.verified.txt | 7 +- ...ionProviders_171ea8114ff71814.verified.txt | 7 +- ...ionProviders_2df7a1794712f154.verified.txt | 7 +- ...ionProviders_59fe1a10aa78899d.verified.txt | 7 +- ...ionProviders_b95b637ea87f16a7.verified.txt | 7 +- ...tStartingSlashWillHaveItAdded.verified.txt | 7 +- .../InitTests.MsSQLDatabase.verified.txt | 7 +- ...tStartingSlashWillHaveItAdded.verified.txt | 7 +- ...ConfigWithoutConnectionString.verified.txt | 7 +- ...lCharactersInConnectionString.verified.txt | 7 +- ...tionOptions_09cf40a5c545de68.verified.txt} | 7 +- ...tionOptions_1211ad099a77f7c4.verified.txt} | 7 +- ...tionOptions_17721ef496526b3e.verified.txt} | 0 ...tionOptions_181195e2fbe991a8.verified.txt} | 7 +- ...tionOptions_1a73d3cfd329f922.verified.txt} | 7 +- ...tionOptions_215291b2b7ff2cb4.verified.txt} | 7 +- ...tionOptions_2be9ac1b7d981cde.verified.txt} | 7 +- ...tionOptions_384e318d9ed21c9c.verified.txt} | 7 +- ...tionOptions_388c095980b1b53f.verified.txt} | 7 +- ...tionOptions_6fb51a691160163b.verified.txt} | 7 +- ...tionOptions_7c4d5358dc16f63f.verified.txt} | 7 +- ...tionOptions_8459925dada37738.verified.txt} | 7 +- ...tionOptions_92ba6ec2f08a3060.verified.txt} | 7 +- ...tionOptions_9efd9a8a0ff47434.verified.txt} | 7 +- ...tionOptions_adc642ef89cb6d18.verified.txt} | 0 ...tionOptions_c0ee0e6a86fa0b7e.verified.txt} | 7 +- ...tionOptions_d1e814ccd5d8b8e8.verified.txt} | 7 +- ...ationOptions_ef2f00a9e204e114.verified.txt | 30 ++++++++ ...SourceObject_036a859f50ce167c.verified.txt | 7 +- ...SourceObject_103655d39b48d89f.verified.txt | 7 +- ...SourceObject_442649c7ef2176bd.verified.txt | 7 +- ...SourceObject_7f2338fdc84aafc3.verified.txt | 7 +- ...SourceObject_a70c086a74142c82.verified.txt | 7 +- ...SourceObject_c26902b0e44f97cd.verified.txt | 7 +- ...EntityByAddingNewRelationship.verified.txt | 7 +- ...EntityByModifyingRelationship.verified.txt | 7 +- ...ts.TestUpdateEntityPermission.verified.txt | 7 +- ...tityPermissionByAddingNewRole.verified.txt | 7 +- ...ermissionHavingWildcardAction.verified.txt | 7 +- ...yPermissionWithExistingAction.verified.txt | 7 +- ...yPermissionWithWildcardAction.verified.txt | 7 +- ....TestUpdateEntityWithMappings.verified.txt | 7 +- ...ldProperties_088d6237033e0a7c.verified.txt | 7 +- ...ldProperties_3ea32fdef7aed1b4.verified.txt | 7 +- ...ldProperties_4d25c2c012107597.verified.txt | 7 +- ...ithSpecialCharacterInMappings.verified.txt | 7 +- ...ts.TestUpdateExistingMappings.verified.txt | 7 +- ...eEntityTests.TestUpdatePolicy.verified.txt | 7 +- ...edProcedures_10ea92e3b25ab0c9.verified.txt | 7 +- ...edProcedures_127bb81593f835fe.verified.txt | 7 +- ...edProcedures_386efa1a113fac6b.verified.txt | 7 +- ...edProcedures_53db4712d83be8e6.verified.txt | 7 +- ...edProcedures_5e9ddd8c7c740efd.verified.txt | 7 +- ...edProcedures_6c5b3bfc72e5878a.verified.txt | 7 +- ...edProcedures_8398059a743d7027.verified.txt | 7 +- ...edProcedures_a49380ce6d1fd8ba.verified.txt | 7 +- ...edProcedures_c9b12fe27be53878.verified.txt | 7 +- ...edProcedures_d19603117eb8b51b.verified.txt | 7 +- ...edProcedures_d770d682c5802737.verified.txt | 7 +- ...edProcedures_ef8cc721c9dfc7e4.verified.txt | 7 +- ...edProcedures_f3897e2254996db0.verified.txt | 7 +- ...edProcedures_f4cadb897fc5b0fe.verified.txt | 7 +- ...edProcedures_f59b2a65fc1e18a3.verified.txt | 7 +- ...SourceObject_574e1995f787740f.verified.txt | 7 +- ...SourceObject_a13a9ca73b21f261.verified.txt | 7 +- ...SourceObject_a5ce76c8bea25cc8.verified.txt | 7 +- ...SourceObject_bba111332a1f973f.verified.txt | 7 +- ...UpdateDatabaseSourceKeyFields.verified.txt | 7 +- ...ests.UpdateDatabaseSourceName.verified.txt | 7 +- ...pdateDatabaseSourceParameters.verified.txt | 7 +- .../NestedCreateOptionsConverter.cs | 2 +- .../NestedMutationOptionsConverter.cs | 2 +- 106 files changed, 173 insertions(+), 638 deletions(-) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ccc197d5c7f17780.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_09cf40a5c545de68.verified.txt} (81%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b70fba8f0fbe5327.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_1211ad099a77f7c4.verified.txt} (80%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_430e98b7b6c534ac.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_17721ef496526b3e.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_27460cc9fbf8650b.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_181195e2fbe991a8.verified.txt} (81%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_006393390a22abfb.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_1a73d3cfd329f922.verified.txt} (77%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef00caa21de52a86.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_215291b2b7ff2cb4.verified.txt} (77%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6b62611a0ec627c5.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_2be9ac1b7d981cde.verified.txt} (80%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0e28ff568df4ed15.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_384e318d9ed21c9c.verified.txt} (77%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6c2edccea07d2ce2.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_388c095980b1b53f.verified.txt} (81%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ce73834769c5b7be.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6fb51a691160163b.verified.txt} (77%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_703634cf0548aabb.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_7c4d5358dc16f63f.verified.txt} (77%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d13d241b5273a6bb.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_8459925dada37738.verified.txt} (78%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0fd9cba82534c237.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_92ba6ec2f08a3060.verified.txt} (80%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_133f003acce05eae.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_9efd9a8a0ff47434.verified.txt} (80%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_7fe3b7f45757ca5f.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_adc642ef89cb6d18.verified.txt} (100%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_a4d884205a16e6eb.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0ee0e6a86fa0b7e.verified.txt} (77%) rename src/Cli.Tests/Snapshots/{InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_afe08f9d8663606a.verified.txt => InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d1e814ccd5d8b8e8.verified.txt} (78%) create mode 100644 src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef2f00a9e204e114.verified.txt diff --git a/src/Cli.Tests/ConfigGeneratorTests.cs b/src/Cli.Tests/ConfigGeneratorTests.cs index 0056953336..6094189f93 100644 --- a/src/Cli.Tests/ConfigGeneratorTests.cs +++ b/src/Cli.Tests/ConfigGeneratorTests.cs @@ -161,12 +161,7 @@ public void TestSpecialCharactersInConnectionString() ""graphql"": { ""enabled"": true, ""path"": ""/An_"", - ""allow-introspection"": true, - ""nested-mutations"": { - ""create"": { - ""enabled"": false - } - } + ""allow-introspection"": true }, ""host"": { ""cors"": { diff --git a/src/Cli.Tests/EndToEndTests.cs b/src/Cli.Tests/EndToEndTests.cs index c93591adff..559051358b 100644 --- a/src/Cli.Tests/EndToEndTests.cs +++ b/src/Cli.Tests/EndToEndTests.cs @@ -131,43 +131,43 @@ public void TestInitializingRestAndGraphQLGlobalSettings() Assert.IsTrue(runtimeConfig.Runtime.GraphQL?.Enabled); } - /// - /// Test to validate the successful generation of config file with the --graphql.nested-create.enabled option of the init command. - /// - /// Value for the nested create enabled flag in the init command. - /// Expected value for the nested create enabled flag in the config file. - [DataTestMethod] - [DataRow(CliBool.True, true, DisplayName = "Nested Create operation is enabled the config file by specifying '--graphql.nested-create.enabled true'")] - [DataRow(CliBool.False, false, DisplayName = "Nested Create operation is disabled the config file by specifying '--graphql.nested-create.enabled false'")] - [DataRow(null, false, DisplayName = " '--graphql.nested-create' option is not used in the init command. When not enabled explicitly, the nested create operation will be disabled.")] - public void TestEnablingNestedCreateOperation(CliBool? isNestedCreateEnabled, bool expectedValueForNestedCreateEnabledFlag) - { - List args = new() { "init", "-c", TEST_RUNTIME_CONFIG_FILE, "--connection-string", SAMPLE_TEST_CONN_STRING, "--database-type", "mssql" }; - - if (isNestedCreateEnabled is not null) - { - args.Add("--graphql.nested-create.enabled"); - args.Add(isNestedCreateEnabled.ToString()!); - } - - Program.Execute(args.ToArray(), _cliLogger!, _fileSystem!, _runtimeConfigLoader!); - - Assert.IsTrue(_runtimeConfigLoader!.TryLoadConfig( - TEST_RUNTIME_CONFIG_FILE, - out RuntimeConfig? runtimeConfig, - replaceEnvVar: true)); - - SqlConnectionStringBuilder builder = new(runtimeConfig.DataSource.ConnectionString); - Assert.AreEqual(ProductInfo.GetDataApiBuilderApplicationName(), builder.ApplicationName); - - Assert.IsNotNull(runtimeConfig); - Assert.AreEqual(DatabaseType.MSSQL, runtimeConfig.DataSource.DatabaseType); - Assert.IsNotNull(runtimeConfig.Runtime); - Assert.IsNotNull(runtimeConfig.Runtime.GraphQL); - Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions); - Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedCreateOptions); - Assert.AreEqual(expectedValueForNestedCreateEnabledFlag, runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedCreateOptions.Enabled); - } + /* /// + /// Test to validate the successful generation of config file with the --graphql.nested-create.enabled option of the init command. + /// + /// Value for the nested create enabled flag in the init command. + /// Expected value for the nested create enabled flag in the config file. + [DataTestMethod] + [DataRow(CliBool.True, "mssql", true, DisplayName = "Nested Create operation enabled for MsSql database type: '--graphql.nested-create.enabled true'")] + [DataRow(CliBool.False, "mssql", false, DisplayName = "Nested Create operation is disabled the config file by specifying '--graphql.nested-create.enabled false'")] + [DataRow(CliBool.None, "mssql", false, DisplayName = " '--graphql.nested-create' option is not used in the init command. When not enabled explicitly, the nested create operation will be disabled.")] + public void TestEnablingNestedCreateOperation(CliBool isNestedCreateEnabled, string dbType, bool expectedValueForNestedCreateEnabledFlag) + { + List args = new() { "init", "-c", TEST_RUNTIME_CONFIG_FILE, "--connection-string", SAMPLE_TEST_CONN_STRING, "--database-type", "mssql" }; + + if (isNestedCreateEnabled is not CliBool.None) + { + args.Add("--graphql.nested-create.enabled"); + args.Add(isNestedCreateEnabled.ToString()!); + } + + Program.Execute(args.ToArray(), _cliLogger!, _fileSystem!, _runtimeConfigLoader!); + + Assert.IsTrue(_runtimeConfigLoader!.TryLoadConfig( + TEST_RUNTIME_CONFIG_FILE, + out RuntimeConfig? runtimeConfig, + replaceEnvVar: true)); + + SqlConnectionStringBuilder builder = new(runtimeConfig.DataSource.ConnectionString); + Assert.AreEqual(ProductInfo.GetDataApiBuilderApplicationName(), builder.ApplicationName); + + Assert.IsNotNull(runtimeConfig); + Assert.AreEqual(DatabaseType.MSSQL, runtimeConfig.DataSource.DatabaseType); + Assert.IsNotNull(runtimeConfig.Runtime); + Assert.IsNotNull(runtimeConfig.Runtime.GraphQL); + Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions); + Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedCreateOptions); + Assert.AreEqual(expectedValueForNestedCreateEnabledFlag, runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedCreateOptions.Enabled); + }*/ /// /// Test to verify adding a new Entity. diff --git a/src/Cli.Tests/InitTests.cs b/src/Cli.Tests/InitTests.cs index adac0090d7..de5b07cd58 100644 --- a/src/Cli.Tests/InitTests.cs +++ b/src/Cli.Tests/InitTests.cs @@ -431,17 +431,17 @@ public Task GraphQLPathWithoutStartingSlashWillHaveItAdded() [DataRow(DatabaseType.DWSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-create.enabled true' for DWSQL database type")] [DataRow(DatabaseType.DWSQL, CliBool.False, DisplayName = "Init command with '--graphql.nested-create.enabled false' for DWSQL database type")] [DataRow(DatabaseType.DWSQL, CliBool.None, DisplayName = "Init command without '--graphql.nested-create.enabled' option for DWSQL database type")] - public Task VerifyCorrectConfigGenerationWithNestedMutationOptions(DatabaseType databaseTye, CliBool isNestedCreateEnabled) + public Task VerifyCorrectConfigGenerationWithNestedMutationOptions(DatabaseType databaseType, CliBool isNestedCreateEnabled) { InitOptions options; - if (databaseTye is DatabaseType.CosmosDB_NoSQL) + if (databaseType is DatabaseType.CosmosDB_NoSQL) { // A scheme file is added since its mandatory for CosmosDB_NoSQL ((MockFileSystem)_fileSystem!).AddFile(TEST_SCHEMA_FILE, new MockFileData("")); options = new( - databaseType: databaseTye, + databaseType: databaseType, connectionString: "testconnectionstring", cosmosNoSqlDatabase: "testdb", cosmosNoSqlContainer: "testcontainer", @@ -457,7 +457,7 @@ public Task VerifyCorrectConfigGenerationWithNestedMutationOptions(DatabaseType else { options = new( - databaseType: databaseTye, + databaseType: databaseType, connectionString: "testconnectionstring", cosmosNoSqlDatabase: null, cosmosNoSqlContainer: null, @@ -472,7 +472,7 @@ public Task VerifyCorrectConfigGenerationWithNestedMutationOptions(DatabaseType } VerifySettings verifySettings = new(); - verifySettings.UseHashedParameters(databaseTye, isNestedCreateEnabled); + verifySettings.UseHashedParameters(databaseType, isNestedCreateEnabled); return ExecuteVerifyTest(options, verifySettings); } diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithAnExistingNameButWithDifferentCase.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithAnExistingNameButWithDifferentCase.verified.txt index 8986c8338b..44fbbaa18b 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithAnExistingNameButWithDifferentCase.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithAnExistingNameButWithDifferentCase.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_70de36ebf1478d0d.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_70de36ebf1478d0d.verified.txt index 0482c1fa7e..7c701037fd 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_70de36ebf1478d0d.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_70de36ebf1478d0d.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_9f612e68879149a3.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_9f612e68879149a3.verified.txt index 17344eb3dd..cec0a3d8ab 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_9f612e68879149a3.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_9f612e68879149a3.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_bea2d26f3e5462d8.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_bea2d26f3e5462d8.verified.txt index 887a57eadd..c318861497 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_bea2d26f3e5462d8.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddEntityWithPolicyAndFieldProperties_bea2d26f3e5462d8.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesEmpty.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesEmpty.verified.txt index 8e4abd2be4..8d8f226805 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesEmpty.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesEmpty.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesNotEmpty.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesNotEmpty.verified.txt index e325efe050..4e3184736d 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesNotEmpty.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesNotEmpty.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesWithSourceAsStoredProcedure.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesWithSourceAsStoredProcedure.verified.txt index 91c7acf0eb..17e8de5193 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesWithSourceAsStoredProcedure.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.AddNewEntityWhenEntitiesWithSourceAsStoredProcedure.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_0c9cbb8942b4a4e5.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_0c9cbb8942b4a4e5.verified.txt index dcaf587172..c7cb996d03 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_0c9cbb8942b4a4e5.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_0c9cbb8942b4a4e5.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_286d268a654ece27.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_286d268a654ece27.verified.txt index 59c18000b0..13beb6bc7c 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_286d268a654ece27.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_286d268a654ece27.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3048323e01b42681.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3048323e01b42681.verified.txt index 796105e568..bdd7c8f7a0 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3048323e01b42681.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3048323e01b42681.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3440d150a2282b9c.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3440d150a2282b9c.verified.txt index fb7f8fd745..20d7bcd624 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3440d150a2282b9c.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_3440d150a2282b9c.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_381c28d25063be0c.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_381c28d25063be0c.verified.txt index 59c18000b0..13beb6bc7c 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_381c28d25063be0c.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_381c28d25063be0c.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_458373311f6ed4ed.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_458373311f6ed4ed.verified.txt index 04644e8e0a..b87e804456 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_458373311f6ed4ed.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_458373311f6ed4ed.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66799c963a6306ae.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66799c963a6306ae.verified.txt index 79d2940a0f..18c5f966c5 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66799c963a6306ae.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66799c963a6306ae.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66f598295b8682fd.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66f598295b8682fd.verified.txt index b3c39a3354..1cd138d10f 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66f598295b8682fd.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_66f598295b8682fd.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_73f95f7e2cd3ed71.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_73f95f7e2cd3ed71.verified.txt index dcaf587172..c7cb996d03 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_73f95f7e2cd3ed71.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_73f95f7e2cd3ed71.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_79d59edde7f6a272.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_79d59edde7f6a272.verified.txt index 04644e8e0a..b87e804456 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_79d59edde7f6a272.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_79d59edde7f6a272.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_7ec82512a1df5293.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_7ec82512a1df5293.verified.txt index dcaf587172..c7cb996d03 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_7ec82512a1df5293.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_7ec82512a1df5293.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_cbb6e5548e4d3535.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_cbb6e5548e4d3535.verified.txt index dcaf587172..c7cb996d03 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_cbb6e5548e4d3535.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_cbb6e5548e4d3535.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_dc629052f38cea32.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_dc629052f38cea32.verified.txt index 2e7c289550..612a65c14a 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_dc629052f38cea32.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_dc629052f38cea32.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_e4a97c7e3507d2c6.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_e4a97c7e3507d2c6.verified.txt index 9e86b78ae5..87b7a7697c 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_e4a97c7e3507d2c6.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_e4a97c7e3507d2c6.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_f8d0d0c2a38bd3b8.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_f8d0d0c2a38bd3b8.verified.txt index b3c39a3354..1cd138d10f 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_f8d0d0c2a38bd3b8.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddNewSpWithDifferentRestAndGraphQLOptions_f8d0d0c2a38bd3b8.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt index 69ea1a57ee..9aca5ba640 100644 --- a/src/Cli.Tests/Snapshots/AddEntityTests.TestAddStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt +++ b/src/Cli.Tests/Snapshots/AddEntityTests.TestAddStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt index 8f1d291a7e..afe0ce1492 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt index dfc69e67ff..a0b925bb98 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt index 402bd5d689..abb8337b09 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt index e04b023cb0..8be1c1b798 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt index 7067ee6c7c..5936c8d178 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt @@ -21,12 +21,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt index e4b1569adf..0e47344173 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt b/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt index fbe53a416e..e17f584185 100644 --- a/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt +++ b/src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt b/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt index fb495e4173..9d3b2f032e 100644 --- a/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt @@ -21,12 +21,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt b/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt index a21edcc430..ca3b61588b 100644 --- a/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.CosmosDbPostgreSqlDatabase.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt index d817f87ce9..ae4661a514 100644 --- a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt index 8eb7d578da..be42e49181 100644 --- a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt index 2d8beed8fd..64ff9bb7f4 100644 --- a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_59fe1a10aa78899d.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt index 6359191974..426212619d 100644 --- a/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_b95b637ea87f16a7.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt b/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt index a1f1896e4a..e059818092 100644 --- a/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.GraphQLPathWithoutStartingSlashWillHaveItAdded.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /abc, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt b/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt index 8d8fa23fcf..71f3c51816 100644 --- a/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.MsSQLDatabase.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt b/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt index 2ebda06748..be05f603ed 100644 --- a/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.RestPathWithoutStartingSlashWillHaveItAdded.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt b/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt index 397882b07c..d746cb30a4 100644 --- a/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.TestInitializingConfigWithoutConnectionString.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt b/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt index 2d8beed8fd..64ff9bb7f4 100644 --- a/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.TestSpecialCharactersInConnectionString.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ccc197d5c7f17780.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_09cf40a5c545de68.verified.txt similarity index 81% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ccc197d5c7f17780.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_09cf40a5c545de68.verified.txt index 8baee75774..29f7eee2e7 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ccc197d5c7f17780.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_09cf40a5c545de68.verified.txt @@ -21,12 +21,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b70fba8f0fbe5327.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_1211ad099a77f7c4.verified.txt similarity index 80% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b70fba8f0fbe5327.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_1211ad099a77f7c4.verified.txt index 8d8fa23fcf..71f3c51816 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_b70fba8f0fbe5327.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_1211ad099a77f7c4.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_430e98b7b6c534ac.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_17721ef496526b3e.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_430e98b7b6c534ac.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_17721ef496526b3e.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_27460cc9fbf8650b.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_181195e2fbe991a8.verified.txt similarity index 81% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_27460cc9fbf8650b.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_181195e2fbe991a8.verified.txt index 8baee75774..29f7eee2e7 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_27460cc9fbf8650b.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_181195e2fbe991a8.verified.txt @@ -21,12 +21,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_006393390a22abfb.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_1a73d3cfd329f922.verified.txt similarity index 77% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_006393390a22abfb.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_1a73d3cfd329f922.verified.txt index 026cc88661..a43e68277c 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_006393390a22abfb.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_1a73d3cfd329f922.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef00caa21de52a86.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_215291b2b7ff2cb4.verified.txt similarity index 77% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef00caa21de52a86.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_215291b2b7ff2cb4.verified.txt index 55823bfbe0..3285438ab7 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef00caa21de52a86.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_215291b2b7ff2cb4.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6b62611a0ec627c5.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_2be9ac1b7d981cde.verified.txt similarity index 80% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6b62611a0ec627c5.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_2be9ac1b7d981cde.verified.txt index 19267264a5..043743d266 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6b62611a0ec627c5.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_2be9ac1b7d981cde.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0e28ff568df4ed15.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_384e318d9ed21c9c.verified.txt similarity index 77% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0e28ff568df4ed15.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_384e318d9ed21c9c.verified.txt index 026cc88661..a43e68277c 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0e28ff568df4ed15.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_384e318d9ed21c9c.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6c2edccea07d2ce2.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_388c095980b1b53f.verified.txt similarity index 81% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6c2edccea07d2ce2.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_388c095980b1b53f.verified.txt index 8baee75774..29f7eee2e7 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6c2edccea07d2ce2.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_388c095980b1b53f.verified.txt @@ -21,12 +21,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ce73834769c5b7be.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6fb51a691160163b.verified.txt similarity index 77% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ce73834769c5b7be.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6fb51a691160163b.verified.txt index 026cc88661..a43e68277c 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ce73834769c5b7be.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_6fb51a691160163b.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_703634cf0548aabb.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_7c4d5358dc16f63f.verified.txt similarity index 77% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_703634cf0548aabb.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_7c4d5358dc16f63f.verified.txt index 55823bfbe0..3285438ab7 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_703634cf0548aabb.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_7c4d5358dc16f63f.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d13d241b5273a6bb.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_8459925dada37738.verified.txt similarity index 78% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d13d241b5273a6bb.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_8459925dada37738.verified.txt index 794686467c..673c21dae4 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d13d241b5273a6bb.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_8459925dada37738.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0fd9cba82534c237.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_92ba6ec2f08a3060.verified.txt similarity index 80% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0fd9cba82534c237.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_92ba6ec2f08a3060.verified.txt index 19267264a5..043743d266 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_0fd9cba82534c237.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_92ba6ec2f08a3060.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_133f003acce05eae.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_9efd9a8a0ff47434.verified.txt similarity index 80% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_133f003acce05eae.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_9efd9a8a0ff47434.verified.txt index 19267264a5..043743d266 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_133f003acce05eae.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_9efd9a8a0ff47434.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_7fe3b7f45757ca5f.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_adc642ef89cb6d18.verified.txt similarity index 100% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_7fe3b7f45757ca5f.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_adc642ef89cb6d18.verified.txt diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_a4d884205a16e6eb.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0ee0e6a86fa0b7e.verified.txt similarity index 77% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_a4d884205a16e6eb.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0ee0e6a86fa0b7e.verified.txt index 55823bfbe0..3285438ab7 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_a4d884205a16e6eb.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_c0ee0e6a86fa0b7e.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_afe08f9d8663606a.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d1e814ccd5d8b8e8.verified.txt similarity index 78% rename from src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_afe08f9d8663606a.verified.txt rename to src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d1e814ccd5d8b8e8.verified.txt index 794686467c..673c21dae4 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_afe08f9d8663606a.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_d1e814ccd5d8b8e8.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef2f00a9e204e114.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef2f00a9e204e114.verified.txt new file mode 100644 index 0000000000..673c21dae4 --- /dev/null +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_ef2f00a9e204e114.verified.txt @@ -0,0 +1,30 @@ +{ + DataSource: { + DatabaseType: CosmosDB_PostgreSQL + }, + Runtime: { + Rest: { + Enabled: true, + Path: /rest-api, + RequestBodyStrict: true + }, + GraphQL: { + Enabled: true, + Path: /graphql, + AllowIntrospection: true + }, + Host: { + Cors: { + Origins: [ + http://localhost:3000, + http://nolocalhost:80 + ], + AllowCredentials: false + }, + Authentication: { + Provider: StaticWebApps + } + } + }, + Entities: [] +} \ No newline at end of file diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_036a859f50ce167c.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_036a859f50ce167c.verified.txt index 6e7d7cf324..a78465898d 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_036a859f50ce167c.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_036a859f50ce167c.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_103655d39b48d89f.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_103655d39b48d89f.verified.txt index 6b14e1e295..d3ed32cf42 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_103655d39b48d89f.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_103655d39b48d89f.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_442649c7ef2176bd.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_442649c7ef2176bd.verified.txt index 6e7d7cf324..a78465898d 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_442649c7ef2176bd.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_442649c7ef2176bd.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_7f2338fdc84aafc3.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_7f2338fdc84aafc3.verified.txt index 1c3247fb7a..b6b9269e87 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_7f2338fdc84aafc3.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_7f2338fdc84aafc3.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_a70c086a74142c82.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_a70c086a74142c82.verified.txt index 91c7acf0eb..17e8de5193 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_a70c086a74142c82.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_a70c086a74142c82.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_c26902b0e44f97cd.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_c26902b0e44f97cd.verified.txt index 79d0ec36b3..2b4a7b8518 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_c26902b0e44f97cd.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestConversionOfSourceObject_c26902b0e44f97cd.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByAddingNewRelationship.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByAddingNewRelationship.verified.txt index 39660eb2b3..2789572051 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByAddingNewRelationship.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByAddingNewRelationship.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByModifyingRelationship.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByModifyingRelationship.verified.txt index f2751a0894..092dec7745 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByModifyingRelationship.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityByModifyingRelationship.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermission.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermission.verified.txt index 68298b3179..1a77d65bcd 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermission.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermission.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionByAddingNewRole.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionByAddingNewRole.verified.txt index ee8e61131f..6775db8dde 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionByAddingNewRole.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionByAddingNewRole.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionHavingWildcardAction.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionHavingWildcardAction.verified.txt index fc09a05703..64517082ad 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionHavingWildcardAction.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionHavingWildcardAction.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithExistingAction.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithExistingAction.verified.txt index 6485bb2dd7..52dc99399e 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithExistingAction.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithExistingAction.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithWildcardAction.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithWildcardAction.verified.txt index 902e86d4ff..92b5917b92 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithWildcardAction.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityPermissionWithWildcardAction.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithMappings.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithMappings.verified.txt index f7b0536eb3..63ba7e2898 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithMappings.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithMappings.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_088d6237033e0a7c.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_088d6237033e0a7c.verified.txt index 0482c1fa7e..7c701037fd 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_088d6237033e0a7c.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_088d6237033e0a7c.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_3ea32fdef7aed1b4.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_3ea32fdef7aed1b4.verified.txt index 887a57eadd..c318861497 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_3ea32fdef7aed1b4.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_3ea32fdef7aed1b4.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_4d25c2c012107597.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_4d25c2c012107597.verified.txt index 5c283d076c..cdf30a00c9 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_4d25c2c012107597.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithPolicyAndFieldProperties_4d25c2c012107597.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithSpecialCharacterInMappings.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithSpecialCharacterInMappings.verified.txt index 24d5d77bac..8dcadec7b1 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithSpecialCharacterInMappings.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateEntityWithSpecialCharacterInMappings.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateExistingMappings.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateExistingMappings.verified.txt index b60e3f079a..13e994a5cc 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateExistingMappings.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateExistingMappings.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdatePolicy.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdatePolicy.verified.txt index 0d8c22933c..c8002a2fbc 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdatePolicy.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdatePolicy.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_10ea92e3b25ab0c9.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_10ea92e3b25ab0c9.verified.txt index 04644e8e0a..b87e804456 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_10ea92e3b25ab0c9.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_10ea92e3b25ab0c9.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_127bb81593f835fe.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_127bb81593f835fe.verified.txt index b3c39a3354..1cd138d10f 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_127bb81593f835fe.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_127bb81593f835fe.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_386efa1a113fac6b.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_386efa1a113fac6b.verified.txt index dcaf587172..c7cb996d03 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_386efa1a113fac6b.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_386efa1a113fac6b.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_53db4712d83be8e6.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_53db4712d83be8e6.verified.txt index fb7f8fd745..20d7bcd624 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_53db4712d83be8e6.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_53db4712d83be8e6.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_5e9ddd8c7c740efd.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_5e9ddd8c7c740efd.verified.txt index 59c18000b0..13beb6bc7c 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_5e9ddd8c7c740efd.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_5e9ddd8c7c740efd.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_6c5b3bfc72e5878a.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_6c5b3bfc72e5878a.verified.txt index dcaf587172..c7cb996d03 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_6c5b3bfc72e5878a.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_6c5b3bfc72e5878a.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_8398059a743d7027.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_8398059a743d7027.verified.txt index dcaf587172..c7cb996d03 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_8398059a743d7027.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_8398059a743d7027.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_a49380ce6d1fd8ba.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_a49380ce6d1fd8ba.verified.txt index 796105e568..bdd7c8f7a0 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_a49380ce6d1fd8ba.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_a49380ce6d1fd8ba.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_c9b12fe27be53878.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_c9b12fe27be53878.verified.txt index e881ead483..e8fc427339 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_c9b12fe27be53878.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_c9b12fe27be53878.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d19603117eb8b51b.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d19603117eb8b51b.verified.txt index 59c18000b0..13beb6bc7c 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d19603117eb8b51b.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d19603117eb8b51b.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d770d682c5802737.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d770d682c5802737.verified.txt index 04644e8e0a..b87e804456 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d770d682c5802737.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_d770d682c5802737.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_ef8cc721c9dfc7e4.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_ef8cc721c9dfc7e4.verified.txt index 9e86b78ae5..87b7a7697c 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_ef8cc721c9dfc7e4.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_ef8cc721c9dfc7e4.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f3897e2254996db0.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f3897e2254996db0.verified.txt index 79d2940a0f..18c5f966c5 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f3897e2254996db0.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f3897e2254996db0.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f4cadb897fc5b0fe.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f4cadb897fc5b0fe.verified.txt index 2e7c289550..612a65c14a 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f4cadb897fc5b0fe.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f4cadb897fc5b0fe.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f59b2a65fc1e18a3.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f59b2a65fc1e18a3.verified.txt index b3c39a3354..1cd138d10f 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f59b2a65fc1e18a3.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateRestAndGraphQLSettingsForStoredProcedures_f59b2a65fc1e18a3.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_574e1995f787740f.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_574e1995f787740f.verified.txt index 6e7d7cf324..a78465898d 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_574e1995f787740f.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_574e1995f787740f.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a13a9ca73b21f261.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a13a9ca73b21f261.verified.txt index 6b14e1e295..d3ed32cf42 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a13a9ca73b21f261.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a13a9ca73b21f261.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a5ce76c8bea25cc8.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a5ce76c8bea25cc8.verified.txt index 6b14e1e295..d3ed32cf42 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a5ce76c8bea25cc8.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_a5ce76c8bea25cc8.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_bba111332a1f973f.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_bba111332a1f973f.verified.txt index 12593a6aca..ba28cd7509 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_bba111332a1f973f.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.TestUpdateSourceStringToDatabaseSourceObject_bba111332a1f973f.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceKeyFields.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceKeyFields.verified.txt index d022d2ad5d..697074cedf 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceKeyFields.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceKeyFields.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceName.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceName.verified.txt index cf0c9367b8..967a59f1f9 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceName.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceName.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceParameters.verified.txt b/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceParameters.verified.txt index 2c60ba6563..016527cd68 100644 --- a/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceParameters.verified.txt +++ b/src/Cli.Tests/Snapshots/UpdateEntityTests.UpdateDatabaseSourceParameters.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Config/Converters/NestedCreateOptionsConverter.cs b/src/Config/Converters/NestedCreateOptionsConverter.cs index 51e8c139f6..7b5b248695 100644 --- a/src/Config/Converters/NestedCreateOptionsConverter.cs +++ b/src/Config/Converters/NestedCreateOptionsConverter.cs @@ -52,7 +52,7 @@ internal class NestedCreateOptionsConverter : JsonConverter public override void Write(Utf8JsonWriter writer, NestedCreateOptions? value, JsonSerializerOptions options) { // If the value is null, it is not written to the config file. - if(value is null) + if (value is null) { return; } diff --git a/src/Config/Converters/NestedMutationOptionsConverter.cs b/src/Config/Converters/NestedMutationOptionsConverter.cs index 263fdbaf1b..a32a36b7f2 100644 --- a/src/Config/Converters/NestedMutationOptionsConverter.cs +++ b/src/Config/Converters/NestedMutationOptionsConverter.cs @@ -63,7 +63,7 @@ public NestedMutationOptionsConverter(JsonSerializerOptions options) public override void Write(Utf8JsonWriter writer, NestedMutationOptions? value, JsonSerializerOptions options) { // If the nested mutation options is null, it is not written to the config file. - if(value is null) + if (value is null) { return; } From 82b1cce241b234d7ca68e2977a144efe46b009c1 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 6 Feb 2024 14:48:37 +0530 Subject: [PATCH 16/28] incorporating review feedback --- src/Cli.Tests/EndToEndTests.cs | 99 ++++++++++++------- src/Cli.Tests/InitTests.cs | 4 +- src/Cli/Commands/InitOptions.cs | 2 +- src/Cli/ConfigGenerator.cs | 25 ++--- .../NestedCreateOptionsConverter.cs | 1 - 5 files changed, 71 insertions(+), 60 deletions(-) diff --git a/src/Cli.Tests/EndToEndTests.cs b/src/Cli.Tests/EndToEndTests.cs index 559051358b..74053f0cb3 100644 --- a/src/Cli.Tests/EndToEndTests.cs +++ b/src/Cli.Tests/EndToEndTests.cs @@ -131,43 +131,68 @@ public void TestInitializingRestAndGraphQLGlobalSettings() Assert.IsTrue(runtimeConfig.Runtime.GraphQL?.Enabled); } - /* /// - /// Test to validate the successful generation of config file with the --graphql.nested-create.enabled option of the init command. - /// - /// Value for the nested create enabled flag in the init command. - /// Expected value for the nested create enabled flag in the config file. - [DataTestMethod] - [DataRow(CliBool.True, "mssql", true, DisplayName = "Nested Create operation enabled for MsSql database type: '--graphql.nested-create.enabled true'")] - [DataRow(CliBool.False, "mssql", false, DisplayName = "Nested Create operation is disabled the config file by specifying '--graphql.nested-create.enabled false'")] - [DataRow(CliBool.None, "mssql", false, DisplayName = " '--graphql.nested-create' option is not used in the init command. When not enabled explicitly, the nested create operation will be disabled.")] - public void TestEnablingNestedCreateOperation(CliBool isNestedCreateEnabled, string dbType, bool expectedValueForNestedCreateEnabledFlag) - { - List args = new() { "init", "-c", TEST_RUNTIME_CONFIG_FILE, "--connection-string", SAMPLE_TEST_CONN_STRING, "--database-type", "mssql" }; - - if (isNestedCreateEnabled is not CliBool.None) - { - args.Add("--graphql.nested-create.enabled"); - args.Add(isNestedCreateEnabled.ToString()!); - } - - Program.Execute(args.ToArray(), _cliLogger!, _fileSystem!, _runtimeConfigLoader!); - - Assert.IsTrue(_runtimeConfigLoader!.TryLoadConfig( - TEST_RUNTIME_CONFIG_FILE, - out RuntimeConfig? runtimeConfig, - replaceEnvVar: true)); - - SqlConnectionStringBuilder builder = new(runtimeConfig.DataSource.ConnectionString); - Assert.AreEqual(ProductInfo.GetDataApiBuilderApplicationName(), builder.ApplicationName); - - Assert.IsNotNull(runtimeConfig); - Assert.AreEqual(DatabaseType.MSSQL, runtimeConfig.DataSource.DatabaseType); - Assert.IsNotNull(runtimeConfig.Runtime); - Assert.IsNotNull(runtimeConfig.Runtime.GraphQL); - Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions); - Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedCreateOptions); - Assert.AreEqual(expectedValueForNestedCreateEnabledFlag, runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedCreateOptions.Enabled); - }*/ + /// + /// Test to validate the successful generation of config file with the --graphql.nested-create.enabled option of the init command. + /// + /// Value for the nested create enabled flag in the init command. + /// Expected value for the nested create enabled flag in the config file. + [DataTestMethod] + [DataRow(CliBool.True, "mssql", DatabaseType.MSSQL, DisplayName = "Init command with '--graphql.nested-create.enabled true' for MsSql database type")] + [DataRow(CliBool.False, "mssql", DatabaseType.MSSQL, DisplayName = "Init command with '--graphql.nested-create.enabled false' for MsSql database type")] + [DataRow(CliBool.None, "mssql", DatabaseType.MSSQL, DisplayName = "Init command without '--graphql.nested-create.enabled true' for MsSql database type")] + [DataRow(CliBool.True, "mysql", DatabaseType.MySQL, DisplayName = "Init command with '--graphql.nested-create.enabled true' for MySql database type")] + [DataRow(CliBool.False, "mysql", DatabaseType.MySQL, DisplayName = "Init command with '--graphql.nested-create.enabled false' for MySql database type")] + [DataRow(CliBool.None, "mysql", DatabaseType.MySQL, DisplayName = "Init command without '--graphql.nested-create.enabled true' for MySql database type")] + [DataRow(CliBool.True, "postgresql", DatabaseType.PostgreSQL, DisplayName = "Init command with '--graphql.nested-create.enabled true' for PostgreSql database type")] + [DataRow(CliBool.False, "postgresql", DatabaseType.PostgreSQL, DisplayName = "Init command with '--graphql.nested-create.enabled false' for PostgreSql database type")] + [DataRow(CliBool.None, "postgresql", DatabaseType.PostgreSQL, DisplayName = "Init command without '--graphql.nested-create.enabled true' for PostgreSql database type")] + [DataRow(CliBool.True, "dwsql", DatabaseType.DWSQL, DisplayName = "Init command with '--graphql.nested-create.enabled true' for dwsql database type")] + [DataRow(CliBool.False, "dwsql", DatabaseType.DWSQL, DisplayName = "Init command with '--graphql.nested-create.enabled false' for dwsql database type")] + [DataRow(CliBool.None, "dwsql", DatabaseType.DWSQL, DisplayName = "Init command without '--graphql.nested-create.enabled true' for dwsql database type")] + [DataRow(CliBool.True, "cosmosdb_nosql", DatabaseType.CosmosDB_NoSQL, DisplayName = "Init command with '--graphql.nested-create.enabled true' for cosmosdb_nosql database type")] + [DataRow(CliBool.False, "cosmosdb_nosql", DatabaseType.CosmosDB_NoSQL, DisplayName = "Init command with '--graphql.nested-create.enabled false' for cosmosdb_nosql database type")] + [DataRow(CliBool.None, "cosmosdb_nosql", DatabaseType.CosmosDB_NoSQL, DisplayName = "Init command without '--graphql.nested-create.enabled true' for cosmosdb_nosql database type")] + public void TestEnablingNestedCreateOperation(CliBool isNestedCreateEnabled, string dbType, DatabaseType expectedDbType) + { + List args = new() { "init", "-c", TEST_RUNTIME_CONFIG_FILE, "--connection-string", SAMPLE_TEST_CONN_STRING, "--database-type", dbType }; + + if (string.Equals("cosmosdb_nosql", dbType, StringComparison.OrdinalIgnoreCase)) + { + List cosmosNoSqlArgs = new() { "--cosmosdb_nosql-database", + "graphqldb", "--cosmosdb_nosql-container", "planet", "--graphql-schema", TEST_SCHEMA_FILE}; + args.AddRange(cosmosNoSqlArgs); + } + + if (isNestedCreateEnabled is not CliBool.None) + { + args.Add("--graphql.nested-create.enabled"); + args.Add(isNestedCreateEnabled.ToString()!); + } + + Program.Execute(args.ToArray(), _cliLogger!, _fileSystem!, _runtimeConfigLoader!); + + Assert.IsTrue(_runtimeConfigLoader!.TryLoadConfig( + TEST_RUNTIME_CONFIG_FILE, + out RuntimeConfig? runtimeConfig, + replaceEnvVar: true)); + + Assert.IsNotNull(runtimeConfig); + Assert.AreEqual(expectedDbType, runtimeConfig.DataSource.DatabaseType); + Assert.IsNotNull(runtimeConfig.Runtime); + Assert.IsNotNull(runtimeConfig.Runtime.GraphQL); + if (runtimeConfig.DataSource.DatabaseType is DatabaseType.MSSQL && isNestedCreateEnabled is not CliBool.None) + { + Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions); + Assert.IsNotNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedCreateOptions); + bool expectedValueForNestedCreateEnabled = isNestedCreateEnabled == CliBool.True; + Assert.AreEqual(expectedValueForNestedCreateEnabled, runtimeConfig.Runtime.GraphQL.NestedMutationOptions.NestedCreateOptions.Enabled); + } + else + { + Assert.IsNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions); + } + + } /// /// Test to verify adding a new Entity. diff --git a/src/Cli.Tests/InitTests.cs b/src/Cli.Tests/InitTests.cs index de5b07cd58..20d3b6ed6a 100644 --- a/src/Cli.Tests/InitTests.cs +++ b/src/Cli.Tests/InitTests.cs @@ -410,7 +410,7 @@ public Task GraphQLPathWithoutStartingSlashWillHaveItAdded() } /// - /// Test to validate the config is correctly generated with different database types and various options for --graphql.nested-create.enabled flag. + /// Test to validate the contents of the config file generated when init command is used with --graphql.nested-create.enabled flag option for different database types. /// [DataTestMethod] [DataRow(DatabaseType.MSSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-create.enabled true' for MsSQL database type")] @@ -437,7 +437,7 @@ public Task VerifyCorrectConfigGenerationWithNestedMutationOptions(DatabaseType if (databaseType is DatabaseType.CosmosDB_NoSQL) { - // A scheme file is added since its mandatory for CosmosDB_NoSQL + // A schema file is added since its mandatory for CosmosDB_NoSQL ((MockFileSystem)_fileSystem!).AddFile(TEST_SCHEMA_FILE, new MockFileData("")); options = new( diff --git a/src/Cli/Commands/InitOptions.cs b/src/Cli/Commands/InitOptions.cs index 322b50c16a..a3d49d6bb1 100644 --- a/src/Cli/Commands/InitOptions.cs +++ b/src/Cli/Commands/InitOptions.cs @@ -122,7 +122,7 @@ public InitOptions( [Option("rest.request-body-strict", Required = false, HelpText = "(Default: true) Allow extraneous fields in the request body for REST.")] public CliBool RestRequestBodyStrict { get; } - [Option("graphql.nested-create.enabled", Required = false, HelpText = "Enables Nested Create operation for GraphQL. Supported values: true, false.")] + [Option("graphql.nested-create.enabled", Required = false, HelpText = "(Default: false) Enables nested create operation for GraphQL. Supported values: true, false.")] public CliBool NestedCreateOperationEnabled { get; } public void Handler(ILogger logger, FileSystemRuntimeConfigLoader loader, IFileSystem fileSystem) diff --git a/src/Cli/ConfigGenerator.cs b/src/Cli/ConfigGenerator.cs index 8c98b9c7b4..288f4171ec 100644 --- a/src/Cli/ConfigGenerator.cs +++ b/src/Cli/ConfigGenerator.cs @@ -122,7 +122,7 @@ public static bool TryCreateRuntimeConfig(InitOptions options, FileSystemRuntime // Tracked by issue #2001: https://github.com/Azure/data-api-builder/issues/2001. if (dbType is not DatabaseType.MSSQL && options.NestedCreateOperationEnabled is not CliBool.None) { - _logger.LogWarning($"The option --graphql.nested-create.enabled is not supported for {dbType.ToString()} database type and will not be honored."); + _logger.LogWarning($"The option --graphql.nested-create.enabled is not supported for the {dbType.ToString()} database type and will not be honored."); } NestedMutationOptions? nestedMutationOptions = null; @@ -131,11 +131,7 @@ public static bool TryCreateRuntimeConfig(InitOptions options, FileSystemRuntime // it is not honored. if (dbType is DatabaseType.MSSQL && options.NestedCreateOperationEnabled is not CliBool.None) { - if (!IsNestedCreateOperationEnabled(options.NestedCreateOperationEnabled, out isNestedCreateEnabledForGraphQL)) - { - return false; - } - + isNestedCreateEnabledForGraphQL = IsNestedCreateOperationEnabled(options.NestedCreateOperationEnabled); nestedMutationOptions = new(nestedCreateOptions: new NestedCreateOptions(enabled: isNestedCreateEnabledForGraphQL)); } @@ -315,24 +311,15 @@ private static bool TryDetermineIfApiIsEnabled(bool apiDisabledOptionValue, CliB /// Helper method to determine if the nested create operation is enabled or not based on the inputs from dab init command. /// /// Input value for --graphql.nested-create.enabled option of the init command - /// Boolean value indicating if nested create operation is enabled. - private static bool IsNestedCreateOperationEnabled(CliBool nestedCreateEnabledOptionValue, out bool isNestedCreateEnabledForGraphQL) + /// True/False + private static bool IsNestedCreateOperationEnabled(CliBool nestedCreateEnabledOptionValue) { if (nestedCreateEnabledOptionValue is CliBool.None) { - isNestedCreateEnabledForGraphQL = false; - return true; - } - - if (bool.TryParse(nestedCreateEnabledOptionValue.ToString(), out isNestedCreateEnabledForGraphQL)) - { - return true; - } - else - { - _logger.LogError("Invalid value used with the option --graphql.nested-create.enabled. Supported values are true/false."); return false; } + + return bool.Parse(nestedCreateEnabledOptionValue.ToString()); } /// diff --git a/src/Config/Converters/NestedCreateOptionsConverter.cs b/src/Config/Converters/NestedCreateOptionsConverter.cs index 7b5b248695..79cba128c3 100644 --- a/src/Config/Converters/NestedCreateOptionsConverter.cs +++ b/src/Config/Converters/NestedCreateOptionsConverter.cs @@ -38,7 +38,6 @@ internal class NestedCreateOptionsConverter : JsonConverter break; default: throw new JsonException($"Unexpected property {propertyName}"); - } } From 23295bf0f105c0ab757a7d9918b4e13b5226cb43 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 7 Feb 2024 14:29:14 +0530 Subject: [PATCH 17/28] adds deserialization tests for invalid values in nested mutation section --- .../NestedCreateOptionsConverter.cs | 5 + .../NestedMutationOptionsConverter.cs | 7 +- .../Configuration/ConfigurationTests.cs | 117 ++++++++++++----- src/Service.Tests/TestHelper.cs | 124 ++++++++++++++++++ 4 files changed, 216 insertions(+), 37 deletions(-) diff --git a/src/Config/Converters/NestedCreateOptionsConverter.cs b/src/Config/Converters/NestedCreateOptionsConverter.cs index 79cba128c3..757f6c00cb 100644 --- a/src/Config/Converters/NestedCreateOptionsConverter.cs +++ b/src/Config/Converters/NestedCreateOptionsConverter.cs @@ -15,6 +15,11 @@ internal class NestedCreateOptionsConverter : JsonConverter /// public override NestedCreateOptions? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + { + return null; + } + if (reader.TokenType is JsonTokenType.StartObject) { NestedCreateOptions? nestedCreateOptions = null; diff --git a/src/Config/Converters/NestedMutationOptionsConverter.cs b/src/Config/Converters/NestedMutationOptionsConverter.cs index a32a36b7f2..a4a801c970 100644 --- a/src/Config/Converters/NestedMutationOptionsConverter.cs +++ b/src/Config/Converters/NestedMutationOptionsConverter.cs @@ -45,7 +45,12 @@ public NestedMutationOptionsConverter(JsonSerializerOptions options) { case "create": reader.Read(); - nestedMutationOptions = new(_nestedCreateOptionsConverter.Read(ref reader, typeToConvert, options)); + NestedCreateOptions? nestedCreateOptions = _nestedCreateOptionsConverter.Read(ref reader, typeToConvert, options); + if (nestedCreateOptions is not null) + { + nestedMutationOptions = new(nestedCreateOptions); + } + break; default: diff --git a/src/Service.Tests/Configuration/ConfigurationTests.cs b/src/Service.Tests/Configuration/ConfigurationTests.cs index 30947de37a..61a58997d0 100644 --- a/src/Service.Tests/Configuration/ConfigurationTests.cs +++ b/src/Service.Tests/Configuration/ConfigurationTests.cs @@ -68,6 +68,43 @@ public class ConfigurationTests private const int RETRY_COUNT = 5; private const int RETRY_WAIT_SECONDS = 1; + /// + /// + /// + public const string BOOK_ENTITY_JSON = @" + { + ""entities"": { + ""Book"": { + ""source"": { + ""object"": ""books"", + ""type"": ""table"" + }, + ""graphql"": { + ""enabled"": true, + ""type"": { + ""singular"": ""book"", + ""plural"": ""books"" + } + }, + ""rest"":{ + ""enabled"": true + }, + ""permissions"": [ + { + ""role"": ""anonymous"", + ""actions"": [ + { + ""action"": ""read"" + } + ] + } + ], + ""mappings"": null, + ""relationships"": null + } + } + }"; + /// /// A valid REST API request body with correct parameter types for all the fields. /// @@ -1579,6 +1616,49 @@ public async Task TestSPRestDefaultsForManuallyConstructedConfigs( } } + /// + /// Validates that deserialization of config file is successful for the following scenarios: + /// 1. Nested Mutations section is null + /// { + /// "nested-mutations": null + /// } + /// + /// 2. Nested Mutations section is empty. + /// { + /// "nested-mutations": {} + /// } + /// + /// 3. Create field within Nested Mutation section is null. + /// { + /// "nested-mutations": { + /// "create": null + /// } + /// } + /// + /// 4. Create field within Nested Mutation section is empty. + /// { + /// "nested-mutations": { + /// "create": {} + /// } + /// } + /// + /// For all the above mentioned scenarios, the expected value for NestedMutationOptions field in null. + /// + /// Base Config Json string. + [DataTestMethod] + [DataRow(TestHelper.BASE_CONFIG_NULL_NESTED_MUTATIONS_FIELD, DisplayName = "Validate successful deserialization when nested mutation section is null")] + [DataRow(TestHelper.BASE_CONFIG_EMPTY_NESTED_MUTATIONS_FIELD, DisplayName = "Validate successful deserialization when nested mutation section is empty")] + [DataRow(TestHelper.BASE_CONFIG_NULL_NESTED_CREATE_FIELD, DisplayName = "Validate successful deserialization when create field within nested mutation section is null")] + [DataRow(TestHelper.BASE_CONFIG_EMPTY_NESTED_CREATE_FIELD, DisplayName = "Validate successful deserialization when create field within nested mutation section is empty")] + public void ValidateDeserializationOfConfigWithNullOrEmptyInvalidNestedMutationSection(string baseConfig) + { + string configJson = TestHelper.AddPropertiesToJson(TestHelper.BASE_CONFIG, BOOK_ENTITY_JSON); + Assert.IsTrue(RuntimeConfigLoader.TryParseConfig(configJson, out RuntimeConfig deserializedConfig)); + Assert.IsNotNull(deserializedConfig.Runtime); + Assert.IsNotNull(deserializedConfig.Runtime.GraphQL); + Assert.IsNull(deserializedConfig.Runtime.GraphQL.NestedMutationOptions); + } + /// /// Sanity check to validate that DAB engine works fine when used with a config file without the nested /// mutations feature flag section. @@ -1598,44 +1678,9 @@ public async Task TestSPRestDefaultsForManuallyConstructedConfigs( [TestCategory(TestCategory.MSSQL)] public async Task SanityTestForRestAndGQLRequestsWithoutNestedMutationFeatureFlagSection() { - // Hard-coded json string for Book entity - string entityJson = @" - { - ""entities"": { - ""Book"": { - ""source"": { - ""object"": ""books"", - ""type"": ""table"" - }, - ""graphql"": { - ""enabled"": true, - ""type"": { - ""singular"": ""book"", - ""plural"": ""books"" - } - }, - ""rest"":{ - ""enabled"": true - }, - ""permissions"": [ - { - ""role"": ""anonymous"", - ""actions"": [ - { - ""action"": ""read"" - } - ] - } - ], - ""mappings"": null, - ""relationships"": null - } - } - }"; - // The config file is constructed by merging the hard-coded json strings to mimic the scenario where config file is // hand-edited (instead of using CLI) by the users. - string configJson = TestHelper.AddPropertiesToJson(TestHelper.BASE_CONFIG, entityJson); + string configJson = TestHelper.AddPropertiesToJson(TestHelper.BASE_CONFIG, BOOK_ENTITY_JSON); RuntimeConfigLoader.TryParseConfig(configJson, out RuntimeConfig deserializedConfig, logger: null, GetConnectionStringFromEnvironmentConfig(environment: TestCategory.MSSQL)); string configFileName = "custom-config.json"; File.WriteAllText(configFileName, deserializedConfig.ToJson()); diff --git a/src/Service.Tests/TestHelper.cs b/src/Service.Tests/TestHelper.cs index b1a1137b62..37bef56318 100644 --- a/src/Service.Tests/TestHelper.cs +++ b/src/Service.Tests/TestHelper.cs @@ -194,6 +194,130 @@ public static RuntimeConfig AddMissingEntitiesToConfig(RuntimeConfig config, str ""entities"": {}" + "}"; + /// + /// A minimal valid config json with nested mutations section as null. + /// + public const string BASE_CONFIG_NULL_NESTED_MUTATIONS_FIELD = + "{" + + SAMPLE_SCHEMA_DATA_SOURCE + "," + + @" + ""runtime"": { + ""rest"": { + ""path"": ""/api"" + }, + ""graphql"": { + ""path"": ""/graphql"", + ""allow-introspection"": true, + ""nested-mutations"": null + }, + ""host"": { + ""mode"": ""development"", + ""cors"": { + ""origins"": [""http://localhost:5000""], + ""allow-credentials"": false + }, + ""authentication"": { + ""provider"": ""StaticWebApps"" + } + } + }, + ""entities"": {}" + + "}"; + + /// + /// A minimal valid config json with an empty nested mutations section. + /// + public const string BASE_CONFIG_EMPTY_NESTED_MUTATIONS_FIELD = + "{" + + SAMPLE_SCHEMA_DATA_SOURCE + "," + + @" + ""runtime"": { + ""rest"": { + ""path"": ""/api"" + }, + ""graphql"": { + ""path"": ""/graphql"", + ""allow-introspection"": true, + ""nested-mutations"": {} + }, + ""host"": { + ""mode"": ""development"", + ""cors"": { + ""origins"": [""http://localhost:5000""], + ""allow-credentials"": false + }, + ""authentication"": { + ""provider"": ""StaticWebApps"" + } + } + }, + ""entities"": {}" + + "}"; + + /// + /// A minimal valid config json with the create field within nested mutation as null. + /// + public const string BASE_CONFIG_NULL_NESTED_CREATE_FIELD = + "{" + + SAMPLE_SCHEMA_DATA_SOURCE + "," + + @" + ""runtime"": { + ""rest"": { + ""path"": ""/api"" + }, + ""graphql"": { + ""path"": ""/graphql"", + ""allow-introspection"": true, + ""nested-mutations"": { + ""create"": null + } + }, + ""host"": { + ""mode"": ""development"", + ""cors"": { + ""origins"": [""http://localhost:5000""], + ""allow-credentials"": false + }, + ""authentication"": { + ""provider"": ""StaticWebApps"" + } + } + }, + ""entities"": {}" + + "}"; + + /// + /// A minimal valid config json with an empty create field within nested mutation. + /// + public const string BASE_CONFIG_EMPTY_NESTED_CREATE_FIELD = + "{" + + SAMPLE_SCHEMA_DATA_SOURCE + "," + + @" + ""runtime"": { + ""rest"": { + ""path"": ""/api"" + }, + ""graphql"": { + ""path"": ""/graphql"", + ""allow-introspection"": true, + ""nested-mutations"": { + ""create"": {} + } + }, + ""host"": { + ""mode"": ""development"", + ""cors"": { + ""origins"": [""http://localhost:5000""], + ""allow-credentials"": false + }, + ""authentication"": { + ""provider"": ""StaticWebApps"" + } + } + }, + ""entities"": {}" + + "}"; + public static RuntimeConfigProvider GenerateInMemoryRuntimeConfigProvider(RuntimeConfig runtimeConfig) { MockFileSystem fileSystem = new(); From 2e85aee44ad70c918287e285b7a21959f4182e3b Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 7 Feb 2024 14:34:19 +0530 Subject: [PATCH 18/28] updates reference config files with true --- src/Service.Tests/Multidab-config.CosmosDb_NoSql.json | 2 +- src/Service.Tests/Multidab-config.MsSql.json | 2 +- src/Service.Tests/Multidab-config.MySql.json | 2 +- src/Service.Tests/Multidab-config.PostgreSql.json | 2 +- src/Service.Tests/dab-config.CosmosDb_NoSql.json | 2 +- src/Service.Tests/dab-config.DwSql.json | 2 +- src/Service.Tests/dab-config.MsSql.json | 2 +- src/Service.Tests/dab-config.MySql.json | 2 +- src/Service.Tests/dab-config.PostgreSql.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json b/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json index 67d10ce4e4..b1581bf40e 100644 --- a/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json +++ b/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json @@ -20,7 +20,7 @@ "allow-introspection": true, "nested-mutations": { "create": { - "enabled": false + "enabled": true } } }, diff --git a/src/Service.Tests/Multidab-config.MsSql.json b/src/Service.Tests/Multidab-config.MsSql.json index 05898c266f..9f05161a83 100644 --- a/src/Service.Tests/Multidab-config.MsSql.json +++ b/src/Service.Tests/Multidab-config.MsSql.json @@ -18,7 +18,7 @@ "allow-introspection": true, "nested-mutations": { "create": { - "enabled": false + "enabled": true } } }, diff --git a/src/Service.Tests/Multidab-config.MySql.json b/src/Service.Tests/Multidab-config.MySql.json index d5748f5cb6..241bd11e8e 100644 --- a/src/Service.Tests/Multidab-config.MySql.json +++ b/src/Service.Tests/Multidab-config.MySql.json @@ -15,7 +15,7 @@ "allow-introspection": true, "nested-mutations": { "create": { - "enabled": false + "enabled": true } } }, diff --git a/src/Service.Tests/Multidab-config.PostgreSql.json b/src/Service.Tests/Multidab-config.PostgreSql.json index 0fd13d8898..8bf51f8b6c 100644 --- a/src/Service.Tests/Multidab-config.PostgreSql.json +++ b/src/Service.Tests/Multidab-config.PostgreSql.json @@ -15,7 +15,7 @@ "allow-introspection": true, "nested-mutations": { "create": { - "enabled": false + "enabled": true } } }, diff --git a/src/Service.Tests/dab-config.CosmosDb_NoSql.json b/src/Service.Tests/dab-config.CosmosDb_NoSql.json index 7ebb4a0ad4..b8d4de4b4c 100644 --- a/src/Service.Tests/dab-config.CosmosDb_NoSql.json +++ b/src/Service.Tests/dab-config.CosmosDb_NoSql.json @@ -21,7 +21,7 @@ "allow-introspection": true, "nested-mutations": { "create": { - "enabled": false + "enabled": true } } }, diff --git a/src/Service.Tests/dab-config.DwSql.json b/src/Service.Tests/dab-config.DwSql.json index 2f14494cb8..1a22e64b53 100644 --- a/src/Service.Tests/dab-config.DwSql.json +++ b/src/Service.Tests/dab-config.DwSql.json @@ -19,7 +19,7 @@ "allow-introspection": true, "nested-mutations": { "create": { - "enabled": false + "enabled": true } } }, diff --git a/src/Service.Tests/dab-config.MsSql.json b/src/Service.Tests/dab-config.MsSql.json index a38930c0f9..cda5d134f5 100644 --- a/src/Service.Tests/dab-config.MsSql.json +++ b/src/Service.Tests/dab-config.MsSql.json @@ -19,7 +19,7 @@ "allow-introspection": true, "nested-mutations": { "create": { - "enabled": false + "enabled": true } } }, diff --git a/src/Service.Tests/dab-config.MySql.json b/src/Service.Tests/dab-config.MySql.json index 495ff1a3de..8a53512c17 100644 --- a/src/Service.Tests/dab-config.MySql.json +++ b/src/Service.Tests/dab-config.MySql.json @@ -17,7 +17,7 @@ "allow-introspection": true, "nested-mutations": { "create": { - "enabled": false + "enabled": true } } }, diff --git a/src/Service.Tests/dab-config.PostgreSql.json b/src/Service.Tests/dab-config.PostgreSql.json index 57fa83c0cf..fd136f543c 100644 --- a/src/Service.Tests/dab-config.PostgreSql.json +++ b/src/Service.Tests/dab-config.PostgreSql.json @@ -17,7 +17,7 @@ "allow-introspection": true, "nested-mutations": { "create": { - "enabled": false + "enabled": true } } }, From 539e6c76f1e2cb13e8cb8d2dd475ba516d10bcd4 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 7 Feb 2024 14:52:53 +0530 Subject: [PATCH 19/28] updates test description --- .../Configuration/ConfigurationTests.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Service.Tests/Configuration/ConfigurationTests.cs b/src/Service.Tests/Configuration/ConfigurationTests.cs index 61a58997d0..79da9dcadd 100644 --- a/src/Service.Tests/Configuration/ConfigurationTests.cs +++ b/src/Service.Tests/Configuration/ConfigurationTests.cs @@ -1670,7 +1670,7 @@ public void ValidateDeserializationOfConfigWithNullOrEmptyInvalidNestedMutationS /// } /// /// Without the nested mutations feature flag section, DAB engine should be able to - /// 1. Successfully deserialize the config file. + /// 1. Successfully deserialize the config file without nested mutation section. /// 2. Process REST and GraphQL API requests. /// /// @@ -1681,7 +1681,7 @@ public async Task SanityTestForRestAndGQLRequestsWithoutNestedMutationFeatureFla // The config file is constructed by merging the hard-coded json strings to mimic the scenario where config file is // hand-edited (instead of using CLI) by the users. string configJson = TestHelper.AddPropertiesToJson(TestHelper.BASE_CONFIG, BOOK_ENTITY_JSON); - RuntimeConfigLoader.TryParseConfig(configJson, out RuntimeConfig deserializedConfig, logger: null, GetConnectionStringFromEnvironmentConfig(environment: TestCategory.MSSQL)); + Assert.IsTrue(RuntimeConfigLoader.TryParseConfig(configJson, out RuntimeConfig deserializedConfig, logger: null, GetConnectionStringFromEnvironmentConfig(environment: TestCategory.MSSQL))); string configFileName = "custom-config.json"; File.WriteAllText(configFileName, deserializedConfig.ToJson()); string[] args = new[] @@ -1695,16 +1695,12 @@ public async Task SanityTestForRestAndGQLRequestsWithoutNestedMutationFeatureFla try { - // Perform a REST GET API request - // 1. To validate that DAB engine deserialized the config without the nested mutation feature flag section correctly. - // 2. To validate that REST GET requests are executed correctly. + // Perform a REST GET API request to validate that REST GET API requests are executed correctly. HttpRequestMessage restRequest = new(HttpMethod.Get, "api/Book"); HttpResponseMessage restResponse = await client.SendAsync(restRequest); Assert.AreEqual(HttpStatusCode.OK, restResponse.StatusCode); - // Perform a GraphQL API request - // 1. To validate that DAB engine successfully deserialized the config without the nested mutation feature flag section. - // 2. To validate that DAB engine executes GraphQL requests successfully. + // Perform a GraphQL API request to validate that DAB engine executes GraphQL requests successfully. string query = @"{ book_by_pk(id: 1) { id, From b4ce4b090496c177656d314e1aa655c067d91ee8 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 7 Feb 2024 15:17:25 +0530 Subject: [PATCH 20/28] fixing snapshot files --- ...ionTests.TestReadingRuntimeConfigForCosmos.verified.txt | 7 +------ ...tionTests.TestReadingRuntimeConfigForMsSql.verified.txt | 7 +------ ...tionTests.TestReadingRuntimeConfigForMySql.verified.txt | 7 +------ ...ests.TestReadingRuntimeConfigForPostgreSql.verified.txt | 7 +------ 4 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt index f84215f831..8b3feb4dc8 100644 --- a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt +++ b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForCosmos.verified.txt @@ -21,12 +21,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt index 85a48828ba..e03f6f6151 100644 --- a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt +++ b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMsSql.verified.txt @@ -16,12 +16,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt index a31ec817d7..4becd3b370 100644 --- a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt +++ b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForMySql.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { diff --git a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt index 7560165a49..25038524fb 100644 --- a/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt +++ b/src/Service.Tests/Snapshots/ConfigurationTests.TestReadingRuntimeConfigForPostgreSql.verified.txt @@ -11,12 +11,7 @@ GraphQL: { Enabled: true, Path: /graphql, - AllowIntrospection: true, - NestedMutationOptions: { - NestedCreateOptions: { - Enabled: false - } - } + AllowIntrospection: true }, Host: { Cors: { From b480c2770b73696fdbecfb1c19aab2ed46bc4f2d Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 7 Feb 2024 23:08:20 +0530 Subject: [PATCH 21/28] adds additionalProperties to draft schema file --- schemas/dab.draft.schema.json | 2 ++ src/Service.Tests/Configuration/ConfigurationTests.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/schemas/dab.draft.schema.json b/schemas/dab.draft.schema.json index 012dfe0bb0..0774769912 100644 --- a/schemas/dab.draft.schema.json +++ b/schemas/dab.draft.schema.json @@ -179,10 +179,12 @@ "nested-mutations": { "type": "object", "description": "Feature flags for nested mutation operations", + "additionalProperties": false, "properties": { "create":{ "type": "object", "description": "Options for nested create operations", + "additionalProperties": false, "properties": { "enabled": { "type": "boolean", diff --git a/src/Service.Tests/Configuration/ConfigurationTests.cs b/src/Service.Tests/Configuration/ConfigurationTests.cs index 79da9dcadd..8759485cfb 100644 --- a/src/Service.Tests/Configuration/ConfigurationTests.cs +++ b/src/Service.Tests/Configuration/ConfigurationTests.cs @@ -1678,8 +1678,8 @@ public void ValidateDeserializationOfConfigWithNullOrEmptyInvalidNestedMutationS [TestCategory(TestCategory.MSSQL)] public async Task SanityTestForRestAndGQLRequestsWithoutNestedMutationFeatureFlagSection() { - // The config file is constructed by merging the hard-coded json strings to mimic the scenario where config file is - // hand-edited (instead of using CLI) by the users. + // The configuration file is constructed by merging hard-coded JSON strings to simulate the scenario where users manually edit the + // configuration file (instead of using CLI). string configJson = TestHelper.AddPropertiesToJson(TestHelper.BASE_CONFIG, BOOK_ENTITY_JSON); Assert.IsTrue(RuntimeConfigLoader.TryParseConfig(configJson, out RuntimeConfig deserializedConfig, logger: null, GetConnectionStringFromEnvironmentConfig(environment: TestCategory.MSSQL))); string configFileName = "custom-config.json"; From ffcc89319367af839ea6144f028ef0668d590ca5 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 8 Feb 2024 15:13:02 +0530 Subject: [PATCH 22/28] simplifies logic in a helper function --- src/Cli/ConfigGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cli/ConfigGenerator.cs b/src/Cli/ConfigGenerator.cs index 288f4171ec..fde8b8517d 100644 --- a/src/Cli/ConfigGenerator.cs +++ b/src/Cli/ConfigGenerator.cs @@ -314,12 +314,12 @@ private static bool TryDetermineIfApiIsEnabled(bool apiDisabledOptionValue, CliB /// True/False private static bool IsNestedCreateOperationEnabled(CliBool nestedCreateEnabledOptionValue) { - if (nestedCreateEnabledOptionValue is CliBool.None) + if (nestedCreateEnabledOptionValue is CliBool.None or CliBool.False) { return false; } - return bool.Parse(nestedCreateEnabledOptionValue.ToString()); + return true; } /// From 6a7b029838694f4acc89bdcb38f355a5c00148f9 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Thu, 8 Feb 2024 15:30:39 +0530 Subject: [PATCH 23/28] updates test descriptions --- src/Service.Tests/Configuration/ConfigurationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service.Tests/Configuration/ConfigurationTests.cs b/src/Service.Tests/Configuration/ConfigurationTests.cs index 8759485cfb..28c8656d02 100644 --- a/src/Service.Tests/Configuration/ConfigurationTests.cs +++ b/src/Service.Tests/Configuration/ConfigurationTests.cs @@ -1660,7 +1660,7 @@ public void ValidateDeserializationOfConfigWithNullOrEmptyInvalidNestedMutationS } /// - /// Sanity check to validate that DAB engine works fine when used with a config file without the nested + /// Sanity check to validate that DAB engine starts successfully when used with a config file without the nested /// mutations feature flag section. /// The runtime graphql section of the config file used looks like this: /// From 02aa7b641c4cd8faaffeeb057eb178f446341f7f Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Fri, 23 Feb 2024 16:19:21 +0530 Subject: [PATCH 24/28] updating snapshot files as per latest --- ...stedMutationOptions_09cf40a5c545de68.verified.txt | 12 +++--------- ...stedMutationOptions_1211ad099a77f7c4.verified.txt | 4 +--- ...stedMutationOptions_17721ef496526b3e.verified.txt | 4 +--- ...stedMutationOptions_181195e2fbe991a8.verified.txt | 12 +++--------- ...stedMutationOptions_2be9ac1b7d981cde.verified.txt | 4 +--- ...stedMutationOptions_388c095980b1b53f.verified.txt | 12 +++--------- ...stedMutationOptions_92ba6ec2f08a3060.verified.txt | 4 +--- ...stedMutationOptions_9efd9a8a0ff47434.verified.txt | 4 +--- ...stedMutationOptions_adc642ef89cb6d18.verified.txt | 4 +--- 9 files changed, 15 insertions(+), 45 deletions(-) diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_09cf40a5c545de68.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_09cf40a5c545de68.verified.txt index 29f7eee2e7..9740a85a77 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_09cf40a5c545de68.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_09cf40a5c545de68.verified.txt @@ -1,15 +1,9 @@ { DataSource: { Options: { - container: { - ValueKind: String - }, - database: { - ValueKind: String - }, - schema: { - ValueKind: String - } + container: testcontainer, + database: testdb, + schema: test-schema.gql } }, Runtime: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_1211ad099a77f7c4.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_1211ad099a77f7c4.verified.txt index 71f3c51816..da7937d1d9 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_1211ad099a77f7c4.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_1211ad099a77f7c4.verified.txt @@ -2,9 +2,7 @@ DataSource: { DatabaseType: MSSQL, Options: { - set-session-context: { - ValueKind: True - } + set-session-context: true } }, Runtime: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_17721ef496526b3e.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_17721ef496526b3e.verified.txt index d439dfaa24..078169b766 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_17721ef496526b3e.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_17721ef496526b3e.verified.txt @@ -2,9 +2,7 @@ DataSource: { DatabaseType: MSSQL, Options: { - set-session-context: { - ValueKind: True - } + set-session-context: true } }, Runtime: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_181195e2fbe991a8.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_181195e2fbe991a8.verified.txt index 29f7eee2e7..9740a85a77 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_181195e2fbe991a8.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_181195e2fbe991a8.verified.txt @@ -1,15 +1,9 @@ { DataSource: { Options: { - container: { - ValueKind: String - }, - database: { - ValueKind: String - }, - schema: { - ValueKind: String - } + container: testcontainer, + database: testdb, + schema: test-schema.gql } }, Runtime: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_2be9ac1b7d981cde.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_2be9ac1b7d981cde.verified.txt index 043743d266..cbaaa45754 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_2be9ac1b7d981cde.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_2be9ac1b7d981cde.verified.txt @@ -2,9 +2,7 @@ DataSource: { DatabaseType: DWSQL, Options: { - set-session-context: { - ValueKind: True - } + set-session-context: true } }, Runtime: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_388c095980b1b53f.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_388c095980b1b53f.verified.txt index 29f7eee2e7..9740a85a77 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_388c095980b1b53f.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_388c095980b1b53f.verified.txt @@ -1,15 +1,9 @@ { DataSource: { Options: { - container: { - ValueKind: String - }, - database: { - ValueKind: String - }, - schema: { - ValueKind: String - } + container: testcontainer, + database: testdb, + schema: test-schema.gql } }, Runtime: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_92ba6ec2f08a3060.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_92ba6ec2f08a3060.verified.txt index 043743d266..cbaaa45754 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_92ba6ec2f08a3060.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_92ba6ec2f08a3060.verified.txt @@ -2,9 +2,7 @@ DataSource: { DatabaseType: DWSQL, Options: { - set-session-context: { - ValueKind: True - } + set-session-context: true } }, Runtime: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_9efd9a8a0ff47434.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_9efd9a8a0ff47434.verified.txt index 043743d266..cbaaa45754 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_9efd9a8a0ff47434.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_9efd9a8a0ff47434.verified.txt @@ -2,9 +2,7 @@ DataSource: { DatabaseType: DWSQL, Options: { - set-session-context: { - ValueKind: True - } + set-session-context: true } }, Runtime: { diff --git a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_adc642ef89cb6d18.verified.txt b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_adc642ef89cb6d18.verified.txt index 8d8fa23fcf..65cf6b8748 100644 --- a/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_adc642ef89cb6d18.verified.txt +++ b/src/Cli.Tests/Snapshots/InitTests.VerifyCorrectConfigGenerationWithNestedMutationOptions_adc642ef89cb6d18.verified.txt @@ -2,9 +2,7 @@ DataSource: { DatabaseType: MSSQL, Options: { - set-session-context: { - ValueKind: True - } + set-session-context: true } }, Runtime: { From 03af546b3a9c7b00190d51302d5f5d899751c2f6 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Fri, 1 Mar 2024 19:14:57 +0530 Subject: [PATCH 25/28] incorporating review comments --- .../GraphQLRuntimeOptionsConverterFactory.cs | 6 + .../NestedCreateOptionsConverter.cs | 8 +- .../NestedMutationOptionsConverter.cs | 2 +- ...nsertOptions.cs => NestedCreateOptions.cs} | 0 .../ObjectModel/NestedMutationOptions.cs | 2 - .../Configuration/ConfigurationTests.cs | 4 +- src/Service.Tests/TestHelper.cs | 131 +++++++----------- .../dab-config.CosmosDb_NoSql.json | 7 +- src/Service.Tests/dab-config.DwSql.json | 7 +- src/Service.Tests/dab-config.MySql.json | 7 +- src/Service.Tests/dab-config.PostgreSql.json | 7 +- 11 files changed, 68 insertions(+), 113 deletions(-) rename src/Config/ObjectModel/{NestedInsertOptions.cs => NestedCreateOptions.cs} (100%) diff --git a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs index 60a30bb305..10dcb296f0 100644 --- a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs +++ b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs @@ -71,6 +71,12 @@ internal GraphQLRuntimeOptionsConverter(bool replaceEnvVar) } string? propertyName = reader.GetString(); + + if (propertyName is null) + { + throw new JsonException("Invalid property : null"); + } + reader.Read(); switch (propertyName) { diff --git a/src/Config/Converters/NestedCreateOptionsConverter.cs b/src/Config/Converters/NestedCreateOptionsConverter.cs index 757f6c00cb..7e495ef303 100644 --- a/src/Config/Converters/NestedCreateOptionsConverter.cs +++ b/src/Config/Converters/NestedCreateOptionsConverter.cs @@ -31,6 +31,12 @@ internal class NestedCreateOptionsConverter : JsonConverter } string? propertyName = reader.GetString(); + + if (propertyName is null) + { + throw new JsonException("Invalid property : null"); + } + switch (propertyName) { case "enabled": @@ -49,7 +55,7 @@ internal class NestedCreateOptionsConverter : JsonConverter return nestedCreateOptions; } - throw new JsonException(); + throw new JsonException("Failed to read the GraphQL Nested Create options"); } /// diff --git a/src/Config/Converters/NestedMutationOptionsConverter.cs b/src/Config/Converters/NestedMutationOptionsConverter.cs index a4a801c970..f121e070dd 100644 --- a/src/Config/Converters/NestedMutationOptionsConverter.cs +++ b/src/Config/Converters/NestedMutationOptionsConverter.cs @@ -61,7 +61,7 @@ public NestedMutationOptionsConverter(JsonSerializerOptions options) return nestedMutationOptions; } - throw new JsonException(); + throw new JsonException("Failed to read the GraphQL Nested Mutation options"); } /// diff --git a/src/Config/ObjectModel/NestedInsertOptions.cs b/src/Config/ObjectModel/NestedCreateOptions.cs similarity index 100% rename from src/Config/ObjectModel/NestedInsertOptions.cs rename to src/Config/ObjectModel/NestedCreateOptions.cs diff --git a/src/Config/ObjectModel/NestedMutationOptions.cs b/src/Config/ObjectModel/NestedMutationOptions.cs index a5698786d4..0cf6c05e3e 100644 --- a/src/Config/ObjectModel/NestedMutationOptions.cs +++ b/src/Config/ObjectModel/NestedMutationOptions.cs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System.Text.Json.Serialization; namespace Azure.DataApiBuilder.Config.ObjectModel; @@ -11,7 +10,6 @@ namespace Azure.DataApiBuilder.Config.ObjectModel; public class NestedMutationOptions { // Options for nested create operation. - [JsonPropertyName("insert")] public NestedCreateOptions? NestedCreateOptions; public NestedMutationOptions(NestedCreateOptions? nestedCreateOptions = null) diff --git a/src/Service.Tests/Configuration/ConfigurationTests.cs b/src/Service.Tests/Configuration/ConfigurationTests.cs index eebcd29ccf..9c1ce274e7 100644 --- a/src/Service.Tests/Configuration/ConfigurationTests.cs +++ b/src/Service.Tests/Configuration/ConfigurationTests.cs @@ -1644,7 +1644,7 @@ public async Task TestSPRestDefaultsForManuallyConstructedConfigs( /// } /// } /// - /// For all the above mentioned scenarios, the expected value for NestedMutationOptions field in null. + /// For all the above mentioned scenarios, the expected value for NestedMutationOptions field is null. /// /// Base Config Json string. [DataTestMethod] @@ -1654,7 +1654,7 @@ public async Task TestSPRestDefaultsForManuallyConstructedConfigs( [DataRow(TestHelper.BASE_CONFIG_EMPTY_NESTED_CREATE_FIELD, DisplayName = "Validate successful deserialization when create field within nested mutation section is empty")] public void ValidateDeserializationOfConfigWithNullOrEmptyInvalidNestedMutationSection(string baseConfig) { - string configJson = TestHelper.AddPropertiesToJson(TestHelper.BASE_CONFIG, BOOK_ENTITY_JSON); + string configJson = TestHelper.AddPropertiesToJson(baseConfig, BOOK_ENTITY_JSON); Assert.IsTrue(RuntimeConfigLoader.TryParseConfig(configJson, out RuntimeConfig deserializedConfig)); Assert.IsNotNull(deserializedConfig.Runtime); Assert.IsNotNull(deserializedConfig.Runtime.GraphQL); diff --git a/src/Service.Tests/TestHelper.cs b/src/Service.Tests/TestHelper.cs index 37bef56318..1f1dacaed3 100644 --- a/src/Service.Tests/TestHelper.cs +++ b/src/Service.Tests/TestHelper.cs @@ -195,22 +195,34 @@ public static RuntimeConfig AddMissingEntitiesToConfig(RuntimeConfig config, str "}"; /// - /// A minimal valid config json with nested mutations section as null. + /// An empty entities section of the config file. This is used in constructing config json strings utilized for testing. /// - public const string BASE_CONFIG_NULL_NESTED_MUTATIONS_FIELD = - "{" + - SAMPLE_SCHEMA_DATA_SOURCE + "," + + public const string EMPTY_ENTITIES_CONFIG_JSON = @" + ""entities"": {} + "; + + /// + /// A json string with Runtime Rest and GraphQL options. This is used in constructing config json strings utilized for testing. + /// + public const string RUNTIME_REST_GRAPQL_OPTIONS_CONFIG_JSON = + "{" + + SAMPLE_SCHEMA_DATA_SOURCE + "," + + @" ""runtime"": { ""rest"": { ""path"": ""/api"" }, ""graphql"": { ""path"": ""/graphql"", - ""allow-introspection"": true, - ""nested-mutations"": null - }, - ""host"": { + ""allow-introspection"": true,"; + + /// + /// A json string with host and empty entity options. This is used in constructing config json strings utilized for testing. + /// + public const string HOST_AND_ENTITY_OPTIONS_CONFIG_JSON = + @" + ""host"": { ""mode"": ""development"", ""cors"": { ""origins"": [""http://localhost:5000""], @@ -220,103 +232,56 @@ public static RuntimeConfig AddMissingEntitiesToConfig(RuntimeConfig config, str ""provider"": ""StaticWebApps"" } } - }, - ""entities"": {}" + - "}"; + }" + "," + + EMPTY_ENTITIES_CONFIG_JSON + + "}"; + + /// + /// A minimal valid config json with nested mutations section as null. + /// + public const string BASE_CONFIG_NULL_NESTED_MUTATIONS_FIELD = + RUNTIME_REST_GRAPQL_OPTIONS_CONFIG_JSON + + @" + ""nested-mutations"": null + }," + + HOST_AND_ENTITY_OPTIONS_CONFIG_JSON; /// /// A minimal valid config json with an empty nested mutations section. /// public const string BASE_CONFIG_EMPTY_NESTED_MUTATIONS_FIELD = - "{" + - SAMPLE_SCHEMA_DATA_SOURCE + "," + - @" - ""runtime"": { - ""rest"": { - ""path"": ""/api"" - }, - ""graphql"": { - ""path"": ""/graphql"", - ""allow-introspection"": true, + + RUNTIME_REST_GRAPQL_OPTIONS_CONFIG_JSON + + @" ""nested-mutations"": {} - }, - ""host"": { - ""mode"": ""development"", - ""cors"": { - ""origins"": [""http://localhost:5000""], - ""allow-credentials"": false - }, - ""authentication"": { - ""provider"": ""StaticWebApps"" - } - } - }, - ""entities"": {}" + - "}"; + }," + + HOST_AND_ENTITY_OPTIONS_CONFIG_JSON; /// /// A minimal valid config json with the create field within nested mutation as null. /// public const string BASE_CONFIG_NULL_NESTED_CREATE_FIELD = - "{" + - SAMPLE_SCHEMA_DATA_SOURCE + "," + - @" - ""runtime"": { - ""rest"": { - ""path"": ""/api"" - }, - ""graphql"": { - ""path"": ""/graphql"", - ""allow-introspection"": true, - ""nested-mutations"": { + + RUNTIME_REST_GRAPQL_OPTIONS_CONFIG_JSON + + @" + ""nested-mutations"": { ""create"": null } - }, - ""host"": { - ""mode"": ""development"", - ""cors"": { - ""origins"": [""http://localhost:5000""], - ""allow-credentials"": false - }, - ""authentication"": { - ""provider"": ""StaticWebApps"" - } - } - }, - ""entities"": {}" + - "}"; + }," + + HOST_AND_ENTITY_OPTIONS_CONFIG_JSON; /// /// A minimal valid config json with an empty create field within nested mutation. /// public const string BASE_CONFIG_EMPTY_NESTED_CREATE_FIELD = - "{" + - SAMPLE_SCHEMA_DATA_SOURCE + "," + + + RUNTIME_REST_GRAPQL_OPTIONS_CONFIG_JSON + @" - ""runtime"": { - ""rest"": { - ""path"": ""/api"" - }, - ""graphql"": { - ""path"": ""/graphql"", - ""allow-introspection"": true, ""nested-mutations"": { ""create"": {} } - }, - ""host"": { - ""mode"": ""development"", - ""cors"": { - ""origins"": [""http://localhost:5000""], - ""allow-credentials"": false - }, - ""authentication"": { - ""provider"": ""StaticWebApps"" - } - } - }, - ""entities"": {}" + - "}"; + }," + + HOST_AND_ENTITY_OPTIONS_CONFIG_JSON; public static RuntimeConfigProvider GenerateInMemoryRuntimeConfigProvider(RuntimeConfig runtimeConfig) { diff --git a/src/Service.Tests/dab-config.CosmosDb_NoSql.json b/src/Service.Tests/dab-config.CosmosDb_NoSql.json index 9c78698410..d079cb6bbc 100644 --- a/src/Service.Tests/dab-config.CosmosDb_NoSql.json +++ b/src/Service.Tests/dab-config.CosmosDb_NoSql.json @@ -18,12 +18,7 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true, - "nested-mutations": { - "create": { - "enabled": true - } - } + "allow-introspection": true }, "host": { "cors": { diff --git a/src/Service.Tests/dab-config.DwSql.json b/src/Service.Tests/dab-config.DwSql.json index d76dc856b0..8b9353385e 100644 --- a/src/Service.Tests/dab-config.DwSql.json +++ b/src/Service.Tests/dab-config.DwSql.json @@ -16,12 +16,7 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true, - "nested-mutations": { - "create": { - "enabled": true - } - } + "allow-introspection": true }, "host": { "cors": { diff --git a/src/Service.Tests/dab-config.MySql.json b/src/Service.Tests/dab-config.MySql.json index 64a4096511..97b143b18d 100644 --- a/src/Service.Tests/dab-config.MySql.json +++ b/src/Service.Tests/dab-config.MySql.json @@ -14,12 +14,7 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true, - "nested-mutations": { - "create": { - "enabled": true - } - } + "allow-introspection": true }, "host": { "cors": { diff --git a/src/Service.Tests/dab-config.PostgreSql.json b/src/Service.Tests/dab-config.PostgreSql.json index 7dc7cfdd74..8995a00b35 100644 --- a/src/Service.Tests/dab-config.PostgreSql.json +++ b/src/Service.Tests/dab-config.PostgreSql.json @@ -14,12 +14,7 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true, - "nested-mutations": { - "create": { - "enabled": true - } - } + "allow-introspection": true }, "host": { "cors": { From dd034f83da3a614e50b181f0877097de50829b59 Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Tue, 5 Mar 2024 14:59:00 +0530 Subject: [PATCH 26/28] fixing typo in variable name --- src/Service.Tests/TestHelper.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Service.Tests/TestHelper.cs b/src/Service.Tests/TestHelper.cs index 1f1dacaed3..466ca311ef 100644 --- a/src/Service.Tests/TestHelper.cs +++ b/src/Service.Tests/TestHelper.cs @@ -205,7 +205,7 @@ public static RuntimeConfig AddMissingEntitiesToConfig(RuntimeConfig config, str /// /// A json string with Runtime Rest and GraphQL options. This is used in constructing config json strings utilized for testing. /// - public const string RUNTIME_REST_GRAPQL_OPTIONS_CONFIG_JSON = + public const string RUNTIME_REST_GRAPHQL_OPTIONS_CONFIG_JSON = "{" + SAMPLE_SCHEMA_DATA_SOURCE + "," + @" @@ -240,7 +240,7 @@ public static RuntimeConfig AddMissingEntitiesToConfig(RuntimeConfig config, str /// A minimal valid config json with nested mutations section as null. /// public const string BASE_CONFIG_NULL_NESTED_MUTATIONS_FIELD = - RUNTIME_REST_GRAPQL_OPTIONS_CONFIG_JSON + + RUNTIME_REST_GRAPHQL_OPTIONS_CONFIG_JSON + @" ""nested-mutations"": null }," + @@ -251,7 +251,7 @@ public static RuntimeConfig AddMissingEntitiesToConfig(RuntimeConfig config, str /// public const string BASE_CONFIG_EMPTY_NESTED_MUTATIONS_FIELD = - RUNTIME_REST_GRAPQL_OPTIONS_CONFIG_JSON + + RUNTIME_REST_GRAPHQL_OPTIONS_CONFIG_JSON + @" ""nested-mutations"": {} }," + @@ -262,7 +262,7 @@ public static RuntimeConfig AddMissingEntitiesToConfig(RuntimeConfig config, str /// public const string BASE_CONFIG_NULL_NESTED_CREATE_FIELD = - RUNTIME_REST_GRAPQL_OPTIONS_CONFIG_JSON + + RUNTIME_REST_GRAPHQL_OPTIONS_CONFIG_JSON + @" ""nested-mutations"": { ""create"": null @@ -275,7 +275,7 @@ public static RuntimeConfig AddMissingEntitiesToConfig(RuntimeConfig config, str /// public const string BASE_CONFIG_EMPTY_NESTED_CREATE_FIELD = - RUNTIME_REST_GRAPQL_OPTIONS_CONFIG_JSON + + RUNTIME_REST_GRAPHQL_OPTIONS_CONFIG_JSON + @" ""nested-mutations"": { ""create"": {} From 8968befd6ebede02a591aa415a2b908b487744df Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Wed, 6 Mar 2024 12:32:15 +0530 Subject: [PATCH 27/28] removing fields from non-mssql db ref config files --- src/Service.Tests/Multidab-config.CosmosDb_NoSql.json | 7 +------ src/Service.Tests/Multidab-config.MySql.json | 7 +------ src/Service.Tests/Multidab-config.PostgreSql.json | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json b/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json index b1581bf40e..f9190ca2c9 100644 --- a/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json +++ b/src/Service.Tests/Multidab-config.CosmosDb_NoSql.json @@ -17,12 +17,7 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true, - "nested-mutations": { - "create": { - "enabled": true - } - } + "allow-introspection": true }, "host": { "cors": { diff --git a/src/Service.Tests/Multidab-config.MySql.json b/src/Service.Tests/Multidab-config.MySql.json index 241bd11e8e..efd7e7c973 100644 --- a/src/Service.Tests/Multidab-config.MySql.json +++ b/src/Service.Tests/Multidab-config.MySql.json @@ -12,12 +12,7 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true, - "nested-mutations": { - "create": { - "enabled": true - } - } + "allow-introspection": true }, "host": { "cors": { diff --git a/src/Service.Tests/Multidab-config.PostgreSql.json b/src/Service.Tests/Multidab-config.PostgreSql.json index 8bf51f8b6c..106e6d5ac2 100644 --- a/src/Service.Tests/Multidab-config.PostgreSql.json +++ b/src/Service.Tests/Multidab-config.PostgreSql.json @@ -12,12 +12,7 @@ "graphql": { "enabled": true, "path": "/graphql", - "allow-introspection": true, - "nested-mutations": { - "create": { - "enabled": true - } - } + "allow-introspection": true }, "host": { "cors": { From 8545c0162e1d8b27b0bda7e75e89840296aa87cf Mon Sep 17 00:00:00 2001 From: Shyam Sundar J Date: Mon, 11 Mar 2024 13:42:01 +0530 Subject: [PATCH 28/28] incorporates review comments --- schemas/dab.draft.schema.json | 2 +- src/Cli.Tests/EndToEndTests.cs | 39 ++++++++++++++----- src/Cli.Tests/InitTests.cs | 16 ++++++++ src/Cli/ConfigGenerator.cs | 7 +--- .../GraphQLRuntimeOptionsConverterFactory.cs | 2 +- .../Configuration/ConfigurationTests.cs | 8 ++-- 6 files changed, 53 insertions(+), 21 deletions(-) diff --git a/schemas/dab.draft.schema.json b/schemas/dab.draft.schema.json index 05f1fa8e48..4159308c18 100644 --- a/schemas/dab.draft.schema.json +++ b/schemas/dab.draft.schema.json @@ -178,7 +178,7 @@ }, "nested-mutations": { "type": "object", - "description": "Feature flags for nested mutation operations", + "description": "Configuration properties for nested mutation operations", "additionalProperties": false, "properties": { "create":{ diff --git a/src/Cli.Tests/EndToEndTests.cs b/src/Cli.Tests/EndToEndTests.cs index 74053f0cb3..f15b744d36 100644 --- a/src/Cli.Tests/EndToEndTests.cs +++ b/src/Cli.Tests/EndToEndTests.cs @@ -132,26 +132,48 @@ public void TestInitializingRestAndGraphQLGlobalSettings() } /// - /// Test to validate the successful generation of config file with the --graphql.nested-create.enabled option of the init command. + /// Test to validate the usage of --graphql.nested-create.enabled option of the init command for all database types. + /// + /// 1. Behavior for database types other than MsSQL: + /// - Irrespective of whether the --graphql.nested-create.enabled option is used or not, fields related to nested-create will NOT be written to the config file. + /// - As a result, after deserialization of such a config file, the Runtime.GraphQL.NestedMutationOptions is expected to be null. + /// 2. Behavior for MsSQL database type: + /// + /// a. When --graphql.nested-create.enabled option is used + /// - In this case, the fields related to nested mutation and nested create operations will be written to the config file. + /// "nested-mutations": { + /// "create": { + /// "enabled": true/false + /// } + /// } + /// After deserializing such a config file, the Runtime.GraphQL.NestedMutationOptions is expected to be non-null and the value of the "enabled" field is expected to be the same as the value passed in the init command. + /// + /// b. When --graphql.nested-create.enabled option is not used + /// - In this case, fields related to nested mutation and nested create operations will NOT be written to the config file. + /// - As a result, after deserialization of such a config file, the Runtime.GraphQL.NestedMutationOptions is expected to be null. + /// /// - /// Value for the nested create enabled flag in the init command. + /// Value interpreted by the CLI for '--graphql.nested-create.enabled' option of the init command. + /// When not used, CLI interprets the value for the option as CliBool.None + /// When used with true/false, CLI interprets the value as CliBool.True/CliBool.False respectively. + /// /// Expected value for the nested create enabled flag in the config file. [DataTestMethod] [DataRow(CliBool.True, "mssql", DatabaseType.MSSQL, DisplayName = "Init command with '--graphql.nested-create.enabled true' for MsSql database type")] [DataRow(CliBool.False, "mssql", DatabaseType.MSSQL, DisplayName = "Init command with '--graphql.nested-create.enabled false' for MsSql database type")] - [DataRow(CliBool.None, "mssql", DatabaseType.MSSQL, DisplayName = "Init command without '--graphql.nested-create.enabled true' for MsSql database type")] + [DataRow(CliBool.None, "mssql", DatabaseType.MSSQL, DisplayName = "Init command without '--graphql.nested-create.enabled' option for MsSql database type")] [DataRow(CliBool.True, "mysql", DatabaseType.MySQL, DisplayName = "Init command with '--graphql.nested-create.enabled true' for MySql database type")] [DataRow(CliBool.False, "mysql", DatabaseType.MySQL, DisplayName = "Init command with '--graphql.nested-create.enabled false' for MySql database type")] - [DataRow(CliBool.None, "mysql", DatabaseType.MySQL, DisplayName = "Init command without '--graphql.nested-create.enabled true' for MySql database type")] + [DataRow(CliBool.None, "mysql", DatabaseType.MySQL, DisplayName = "Init command without '--graphql.nested-create.enabled' option for MySql database type")] [DataRow(CliBool.True, "postgresql", DatabaseType.PostgreSQL, DisplayName = "Init command with '--graphql.nested-create.enabled true' for PostgreSql database type")] [DataRow(CliBool.False, "postgresql", DatabaseType.PostgreSQL, DisplayName = "Init command with '--graphql.nested-create.enabled false' for PostgreSql database type")] - [DataRow(CliBool.None, "postgresql", DatabaseType.PostgreSQL, DisplayName = "Init command without '--graphql.nested-create.enabled true' for PostgreSql database type")] + [DataRow(CliBool.None, "postgresql", DatabaseType.PostgreSQL, DisplayName = "Init command without '--graphql.nested-create.enabled' option for PostgreSql database type")] [DataRow(CliBool.True, "dwsql", DatabaseType.DWSQL, DisplayName = "Init command with '--graphql.nested-create.enabled true' for dwsql database type")] [DataRow(CliBool.False, "dwsql", DatabaseType.DWSQL, DisplayName = "Init command with '--graphql.nested-create.enabled false' for dwsql database type")] - [DataRow(CliBool.None, "dwsql", DatabaseType.DWSQL, DisplayName = "Init command without '--graphql.nested-create.enabled true' for dwsql database type")] + [DataRow(CliBool.None, "dwsql", DatabaseType.DWSQL, DisplayName = "Init command without '--graphql.nested-create.enabled' option for dwsql database type")] [DataRow(CliBool.True, "cosmosdb_nosql", DatabaseType.CosmosDB_NoSQL, DisplayName = "Init command with '--graphql.nested-create.enabled true' for cosmosdb_nosql database type")] [DataRow(CliBool.False, "cosmosdb_nosql", DatabaseType.CosmosDB_NoSQL, DisplayName = "Init command with '--graphql.nested-create.enabled false' for cosmosdb_nosql database type")] - [DataRow(CliBool.None, "cosmosdb_nosql", DatabaseType.CosmosDB_NoSQL, DisplayName = "Init command without '--graphql.nested-create.enabled true' for cosmosdb_nosql database type")] + [DataRow(CliBool.None, "cosmosdb_nosql", DatabaseType.CosmosDB_NoSQL, DisplayName = "Init command without '--graphql.nested-create.enabled' option for cosmosdb_nosql database type")] public void TestEnablingNestedCreateOperation(CliBool isNestedCreateEnabled, string dbType, DatabaseType expectedDbType) { List args = new() { "init", "-c", TEST_RUNTIME_CONFIG_FILE, "--connection-string", SAMPLE_TEST_CONN_STRING, "--database-type", dbType }; @@ -189,9 +211,8 @@ public void TestEnablingNestedCreateOperation(CliBool isNestedCreateEnabled, str } else { - Assert.IsNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions); + Assert.IsNull(runtimeConfig.Runtime.GraphQL.NestedMutationOptions, message: "NestedMutationOptions is expected to be null because a) DB type is not MsSQL or b) Either --graphql.nested-create.enabled option was not used or no value was provided."); } - } /// diff --git a/src/Cli.Tests/InitTests.cs b/src/Cli.Tests/InitTests.cs index 20d3b6ed6a..bfd0a7a19c 100644 --- a/src/Cli.Tests/InitTests.cs +++ b/src/Cli.Tests/InitTests.cs @@ -411,6 +411,22 @@ public Task GraphQLPathWithoutStartingSlashWillHaveItAdded() /// /// Test to validate the contents of the config file generated when init command is used with --graphql.nested-create.enabled flag option for different database types. + /// + /// 1. For database types other than MsSQL: + /// - Irrespective of whether the --graphql.nested-create.enabled option is used or not, fields related to nested-create will NOT be written to the config file. + /// + /// 2. For MsSQL database type: + /// a. When --graphql.nested-create.enabled option is used + /// - In this case, the fields related to nested mutation and nested create operations will be written to the config file. + /// "nested-mutations": { + /// "create": { + /// "enabled": true/false + /// } + /// } + /// + /// b. When --graphql.nested-create.enabled option is not used + /// - In this case, fields related to nested mutation and nested create operations will NOT be written to the config file. + /// /// [DataTestMethod] [DataRow(DatabaseType.MSSQL, CliBool.True, DisplayName = "Init command with '--graphql.nested-create.enabled true' for MsSQL database type")] diff --git a/src/Cli/ConfigGenerator.cs b/src/Cli/ConfigGenerator.cs index bbaf5aaa15..94ae62ab0d 100644 --- a/src/Cli/ConfigGenerator.cs +++ b/src/Cli/ConfigGenerator.cs @@ -313,12 +313,7 @@ private static bool TryDetermineIfApiIsEnabled(bool apiDisabledOptionValue, CliB /// True/False private static bool IsNestedCreateOperationEnabled(CliBool nestedCreateEnabledOptionValue) { - if (nestedCreateEnabledOptionValue is CliBool.None or CliBool.False) - { - return false; - } - - return true; + return nestedCreateEnabledOptionValue is CliBool.True; } /// diff --git a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs index 10dcb296f0..0101cbba87 100644 --- a/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs +++ b/src/Config/Converters/GraphQLRuntimeOptionsConverterFactory.cs @@ -87,7 +87,7 @@ internal GraphQLRuntimeOptionsConverter(bool replaceEnvVar) } else { - throw new JsonException($"Unexpected type of value entered for enabled: {reader.TokenType}"); + throw new JsonException($"Unsupported value entered for the property 'enabled': {reader.TokenType}"); } break; diff --git a/src/Service.Tests/Configuration/ConfigurationTests.cs b/src/Service.Tests/Configuration/ConfigurationTests.cs index 9c1ce274e7..48db66f758 100644 --- a/src/Service.Tests/Configuration/ConfigurationTests.cs +++ b/src/Service.Tests/Configuration/ConfigurationTests.cs @@ -1648,10 +1648,10 @@ public async Task TestSPRestDefaultsForManuallyConstructedConfigs( /// /// Base Config Json string. [DataTestMethod] - [DataRow(TestHelper.BASE_CONFIG_NULL_NESTED_MUTATIONS_FIELD, DisplayName = "Validate successful deserialization when nested mutation section is null")] - [DataRow(TestHelper.BASE_CONFIG_EMPTY_NESTED_MUTATIONS_FIELD, DisplayName = "Validate successful deserialization when nested mutation section is empty")] - [DataRow(TestHelper.BASE_CONFIG_NULL_NESTED_CREATE_FIELD, DisplayName = "Validate successful deserialization when create field within nested mutation section is null")] - [DataRow(TestHelper.BASE_CONFIG_EMPTY_NESTED_CREATE_FIELD, DisplayName = "Validate successful deserialization when create field within nested mutation section is empty")] + [DataRow(TestHelper.BASE_CONFIG_NULL_NESTED_MUTATIONS_FIELD, DisplayName = "NestedMutationOptions field deserialized as null when nested mutation section is null")] + [DataRow(TestHelper.BASE_CONFIG_EMPTY_NESTED_MUTATIONS_FIELD, DisplayName = "NestedMutationOptions field deserialized as null when nested mutation section is empty")] + [DataRow(TestHelper.BASE_CONFIG_NULL_NESTED_CREATE_FIELD, DisplayName = "NestedMutationOptions field deserialized as null when create field within nested mutation section is null")] + [DataRow(TestHelper.BASE_CONFIG_EMPTY_NESTED_CREATE_FIELD, DisplayName = "NestedMutationOptions field deserialized as null when create field within nested mutation section is empty")] public void ValidateDeserializationOfConfigWithNullOrEmptyInvalidNestedMutationSection(string baseConfig) { string configJson = TestHelper.AddPropertiesToJson(baseConfig, BOOK_ENTITY_JSON);