diff --git a/.devcontainer/backend/dockerfile b/.devcontainer/backend/dockerfile index 1f5547c0a08..8072796f0d6 100644 --- a/.devcontainer/backend/dockerfile +++ b/.devcontainer/backend/dockerfile @@ -25,14 +25,13 @@ EXPOSE 22 # Start SSH service CMD ["/usr/sbin/sshd", "-D"] -# Install .NET SDKs (6, 7, 8, 9, and 10) +# Install .NET SDKs (8, 9, 10, and 11) RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh \ && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --channel 6.0 --install-dir /usr/share/dotnet \ - && ./dotnet-install.sh --channel 7.0 --install-dir /usr/share/dotnet \ && ./dotnet-install.sh --channel 8.0 --install-dir /usr/share/dotnet \ && ./dotnet-install.sh --channel 9.0 --install-dir /usr/share/dotnet \ && ./dotnet-install.sh --channel 10.0 --install-dir /usr/share/dotnet \ + && ./dotnet-install.sh --channel 11.0 --install-dir /usr/share/dotnet \ && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet # Install Node.js LTS diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 07ba07dcf40..70eeba130eb 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -142,7 +142,7 @@ jobs: echo "Installing .NET..." curl -sSL https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh chmod +x dotnet-install.sh - ./dotnet-install.sh --channel 10.0 --install-dir $HOME/.dotnet + ./dotnet-install.sh --version 11.0.100-preview.4.26230.115 --install-dir $HOME/.dotnet rm dotnet-install.sh echo "$HOME/.dotnet" >> $GITHUB_PATH export PATH="$HOME/.dotnet:$PATH" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80c835b0644..5faa50f244e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,10 +251,11 @@ jobs: 8.x 9.x 10.x + 11.0.100-preview.4.26230.115 - name: Run Build id: run-build - run: dotnet build ${{ matrix.path }} --framework net10.0 --verbosity q + run: dotnet build ${{ matrix.path }} --framework net11.0 --verbosity q timeout-minutes: 5 - name: Log in to Docker Hub @@ -275,7 +276,7 @@ jobs: run: > dotnet test --project ${{ matrix.path }} - --framework net10.0 + --framework net11.0 --no-build --coverage --coverage-output-format cobertura @@ -320,7 +321,7 @@ jobs: - name: Install .NET uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0 with: - dotnet-version: 10.x + dotnet-version: 11.0.100-preview.4.26230.115 - name: Install dotnet-coverage run: | diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index c9f81a29da9..2ca4a3fc13b 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -57,10 +57,11 @@ jobs: 8.x 9.x 10.x + 11.0.100-preview.4.26230.115 - name: Run Build id: run-build - run: dotnet build ${{ matrix.path }} --framework net10.0 --verbosity q + run: dotnet build ${{ matrix.path }} --framework net11.0 --verbosity q timeout-minutes: 5 - name: Log in to Docker Hub @@ -76,7 +77,7 @@ jobs: run: > dotnet test --project ${{ matrix.path }} - --framework net10.0 + --framework net11.0 --no-build --coverage --coverage-output-format cobertura @@ -128,7 +129,7 @@ jobs: - name: Install .NET uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0 with: - dotnet-version: 10.x + dotnet-version: 11.0.100-preview.4.26230.115 - name: Install dotnet-coverage run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c40f300d789..8a975a9f611 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -125,6 +125,7 @@ jobs: 8.x 9.x 10.x + 11.0.100-preview.4.26230.115 - name: 🖍️ Stamp template PackageReference versions shell: bash @@ -245,7 +246,7 @@ jobs: - name: 🛠 Install .NET uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0 with: - dotnet-version: 10.x + dotnet-version: 11.0.100-preview.4.26230.115 - name: 📦 Publish binary shell: bash @@ -253,11 +254,11 @@ jobs: dotnet publish src/Nitro/CommandLine/src/CommandLine \ -c Release \ -r ${{ matrix.rid }} \ - -f net10.0 \ + -f net11.0 \ -o publish \ --self-contained \ -p:PublishAot=true \ - -p:TargetFrameworks=net10.0 \ + -p:TargetFrameworks=net11.0 \ -p:RuntimeIdentifiers=${{ matrix.rid }} \ -p:Version=${GIT_TAG} \ -p:NitroApiClientId="${NitroApiClientId}" \ diff --git a/global.json b/global.json index bc475284a04..27c376b4494 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "10.0.201", + "version": "11.0.100-preview.4.26230.115", "rollForward": "latestMinor" }, "test": { diff --git a/src/CookieCrumble/src/CookieCrumble.Xunit/CookieCrumble.Xunit.csproj b/src/CookieCrumble/src/CookieCrumble.Xunit/CookieCrumble.Xunit.csproj index 5b59a5a8a45..aee6e2a2f20 100644 --- a/src/CookieCrumble/src/CookieCrumble.Xunit/CookieCrumble.Xunit.csproj +++ b/src/CookieCrumble/src/CookieCrumble.Xunit/CookieCrumble.Xunit.csproj @@ -27,7 +27,7 @@ fires per framework) to avoid a duplicate package-path collision. --> - + diff --git a/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumble.Xunit3.csproj b/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumble.Xunit3.csproj index ea665591b4c..3c8b519b7b3 100644 --- a/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumble.Xunit3.csproj +++ b/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumble.Xunit3.csproj @@ -26,7 +26,7 @@ fires per framework) to avoid a duplicate package-path collision. --> - + diff --git a/src/CookieCrumble/src/CookieCrumble/Utilities/TestEnvironment.cs b/src/CookieCrumble/src/CookieCrumble/Utilities/TestEnvironment.cs index 5d8ccbb8f88..e20c81110b0 100644 --- a/src/CookieCrumble/src/CookieCrumble/Utilities/TestEnvironment.cs +++ b/src/CookieCrumble/src/CookieCrumble/Utilities/TestEnvironment.cs @@ -7,23 +7,64 @@ namespace CookieCrumble; /// public static class TestEnvironment { + // ReSharper disable InconsistentNaming + public const string NET8_0 = "NET8_0"; + public const string NET9_0 = "NET9_0"; + public const string NET10_0 = "NET10_0"; + public const string NET11_0 = "NET11_0"; + // ReSharper restore InconsistentNaming + #if NET8_0 /// /// The target framework identifier. /// - public const string TargetFramework = "NET8_0"; + public const string TargetFramework = NET8_0; #elif NET9_0 /// /// The target framework identifier. /// - public const string TargetFramework = "NET9_0"; + public const string TargetFramework = NET9_0; #elif NET10_0 /// /// The target framework identifier. /// - public const string TargetFramework = "NET10_0"; + public const string TargetFramework = NET10_0; +#elif NET11_0 + /// + /// The target framework identifier. + /// + public const string TargetFramework = NET11_0; #endif + /// + /// Returns a postfix for the snapshot name based on the target framework. + /// + /// + /// Postfix(["NET8_0", "NET9_0"], ["NET10_0"]) will return "NET8_0_NET9_0" if the target framework is + /// NET8_0 or NET9_0, "NET10_0" if the target framework is NET10_0, or null if + /// the target framework is NET11_0. + /// + /// + /// A list of target framework groups. Each group is a list of target frameworks that should share the same snapshot + /// postfix. + /// + /// + /// A postfix for the snapshot name based on the target framework, or null if the target framework does not match + /// any group. + /// + public static string? Postfix(params string[][] targetFrameworkGroups) + { + foreach (var group in targetFrameworkGroups) + { + if (group.Contains(TargetFramework)) + { + return string.Join("_", group); + } + } + + return null; + } + public static bool IsLocalEnvironment() { return !IsCIEnvironment(); diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 569b718cbf0..858b7db0b11 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -10,6 +10,10 @@ en + + $(Features);runtime-async=on + + true NU1901;NU1902;NU1903;NU1904;ASPDEPR004;ASPDEPR008 @@ -38,9 +42,9 @@ - net10.0; net9.0; net8.0 - net10.0; net9.0; net8.0; netstandard2.0 - net10.0; net9.0 + net11.0; net10.0; net9.0; net8.0 + net11.0; net10.0; net9.0; net8.0; netstandard2.0 + net11.0; net10.0; net9.0 diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 48468f60ae8..37085fea2c0 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -7,9 +7,10 @@ - - - + + + + @@ -80,6 +81,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/PagingHelperPostgreSqlNullableTests.cs b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/PagingHelperPostgreSqlNullableTests.cs index 633fee4fb9c..0a7c458e001 100644 --- a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/PagingHelperPostgreSqlNullableTests.cs +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/PagingHelperPostgreSqlNullableTests.cs @@ -68,7 +68,7 @@ public async Task Paging_Nullable_Descending_Cursor_Value_NonNull() // Assert var snapshot = new Snapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" + postFix: TestEnvironment.TargetFramework == "NET10_0" || TestEnvironment.TargetFramework == "NET11_0" ? TestEnvironment.TargetFramework : null); snapshot.Add(page1); @@ -135,7 +135,7 @@ public async Task Paging_Nullable_Descending_Cursor_Value_Null() // Assert var snapshot = new Snapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" + postFix: TestEnvironment.TargetFramework == "NET10_0" || TestEnvironment.TargetFramework == "NET11_0" ? TestEnvironment.TargetFramework : null); snapshot.Add(page1); @@ -202,7 +202,7 @@ public async Task Paging_NullableReference_Descending_Cursor_Value_NonNull() // Assert var snapshot = new Snapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" + postFix: TestEnvironment.TargetFramework == "NET10_0" || TestEnvironment.TargetFramework == "NET11_0" ? TestEnvironment.TargetFramework : null); snapshot.Add(page1); @@ -269,7 +269,7 @@ public async Task Paging_NullableReference_Descending_Cursor_Value_Null() // Assert var snapshot = new Snapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" + postFix: TestEnvironment.TargetFramework == "NET10_0" || TestEnvironment.TargetFramework == "NET11_0" ? TestEnvironment.TargetFramework : null); snapshot.Add(page1); diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Empty_PagingArgs_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Empty_PagingArgs_NET11_0.md new file mode 100644 index 00000000000..9e6906bccd4 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Empty_PagingArgs_NET11_0.md @@ -0,0 +1,157 @@ +# Paging_Empty_PagingArgs + +## SQL 0 + +```sql +-- @p='11' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(11) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": false, + "First": 1, + "FirstCursor": "e31CcmFuZFw6MDox", + "Last": 18, + "LastCursor": "e31CcmFuZFw6MTc6MTg=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 1, + "Name": "Brand:0", + "DisplayName": "BrandDisplay0", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country0" + } + } + }, + { + "Id": 2, + "Name": "Brand:1", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country1" + } + } + }, + { + "Id": 11, + "Name": "Brand:10", + "DisplayName": "BrandDisplay10", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country10" + } + } + }, + { + "Id": 12, + "Name": "Brand:11", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country11" + } + } + }, + { + "Id": 13, + "Name": "Brand:12", + "DisplayName": "BrandDisplay12", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country12" + } + } + }, + { + "Id": 14, + "Name": "Brand:13", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country13" + } + } + }, + { + "Id": 15, + "Name": "Brand:14", + "DisplayName": "BrandDisplay14", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country14" + } + } + }, + { + "Id": 16, + "Name": "Brand:15", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country15" + } + } + }, + { + "Id": 17, + "Name": "Brand:16", + "DisplayName": "BrandDisplay16", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country16" + } + } + }, + { + "Id": 18, + "Name": "Brand:17", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country17" + } + } + } +] +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_After_Id_13_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_After_Id_13_NET11_0.md new file mode 100644 index 00000000000..523d62543d2 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_After_Id_13_NET11_0.md @@ -0,0 +1,100 @@ +# Paging_First_5_After_Id_13 + +## SQL 0 + +```sql +-- @value='Brand12' +-- @value2='13' +-- @p='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value2) +ORDER BY b."Name", b."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Where(t => ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) > 0) OrElse ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.Int32]).value) > 0)))).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": true, + "First": 14, + "FirstCursor": "e31CcmFuZFw6MTM6MTQ=", + "Last": 18, + "LastCursor": "e31CcmFuZFw6MTc6MTg=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 14, + "Name": "Brand:13", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country13" + } + } + }, + { + "Id": 15, + "Name": "Brand:14", + "DisplayName": "BrandDisplay14", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country14" + } + } + }, + { + "Id": 16, + "Name": "Brand:15", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country15" + } + } + }, + { + "Id": 17, + "Name": "Brand:16", + "DisplayName": "BrandDisplay16", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country16" + } + } + }, + { + "Id": 18, + "Name": "Brand:17", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country17" + } + } + } +] +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_Before_Id_96_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_Before_Id_96_NET11_0.md new file mode 100644 index 00000000000..54541548bc0 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_Before_Id_96_NET11_0.md @@ -0,0 +1,100 @@ +# Paging_First_5_Before_Id_96 + +## SQL 0 + +```sql +-- @value='Brand95' +-- @value2='96' +-- @p='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."Name" < @value OR (b."Name" = @value AND b."Id" < @value2) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderByDescending(t => t.Name).ThenByDescending(t => t.Id).Where(t => ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) < 0) OrElse ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.Int32]).value) < 0)))).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": true, + "First": 92, + "FirstCursor": "e31CcmFuZFw6OTE6OTI=", + "Last": 96, + "LastCursor": "e31CcmFuZFw6OTU6OTY=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 92, + "Name": "Brand:91", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country91" + } + } + }, + { + "Id": 93, + "Name": "Brand:92", + "DisplayName": "BrandDisplay92", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country92" + } + } + }, + { + "Id": 94, + "Name": "Brand:93", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country93" + } + } + }, + { + "Id": 95, + "Name": "Brand:94", + "DisplayName": "BrandDisplay94", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country94" + } + } + }, + { + "Id": 96, + "Name": "Brand:95", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country95" + } + } + } +] +``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_NET10_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_NET11_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_NET10_0.md rename to src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_NET11_0.md diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5_NET11_0.md new file mode 100644 index 00000000000..62fc929f0d1 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5_NET11_0.md @@ -0,0 +1,99 @@ +# Paging_Last_5 + +## SQL 0 + +```sql +-- @p='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderByDescending(t => t.Name).ThenByDescending(t => t.Id).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": false, + "HasPreviousPage": true, + "First": 96, + "FirstName": "Brand:95", + "FirstCursor": "e31CcmFuZFw6OTU6OTY=", + "Last": 100, + "LastName": "Brand:99", + "LastCursor": "e31CcmFuZFw6OTk6MTAw" +} +``` + +## Result 4 + +```json +[ + { + "Id": 96, + "Name": "Brand:95", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country95" + } + } + }, + { + "Id": 97, + "Name": "Brand:96", + "DisplayName": "BrandDisplay96", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country96" + } + } + }, + { + "Id": 98, + "Name": "Brand:97", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country97" + } + } + }, + { + "Id": 99, + "Name": "Brand:98", + "DisplayName": "BrandDisplay98", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country98" + } + } + }, + { + "Id": 100, + "Name": "Brand:99", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country99" + } + } + } +] +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_WithChildCollectionProjectionExpression_First_5_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_WithChildCollectionProjectionExpression_First_5_NET11_0.md new file mode 100644 index 00000000000..3ba49c728ef --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_WithChildCollectionProjectionExpression_First_5_NET11_0.md @@ -0,0 +1,2072 @@ +# Paging_WithChildCollectionProjectionExpression_First_5 + +## SQL 0 + +```sql +-- @p='6' +SELECT b0."Id", b0."Name", p."Id", p."Name" +FROM ( + SELECT b."Id", b."Name" + FROM "Brands" AS b + ORDER BY b."Name", b."Id" + LIMIT @p +) AS b0 +LEFT JOIN "Products" AS p ON b0."Id" = p."BrandId" +ORDER BY b0."Name", b0."Id" +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].Select(brand => new BrandWithProductsDto() {Id = brand.Id, Name = brand.Name, Products = brand.Products.AsQueryable().Select(ProductDto.Projection).ToList()}).OrderBy(t => t.Name).ThenBy(t => t.Id).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": false, + "First": 1, + "FirstCursor": "e31CcmFuZFw6MDox", + "Last": 13, + "LastCursor": "e31CcmFuZFw6MTI6MTM=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 1, + "Name": "Brand:0", + "Products": [ + { + "Id": 1, + "Name": "Product 0-0" + }, + { + "Id": 2, + "Name": "Product 0-1" + }, + { + "Id": 3, + "Name": "Product 0-2" + }, + { + "Id": 4, + "Name": "Product 0-3" + }, + { + "Id": 5, + "Name": "Product 0-4" + }, + { + "Id": 6, + "Name": "Product 0-5" + }, + { + "Id": 7, + "Name": "Product 0-6" + }, + { + "Id": 8, + "Name": "Product 0-7" + }, + { + "Id": 9, + "Name": "Product 0-8" + }, + { + "Id": 10, + "Name": "Product 0-9" + }, + { + "Id": 11, + "Name": "Product 0-10" + }, + { + "Id": 12, + "Name": "Product 0-11" + }, + { + "Id": 13, + "Name": "Product 0-12" + }, + { + "Id": 14, + "Name": "Product 0-13" + }, + { + "Id": 15, + "Name": "Product 0-14" + }, + { + "Id": 16, + "Name": "Product 0-15" + }, + { + "Id": 17, + "Name": "Product 0-16" + }, + { + "Id": 18, + "Name": "Product 0-17" + }, + { + "Id": 19, + "Name": "Product 0-18" + }, + { + "Id": 20, + "Name": "Product 0-19" + }, + { + "Id": 21, + "Name": "Product 0-20" + }, + { + "Id": 22, + "Name": "Product 0-21" + }, + { + "Id": 23, + "Name": "Product 0-22" + }, + { + "Id": 24, + "Name": "Product 0-23" + }, + { + "Id": 25, + "Name": "Product 0-24" + }, + { + "Id": 26, + "Name": "Product 0-25" + }, + { + "Id": 27, + "Name": "Product 0-26" + }, + { + "Id": 28, + "Name": "Product 0-27" + }, + { + "Id": 29, + "Name": "Product 0-28" + }, + { + "Id": 30, + "Name": "Product 0-29" + }, + { + "Id": 31, + "Name": "Product 0-30" + }, + { + "Id": 32, + "Name": "Product 0-31" + }, + { + "Id": 33, + "Name": "Product 0-32" + }, + { + "Id": 34, + "Name": "Product 0-33" + }, + { + "Id": 35, + "Name": "Product 0-34" + }, + { + "Id": 36, + "Name": "Product 0-35" + }, + { + "Id": 37, + "Name": "Product 0-36" + }, + { + "Id": 38, + "Name": "Product 0-37" + }, + { + "Id": 39, + "Name": "Product 0-38" + }, + { + "Id": 40, + "Name": "Product 0-39" + }, + { + "Id": 41, + "Name": "Product 0-40" + }, + { + "Id": 42, + "Name": "Product 0-41" + }, + { + "Id": 43, + "Name": "Product 0-42" + }, + { + "Id": 44, + "Name": "Product 0-43" + }, + { + "Id": 45, + "Name": "Product 0-44" + }, + { + "Id": 46, + "Name": "Product 0-45" + }, + { + "Id": 47, + "Name": "Product 0-46" + }, + { + "Id": 48, + "Name": "Product 0-47" + }, + { + "Id": 49, + "Name": "Product 0-48" + }, + { + "Id": 50, + "Name": "Product 0-49" + }, + { + "Id": 51, + "Name": "Product 0-50" + }, + { + "Id": 52, + "Name": "Product 0-51" + }, + { + "Id": 53, + "Name": "Product 0-52" + }, + { + "Id": 54, + "Name": "Product 0-53" + }, + { + "Id": 55, + "Name": "Product 0-54" + }, + { + "Id": 56, + "Name": "Product 0-55" + }, + { + "Id": 57, + "Name": "Product 0-56" + }, + { + "Id": 58, + "Name": "Product 0-57" + }, + { + "Id": 59, + "Name": "Product 0-58" + }, + { + "Id": 60, + "Name": "Product 0-59" + }, + { + "Id": 61, + "Name": "Product 0-60" + }, + { + "Id": 62, + "Name": "Product 0-61" + }, + { + "Id": 63, + "Name": "Product 0-62" + }, + { + "Id": 64, + "Name": "Product 0-63" + }, + { + "Id": 65, + "Name": "Product 0-64" + }, + { + "Id": 66, + "Name": "Product 0-65" + }, + { + "Id": 67, + "Name": "Product 0-66" + }, + { + "Id": 68, + "Name": "Product 0-67" + }, + { + "Id": 69, + "Name": "Product 0-68" + }, + { + "Id": 70, + "Name": "Product 0-69" + }, + { + "Id": 71, + "Name": "Product 0-70" + }, + { + "Id": 72, + "Name": "Product 0-71" + }, + { + "Id": 73, + "Name": "Product 0-72" + }, + { + "Id": 74, + "Name": "Product 0-73" + }, + { + "Id": 75, + "Name": "Product 0-74" + }, + { + "Id": 76, + "Name": "Product 0-75" + }, + { + "Id": 77, + "Name": "Product 0-76" + }, + { + "Id": 78, + "Name": "Product 0-77" + }, + { + "Id": 79, + "Name": "Product 0-78" + }, + { + "Id": 80, + "Name": "Product 0-79" + }, + { + "Id": 81, + "Name": "Product 0-80" + }, + { + "Id": 82, + "Name": "Product 0-81" + }, + { + "Id": 83, + "Name": "Product 0-82" + }, + { + "Id": 84, + "Name": "Product 0-83" + }, + { + "Id": 85, + "Name": "Product 0-84" + }, + { + "Id": 86, + "Name": "Product 0-85" + }, + { + "Id": 87, + "Name": "Product 0-86" + }, + { + "Id": 88, + "Name": "Product 0-87" + }, + { + "Id": 89, + "Name": "Product 0-88" + }, + { + "Id": 90, + "Name": "Product 0-89" + }, + { + "Id": 91, + "Name": "Product 0-90" + }, + { + "Id": 92, + "Name": "Product 0-91" + }, + { + "Id": 93, + "Name": "Product 0-92" + }, + { + "Id": 94, + "Name": "Product 0-93" + }, + { + "Id": 95, + "Name": "Product 0-94" + }, + { + "Id": 96, + "Name": "Product 0-95" + }, + { + "Id": 97, + "Name": "Product 0-96" + }, + { + "Id": 98, + "Name": "Product 0-97" + }, + { + "Id": 99, + "Name": "Product 0-98" + }, + { + "Id": 100, + "Name": "Product 0-99" + } + ] + }, + { + "Id": 2, + "Name": "Brand:1", + "Products": [ + { + "Id": 101, + "Name": "Product 1-0" + }, + { + "Id": 102, + "Name": "Product 1-1" + }, + { + "Id": 103, + "Name": "Product 1-2" + }, + { + "Id": 104, + "Name": "Product 1-3" + }, + { + "Id": 105, + "Name": "Product 1-4" + }, + { + "Id": 106, + "Name": "Product 1-5" + }, + { + "Id": 107, + "Name": "Product 1-6" + }, + { + "Id": 108, + "Name": "Product 1-7" + }, + { + "Id": 109, + "Name": "Product 1-8" + }, + { + "Id": 110, + "Name": "Product 1-9" + }, + { + "Id": 111, + "Name": "Product 1-10" + }, + { + "Id": 112, + "Name": "Product 1-11" + }, + { + "Id": 113, + "Name": "Product 1-12" + }, + { + "Id": 114, + "Name": "Product 1-13" + }, + { + "Id": 115, + "Name": "Product 1-14" + }, + { + "Id": 116, + "Name": "Product 1-15" + }, + { + "Id": 117, + "Name": "Product 1-16" + }, + { + "Id": 118, + "Name": "Product 1-17" + }, + { + "Id": 119, + "Name": "Product 1-18" + }, + { + "Id": 120, + "Name": "Product 1-19" + }, + { + "Id": 121, + "Name": "Product 1-20" + }, + { + "Id": 122, + "Name": "Product 1-21" + }, + { + "Id": 123, + "Name": "Product 1-22" + }, + { + "Id": 124, + "Name": "Product 1-23" + }, + { + "Id": 125, + "Name": "Product 1-24" + }, + { + "Id": 126, + "Name": "Product 1-25" + }, + { + "Id": 127, + "Name": "Product 1-26" + }, + { + "Id": 128, + "Name": "Product 1-27" + }, + { + "Id": 129, + "Name": "Product 1-28" + }, + { + "Id": 130, + "Name": "Product 1-29" + }, + { + "Id": 131, + "Name": "Product 1-30" + }, + { + "Id": 132, + "Name": "Product 1-31" + }, + { + "Id": 133, + "Name": "Product 1-32" + }, + { + "Id": 134, + "Name": "Product 1-33" + }, + { + "Id": 135, + "Name": "Product 1-34" + }, + { + "Id": 136, + "Name": "Product 1-35" + }, + { + "Id": 137, + "Name": "Product 1-36" + }, + { + "Id": 138, + "Name": "Product 1-37" + }, + { + "Id": 139, + "Name": "Product 1-38" + }, + { + "Id": 140, + "Name": "Product 1-39" + }, + { + "Id": 141, + "Name": "Product 1-40" + }, + { + "Id": 142, + "Name": "Product 1-41" + }, + { + "Id": 143, + "Name": "Product 1-42" + }, + { + "Id": 144, + "Name": "Product 1-43" + }, + { + "Id": 145, + "Name": "Product 1-44" + }, + { + "Id": 146, + "Name": "Product 1-45" + }, + { + "Id": 147, + "Name": "Product 1-46" + }, + { + "Id": 148, + "Name": "Product 1-47" + }, + { + "Id": 149, + "Name": "Product 1-48" + }, + { + "Id": 150, + "Name": "Product 1-49" + }, + { + "Id": 151, + "Name": "Product 1-50" + }, + { + "Id": 152, + "Name": "Product 1-51" + }, + { + "Id": 153, + "Name": "Product 1-52" + }, + { + "Id": 154, + "Name": "Product 1-53" + }, + { + "Id": 155, + "Name": "Product 1-54" + }, + { + "Id": 156, + "Name": "Product 1-55" + }, + { + "Id": 157, + "Name": "Product 1-56" + }, + { + "Id": 158, + "Name": "Product 1-57" + }, + { + "Id": 159, + "Name": "Product 1-58" + }, + { + "Id": 160, + "Name": "Product 1-59" + }, + { + "Id": 161, + "Name": "Product 1-60" + }, + { + "Id": 162, + "Name": "Product 1-61" + }, + { + "Id": 163, + "Name": "Product 1-62" + }, + { + "Id": 164, + "Name": "Product 1-63" + }, + { + "Id": 165, + "Name": "Product 1-64" + }, + { + "Id": 166, + "Name": "Product 1-65" + }, + { + "Id": 167, + "Name": "Product 1-66" + }, + { + "Id": 168, + "Name": "Product 1-67" + }, + { + "Id": 169, + "Name": "Product 1-68" + }, + { + "Id": 170, + "Name": "Product 1-69" + }, + { + "Id": 171, + "Name": "Product 1-70" + }, + { + "Id": 172, + "Name": "Product 1-71" + }, + { + "Id": 173, + "Name": "Product 1-72" + }, + { + "Id": 174, + "Name": "Product 1-73" + }, + { + "Id": 175, + "Name": "Product 1-74" + }, + { + "Id": 176, + "Name": "Product 1-75" + }, + { + "Id": 177, + "Name": "Product 1-76" + }, + { + "Id": 178, + "Name": "Product 1-77" + }, + { + "Id": 179, + "Name": "Product 1-78" + }, + { + "Id": 180, + "Name": "Product 1-79" + }, + { + "Id": 181, + "Name": "Product 1-80" + }, + { + "Id": 182, + "Name": "Product 1-81" + }, + { + "Id": 183, + "Name": "Product 1-82" + }, + { + "Id": 184, + "Name": "Product 1-83" + }, + { + "Id": 185, + "Name": "Product 1-84" + }, + { + "Id": 186, + "Name": "Product 1-85" + }, + { + "Id": 187, + "Name": "Product 1-86" + }, + { + "Id": 188, + "Name": "Product 1-87" + }, + { + "Id": 189, + "Name": "Product 1-88" + }, + { + "Id": 190, + "Name": "Product 1-89" + }, + { + "Id": 191, + "Name": "Product 1-90" + }, + { + "Id": 192, + "Name": "Product 1-91" + }, + { + "Id": 193, + "Name": "Product 1-92" + }, + { + "Id": 194, + "Name": "Product 1-93" + }, + { + "Id": 195, + "Name": "Product 1-94" + }, + { + "Id": 196, + "Name": "Product 1-95" + }, + { + "Id": 197, + "Name": "Product 1-96" + }, + { + "Id": 198, + "Name": "Product 1-97" + }, + { + "Id": 199, + "Name": "Product 1-98" + }, + { + "Id": 200, + "Name": "Product 1-99" + } + ] + }, + { + "Id": 11, + "Name": "Brand:10", + "Products": [ + { + "Id": 1001, + "Name": "Product 10-0" + }, + { + "Id": 1002, + "Name": "Product 10-1" + }, + { + "Id": 1003, + "Name": "Product 10-2" + }, + { + "Id": 1004, + "Name": "Product 10-3" + }, + { + "Id": 1005, + "Name": "Product 10-4" + }, + { + "Id": 1006, + "Name": "Product 10-5" + }, + { + "Id": 1007, + "Name": "Product 10-6" + }, + { + "Id": 1008, + "Name": "Product 10-7" + }, + { + "Id": 1009, + "Name": "Product 10-8" + }, + { + "Id": 1010, + "Name": "Product 10-9" + }, + { + "Id": 1011, + "Name": "Product 10-10" + }, + { + "Id": 1012, + "Name": "Product 10-11" + }, + { + "Id": 1013, + "Name": "Product 10-12" + }, + { + "Id": 1014, + "Name": "Product 10-13" + }, + { + "Id": 1015, + "Name": "Product 10-14" + }, + { + "Id": 1016, + "Name": "Product 10-15" + }, + { + "Id": 1017, + "Name": "Product 10-16" + }, + { + "Id": 1018, + "Name": "Product 10-17" + }, + { + "Id": 1019, + "Name": "Product 10-18" + }, + { + "Id": 1020, + "Name": "Product 10-19" + }, + { + "Id": 1021, + "Name": "Product 10-20" + }, + { + "Id": 1022, + "Name": "Product 10-21" + }, + { + "Id": 1023, + "Name": "Product 10-22" + }, + { + "Id": 1024, + "Name": "Product 10-23" + }, + { + "Id": 1025, + "Name": "Product 10-24" + }, + { + "Id": 1026, + "Name": "Product 10-25" + }, + { + "Id": 1027, + "Name": "Product 10-26" + }, + { + "Id": 1028, + "Name": "Product 10-27" + }, + { + "Id": 1029, + "Name": "Product 10-28" + }, + { + "Id": 1030, + "Name": "Product 10-29" + }, + { + "Id": 1031, + "Name": "Product 10-30" + }, + { + "Id": 1032, + "Name": "Product 10-31" + }, + { + "Id": 1033, + "Name": "Product 10-32" + }, + { + "Id": 1034, + "Name": "Product 10-33" + }, + { + "Id": 1035, + "Name": "Product 10-34" + }, + { + "Id": 1036, + "Name": "Product 10-35" + }, + { + "Id": 1037, + "Name": "Product 10-36" + }, + { + "Id": 1038, + "Name": "Product 10-37" + }, + { + "Id": 1039, + "Name": "Product 10-38" + }, + { + "Id": 1040, + "Name": "Product 10-39" + }, + { + "Id": 1041, + "Name": "Product 10-40" + }, + { + "Id": 1042, + "Name": "Product 10-41" + }, + { + "Id": 1043, + "Name": "Product 10-42" + }, + { + "Id": 1044, + "Name": "Product 10-43" + }, + { + "Id": 1045, + "Name": "Product 10-44" + }, + { + "Id": 1046, + "Name": "Product 10-45" + }, + { + "Id": 1047, + "Name": "Product 10-46" + }, + { + "Id": 1048, + "Name": "Product 10-47" + }, + { + "Id": 1049, + "Name": "Product 10-48" + }, + { + "Id": 1050, + "Name": "Product 10-49" + }, + { + "Id": 1051, + "Name": "Product 10-50" + }, + { + "Id": 1052, + "Name": "Product 10-51" + }, + { + "Id": 1053, + "Name": "Product 10-52" + }, + { + "Id": 1054, + "Name": "Product 10-53" + }, + { + "Id": 1055, + "Name": "Product 10-54" + }, + { + "Id": 1056, + "Name": "Product 10-55" + }, + { + "Id": 1057, + "Name": "Product 10-56" + }, + { + "Id": 1058, + "Name": "Product 10-57" + }, + { + "Id": 1059, + "Name": "Product 10-58" + }, + { + "Id": 1060, + "Name": "Product 10-59" + }, + { + "Id": 1061, + "Name": "Product 10-60" + }, + { + "Id": 1062, + "Name": "Product 10-61" + }, + { + "Id": 1063, + "Name": "Product 10-62" + }, + { + "Id": 1064, + "Name": "Product 10-63" + }, + { + "Id": 1065, + "Name": "Product 10-64" + }, + { + "Id": 1066, + "Name": "Product 10-65" + }, + { + "Id": 1067, + "Name": "Product 10-66" + }, + { + "Id": 1068, + "Name": "Product 10-67" + }, + { + "Id": 1069, + "Name": "Product 10-68" + }, + { + "Id": 1070, + "Name": "Product 10-69" + }, + { + "Id": 1071, + "Name": "Product 10-70" + }, + { + "Id": 1072, + "Name": "Product 10-71" + }, + { + "Id": 1073, + "Name": "Product 10-72" + }, + { + "Id": 1074, + "Name": "Product 10-73" + }, + { + "Id": 1075, + "Name": "Product 10-74" + }, + { + "Id": 1076, + "Name": "Product 10-75" + }, + { + "Id": 1077, + "Name": "Product 10-76" + }, + { + "Id": 1078, + "Name": "Product 10-77" + }, + { + "Id": 1079, + "Name": "Product 10-78" + }, + { + "Id": 1080, + "Name": "Product 10-79" + }, + { + "Id": 1081, + "Name": "Product 10-80" + }, + { + "Id": 1082, + "Name": "Product 10-81" + }, + { + "Id": 1083, + "Name": "Product 10-82" + }, + { + "Id": 1084, + "Name": "Product 10-83" + }, + { + "Id": 1085, + "Name": "Product 10-84" + }, + { + "Id": 1086, + "Name": "Product 10-85" + }, + { + "Id": 1087, + "Name": "Product 10-86" + }, + { + "Id": 1088, + "Name": "Product 10-87" + }, + { + "Id": 1089, + "Name": "Product 10-88" + }, + { + "Id": 1090, + "Name": "Product 10-89" + }, + { + "Id": 1091, + "Name": "Product 10-90" + }, + { + "Id": 1092, + "Name": "Product 10-91" + }, + { + "Id": 1093, + "Name": "Product 10-92" + }, + { + "Id": 1094, + "Name": "Product 10-93" + }, + { + "Id": 1095, + "Name": "Product 10-94" + }, + { + "Id": 1096, + "Name": "Product 10-95" + }, + { + "Id": 1097, + "Name": "Product 10-96" + }, + { + "Id": 1098, + "Name": "Product 10-97" + }, + { + "Id": 1099, + "Name": "Product 10-98" + }, + { + "Id": 1100, + "Name": "Product 10-99" + } + ] + }, + { + "Id": 12, + "Name": "Brand:11", + "Products": [ + { + "Id": 1101, + "Name": "Product 11-0" + }, + { + "Id": 1102, + "Name": "Product 11-1" + }, + { + "Id": 1103, + "Name": "Product 11-2" + }, + { + "Id": 1104, + "Name": "Product 11-3" + }, + { + "Id": 1105, + "Name": "Product 11-4" + }, + { + "Id": 1106, + "Name": "Product 11-5" + }, + { + "Id": 1107, + "Name": "Product 11-6" + }, + { + "Id": 1108, + "Name": "Product 11-7" + }, + { + "Id": 1109, + "Name": "Product 11-8" + }, + { + "Id": 1110, + "Name": "Product 11-9" + }, + { + "Id": 1111, + "Name": "Product 11-10" + }, + { + "Id": 1112, + "Name": "Product 11-11" + }, + { + "Id": 1113, + "Name": "Product 11-12" + }, + { + "Id": 1114, + "Name": "Product 11-13" + }, + { + "Id": 1115, + "Name": "Product 11-14" + }, + { + "Id": 1116, + "Name": "Product 11-15" + }, + { + "Id": 1117, + "Name": "Product 11-16" + }, + { + "Id": 1118, + "Name": "Product 11-17" + }, + { + "Id": 1119, + "Name": "Product 11-18" + }, + { + "Id": 1120, + "Name": "Product 11-19" + }, + { + "Id": 1121, + "Name": "Product 11-20" + }, + { + "Id": 1122, + "Name": "Product 11-21" + }, + { + "Id": 1123, + "Name": "Product 11-22" + }, + { + "Id": 1124, + "Name": "Product 11-23" + }, + { + "Id": 1125, + "Name": "Product 11-24" + }, + { + "Id": 1126, + "Name": "Product 11-25" + }, + { + "Id": 1127, + "Name": "Product 11-26" + }, + { + "Id": 1128, + "Name": "Product 11-27" + }, + { + "Id": 1129, + "Name": "Product 11-28" + }, + { + "Id": 1130, + "Name": "Product 11-29" + }, + { + "Id": 1131, + "Name": "Product 11-30" + }, + { + "Id": 1132, + "Name": "Product 11-31" + }, + { + "Id": 1133, + "Name": "Product 11-32" + }, + { + "Id": 1134, + "Name": "Product 11-33" + }, + { + "Id": 1135, + "Name": "Product 11-34" + }, + { + "Id": 1136, + "Name": "Product 11-35" + }, + { + "Id": 1137, + "Name": "Product 11-36" + }, + { + "Id": 1138, + "Name": "Product 11-37" + }, + { + "Id": 1139, + "Name": "Product 11-38" + }, + { + "Id": 1140, + "Name": "Product 11-39" + }, + { + "Id": 1141, + "Name": "Product 11-40" + }, + { + "Id": 1142, + "Name": "Product 11-41" + }, + { + "Id": 1143, + "Name": "Product 11-42" + }, + { + "Id": 1144, + "Name": "Product 11-43" + }, + { + "Id": 1145, + "Name": "Product 11-44" + }, + { + "Id": 1146, + "Name": "Product 11-45" + }, + { + "Id": 1147, + "Name": "Product 11-46" + }, + { + "Id": 1148, + "Name": "Product 11-47" + }, + { + "Id": 1149, + "Name": "Product 11-48" + }, + { + "Id": 1150, + "Name": "Product 11-49" + }, + { + "Id": 1151, + "Name": "Product 11-50" + }, + { + "Id": 1152, + "Name": "Product 11-51" + }, + { + "Id": 1153, + "Name": "Product 11-52" + }, + { + "Id": 1154, + "Name": "Product 11-53" + }, + { + "Id": 1155, + "Name": "Product 11-54" + }, + { + "Id": 1156, + "Name": "Product 11-55" + }, + { + "Id": 1157, + "Name": "Product 11-56" + }, + { + "Id": 1158, + "Name": "Product 11-57" + }, + { + "Id": 1159, + "Name": "Product 11-58" + }, + { + "Id": 1160, + "Name": "Product 11-59" + }, + { + "Id": 1161, + "Name": "Product 11-60" + }, + { + "Id": 1162, + "Name": "Product 11-61" + }, + { + "Id": 1163, + "Name": "Product 11-62" + }, + { + "Id": 1164, + "Name": "Product 11-63" + }, + { + "Id": 1165, + "Name": "Product 11-64" + }, + { + "Id": 1166, + "Name": "Product 11-65" + }, + { + "Id": 1167, + "Name": "Product 11-66" + }, + { + "Id": 1168, + "Name": "Product 11-67" + }, + { + "Id": 1169, + "Name": "Product 11-68" + }, + { + "Id": 1170, + "Name": "Product 11-69" + }, + { + "Id": 1171, + "Name": "Product 11-70" + }, + { + "Id": 1172, + "Name": "Product 11-71" + }, + { + "Id": 1173, + "Name": "Product 11-72" + }, + { + "Id": 1174, + "Name": "Product 11-73" + }, + { + "Id": 1175, + "Name": "Product 11-74" + }, + { + "Id": 1176, + "Name": "Product 11-75" + }, + { + "Id": 1177, + "Name": "Product 11-76" + }, + { + "Id": 1178, + "Name": "Product 11-77" + }, + { + "Id": 1179, + "Name": "Product 11-78" + }, + { + "Id": 1180, + "Name": "Product 11-79" + }, + { + "Id": 1181, + "Name": "Product 11-80" + }, + { + "Id": 1182, + "Name": "Product 11-81" + }, + { + "Id": 1183, + "Name": "Product 11-82" + }, + { + "Id": 1184, + "Name": "Product 11-83" + }, + { + "Id": 1185, + "Name": "Product 11-84" + }, + { + "Id": 1186, + "Name": "Product 11-85" + }, + { + "Id": 1187, + "Name": "Product 11-86" + }, + { + "Id": 1188, + "Name": "Product 11-87" + }, + { + "Id": 1189, + "Name": "Product 11-88" + }, + { + "Id": 1190, + "Name": "Product 11-89" + }, + { + "Id": 1191, + "Name": "Product 11-90" + }, + { + "Id": 1192, + "Name": "Product 11-91" + }, + { + "Id": 1193, + "Name": "Product 11-92" + }, + { + "Id": 1194, + "Name": "Product 11-93" + }, + { + "Id": 1195, + "Name": "Product 11-94" + }, + { + "Id": 1196, + "Name": "Product 11-95" + }, + { + "Id": 1197, + "Name": "Product 11-96" + }, + { + "Id": 1198, + "Name": "Product 11-97" + }, + { + "Id": 1199, + "Name": "Product 11-98" + }, + { + "Id": 1200, + "Name": "Product 11-99" + } + ] + }, + { + "Id": 13, + "Name": "Brand:12", + "Products": [ + { + "Id": 1201, + "Name": "Product 12-0" + }, + { + "Id": 1202, + "Name": "Product 12-1" + }, + { + "Id": 1203, + "Name": "Product 12-2" + }, + { + "Id": 1204, + "Name": "Product 12-3" + }, + { + "Id": 1205, + "Name": "Product 12-4" + }, + { + "Id": 1206, + "Name": "Product 12-5" + }, + { + "Id": 1207, + "Name": "Product 12-6" + }, + { + "Id": 1208, + "Name": "Product 12-7" + }, + { + "Id": 1209, + "Name": "Product 12-8" + }, + { + "Id": 1210, + "Name": "Product 12-9" + }, + { + "Id": 1211, + "Name": "Product 12-10" + }, + { + "Id": 1212, + "Name": "Product 12-11" + }, + { + "Id": 1213, + "Name": "Product 12-12" + }, + { + "Id": 1214, + "Name": "Product 12-13" + }, + { + "Id": 1215, + "Name": "Product 12-14" + }, + { + "Id": 1216, + "Name": "Product 12-15" + }, + { + "Id": 1217, + "Name": "Product 12-16" + }, + { + "Id": 1218, + "Name": "Product 12-17" + }, + { + "Id": 1219, + "Name": "Product 12-18" + }, + { + "Id": 1220, + "Name": "Product 12-19" + }, + { + "Id": 1221, + "Name": "Product 12-20" + }, + { + "Id": 1222, + "Name": "Product 12-21" + }, + { + "Id": 1223, + "Name": "Product 12-22" + }, + { + "Id": 1224, + "Name": "Product 12-23" + }, + { + "Id": 1225, + "Name": "Product 12-24" + }, + { + "Id": 1226, + "Name": "Product 12-25" + }, + { + "Id": 1227, + "Name": "Product 12-26" + }, + { + "Id": 1228, + "Name": "Product 12-27" + }, + { + "Id": 1229, + "Name": "Product 12-28" + }, + { + "Id": 1230, + "Name": "Product 12-29" + }, + { + "Id": 1231, + "Name": "Product 12-30" + }, + { + "Id": 1232, + "Name": "Product 12-31" + }, + { + "Id": 1233, + "Name": "Product 12-32" + }, + { + "Id": 1234, + "Name": "Product 12-33" + }, + { + "Id": 1235, + "Name": "Product 12-34" + }, + { + "Id": 1236, + "Name": "Product 12-35" + }, + { + "Id": 1237, + "Name": "Product 12-36" + }, + { + "Id": 1238, + "Name": "Product 12-37" + }, + { + "Id": 1239, + "Name": "Product 12-38" + }, + { + "Id": 1240, + "Name": "Product 12-39" + }, + { + "Id": 1241, + "Name": "Product 12-40" + }, + { + "Id": 1242, + "Name": "Product 12-41" + }, + { + "Id": 1243, + "Name": "Product 12-42" + }, + { + "Id": 1244, + "Name": "Product 12-43" + }, + { + "Id": 1245, + "Name": "Product 12-44" + }, + { + "Id": 1246, + "Name": "Product 12-45" + }, + { + "Id": 1247, + "Name": "Product 12-46" + }, + { + "Id": 1248, + "Name": "Product 12-47" + }, + { + "Id": 1249, + "Name": "Product 12-48" + }, + { + "Id": 1250, + "Name": "Product 12-49" + }, + { + "Id": 1251, + "Name": "Product 12-50" + }, + { + "Id": 1252, + "Name": "Product 12-51" + }, + { + "Id": 1253, + "Name": "Product 12-52" + }, + { + "Id": 1254, + "Name": "Product 12-53" + }, + { + "Id": 1255, + "Name": "Product 12-54" + }, + { + "Id": 1256, + "Name": "Product 12-55" + }, + { + "Id": 1257, + "Name": "Product 12-56" + }, + { + "Id": 1258, + "Name": "Product 12-57" + }, + { + "Id": 1259, + "Name": "Product 12-58" + }, + { + "Id": 1260, + "Name": "Product 12-59" + }, + { + "Id": 1261, + "Name": "Product 12-60" + }, + { + "Id": 1262, + "Name": "Product 12-61" + }, + { + "Id": 1263, + "Name": "Product 12-62" + }, + { + "Id": 1264, + "Name": "Product 12-63" + }, + { + "Id": 1265, + "Name": "Product 12-64" + }, + { + "Id": 1266, + "Name": "Product 12-65" + }, + { + "Id": 1267, + "Name": "Product 12-66" + }, + { + "Id": 1268, + "Name": "Product 12-67" + }, + { + "Id": 1269, + "Name": "Product 12-68" + }, + { + "Id": 1270, + "Name": "Product 12-69" + }, + { + "Id": 1271, + "Name": "Product 12-70" + }, + { + "Id": 1272, + "Name": "Product 12-71" + }, + { + "Id": 1273, + "Name": "Product 12-72" + }, + { + "Id": 1274, + "Name": "Product 12-73" + }, + { + "Id": 1275, + "Name": "Product 12-74" + }, + { + "Id": 1276, + "Name": "Product 12-75" + }, + { + "Id": 1277, + "Name": "Product 12-76" + }, + { + "Id": 1278, + "Name": "Product 12-77" + }, + { + "Id": 1279, + "Name": "Product 12-78" + }, + { + "Id": 1280, + "Name": "Product 12-79" + }, + { + "Id": 1281, + "Name": "Product 12-80" + }, + { + "Id": 1282, + "Name": "Product 12-81" + }, + { + "Id": 1283, + "Name": "Product 12-82" + }, + { + "Id": 1284, + "Name": "Product 12-83" + }, + { + "Id": 1285, + "Name": "Product 12-84" + }, + { + "Id": 1286, + "Name": "Product 12-85" + }, + { + "Id": 1287, + "Name": "Product 12-86" + }, + { + "Id": 1288, + "Name": "Product 12-87" + }, + { + "Id": 1289, + "Name": "Product 12-88" + }, + { + "Id": 1290, + "Name": "Product 12-89" + }, + { + "Id": 1291, + "Name": "Product 12-90" + }, + { + "Id": 1292, + "Name": "Product 12-91" + }, + { + "Id": 1293, + "Name": "Product 12-92" + }, + { + "Id": 1294, + "Name": "Product 12-93" + }, + { + "Id": 1295, + "Name": "Product 12-94" + }, + { + "Id": 1296, + "Name": "Product 12-95" + }, + { + "Id": 1297, + "Name": "Product 12-96" + }, + { + "Id": 1298, + "Name": "Product 12-97" + }, + { + "Id": 1299, + "Name": "Product 12-98" + }, + { + "Id": 1300, + "Name": "Product 12-99" + } + ] + } +] +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_NullableReference_Ascending_Cursor_Value_NonNull_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_NullableReference_Ascending_Cursor_Value_NonNull_NET11_0.md new file mode 100644 index 00000000000..e256e3cded8 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_NullableReference_Ascending_Cursor_Value_NonNull_NET11_0.md @@ -0,0 +1,63 @@ +# Paging_NullableReference_Ascending_Cursor_Value_NonNull + +## Result 1 + +```json +[ + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + }, + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + }, + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + } +] +``` + +## SQL 0 + +```sql +-- @p='3' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +ORDER BY r."Date", r."String", r."Id" +LIMIT @p +``` + +## SQL 1 + +```sql +-- @value='11/03/2017' (DbType = Date) +-- @value2='21:45:00' +-- @value5='dd8f3a21-89ab-4cde-a203-7d3c45678901' +-- @p='3' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +WHERE r."Date" IS NULL OR r."Date" > @value OR (r."Date" = @value AND (r."String" IS NULL OR r."String" > @value2)) OR (r."Date" = @value AND r."String" IS NOT NULL AND r."String" = @value2 AND r."Id" > @value5) +ORDER BY r."Date", r."String", r."Id" +LIMIT @p +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_NullableReference_Ascending_Cursor_Value_Null_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_NullableReference_Ascending_Cursor_Value_Null_NET11_0.md new file mode 100644 index 00000000000..dbe7e0dac43 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_NullableReference_Ascending_Cursor_Value_Null_NET11_0.md @@ -0,0 +1,68 @@ +# Paging_NullableReference_Ascending_Cursor_Value_Null + +## Result 1 + +```json +[ + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + }, + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + }, + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + }, + { + "Id": "a1d5b763-6789-4f23-c405-5f5e67890123", + "Date": "2017-11-04", + "Time": "19:40:00", + "String": "19:40:00" + } +] +``` + +## SQL 0 + +```sql +-- @p='4' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +ORDER BY r."Date", r."String", r."Id" +LIMIT @p +``` + +## SQL 1 + +```sql +-- @value='11/03/2017' (DbType = Date) +-- @value3='d3b7e9f1-4567-4abc-a102-8c2b34567890' +-- @p='4' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +WHERE r."Date" IS NULL OR r."Date" > @value OR (r."Date" = @value AND r."String" IS NULL AND r."Id" > @value3) +ORDER BY r."Date", r."String", r."Id" +LIMIT @p +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_NullableReference_Descending_Cursor_Value_NonNull_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_NullableReference_Descending_Cursor_Value_NonNull_NET11_0.md new file mode 100644 index 00000000000..a5cac38b9f7 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_NullableReference_Descending_Cursor_Value_NonNull_NET11_0.md @@ -0,0 +1,63 @@ +# Paging_NullableReference_Descending_Cursor_Value_NonNull + +## Result 1 + +```json +[ + { + "Id": "a1d5b763-6789-4f23-c405-5f5e67890123", + "Date": "2017-11-04", + "Time": "19:40:00", + "String": "19:40:00" + }, + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + }, + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + } +] +``` + +## SQL 0 + +```sql +-- @p='3' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +ORDER BY r."Date" DESC, r."String" DESC, r."Id" DESC +LIMIT @p +``` + +## SQL 1 + +```sql +-- @value='11/04/2017' (DbType = Date) +-- @value2='14:00:00' +-- @value5='62ce9d54-2345-4f01-b304-6e4d56789012' +-- @p='3' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +WHERE r."Date" < @value OR (r."Date" IS NOT NULL AND r."Date" = @value AND r."String" < @value2) OR (r."Date" IS NOT NULL AND r."Date" = @value AND r."String" IS NOT NULL AND r."String" = @value2 AND r."Id" < @value5) +ORDER BY r."Date" DESC, r."String" DESC, r."Id" DESC +LIMIT @p +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_NullableReference_Descending_Cursor_Value_Null_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_NullableReference_Descending_Cursor_Value_Null_NET11_0.md new file mode 100644 index 00000000000..426cc6cea97 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_NullableReference_Descending_Cursor_Value_Null_NET11_0.md @@ -0,0 +1,68 @@ +# Paging_NullableReference_Descending_Cursor_Value_Null + +## Result 1 + +```json +[ + { + "Id": "a1d5b763-6789-4f23-c405-5f5e67890123", + "Date": "2017-11-04", + "Time": "19:40:00", + "String": "19:40:00" + }, + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + }, + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + }, + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + } +] +``` + +## SQL 0 + +```sql +-- @p='4' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +ORDER BY r."Date" DESC, r."String" DESC, r."Id" DESC +LIMIT @p +``` + +## SQL 1 + +```sql +-- @value='11/03/2017' (DbType = Date) +-- @value3='d3b7e9f1-4567-4abc-a102-8c2b34567890' +-- @p='4' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +WHERE r."Date" < @value OR (r."Date" IS NOT NULL AND r."Date" = @value AND r."String" IS NOT NULL) OR (r."Date" IS NOT NULL AND r."Date" = @value AND r."String" IS NULL AND r."Id" < @value3) +ORDER BY r."Date" DESC, r."String" DESC, r."Id" DESC +LIMIT @p +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_Nullable_Ascending_Cursor_Value_NonNull_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_Nullable_Ascending_Cursor_Value_NonNull_NET11_0.md new file mode 100644 index 00000000000..d658b20d4fd --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_Nullable_Ascending_Cursor_Value_NonNull_NET11_0.md @@ -0,0 +1,63 @@ +# Paging_Nullable_Ascending_Cursor_Value_NonNull + +## Result 1 + +```json +[ + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + }, + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + }, + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + } +] +``` + +## SQL 0 + +```sql +-- @p='3' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +ORDER BY r."Date", r."Time", r."Id" +LIMIT @p +``` + +## SQL 1 + +```sql +-- @value='11/03/2017' (DbType = Date) +-- @value2='21:45' (DbType = Time) +-- @value5='dd8f3a21-89ab-4cde-a203-7d3c45678901' +-- @p='3' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +WHERE r."Date" IS NULL OR r."Date" > @value OR (r."Date" = @value AND (r."Time" IS NULL OR r."Time" > @value2)) OR (r."Date" = @value AND r."Time" IS NOT NULL AND r."Time" = @value2 AND r."Id" > @value5) +ORDER BY r."Date", r."Time", r."Id" +LIMIT @p +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_Nullable_Ascending_Cursor_Value_Null_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_Nullable_Ascending_Cursor_Value_Null_NET11_0.md new file mode 100644 index 00000000000..44c661780c5 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_Nullable_Ascending_Cursor_Value_Null_NET11_0.md @@ -0,0 +1,68 @@ +# Paging_Nullable_Ascending_Cursor_Value_Null + +## Result 1 + +```json +[ + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + }, + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + }, + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + }, + { + "Id": "a1d5b763-6789-4f23-c405-5f5e67890123", + "Date": "2017-11-04", + "Time": "19:40:00", + "String": "19:40:00" + } +] +``` + +## SQL 0 + +```sql +-- @p='4' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +ORDER BY r."Date", r."Time", r."Id" +LIMIT @p +``` + +## SQL 1 + +```sql +-- @value='11/03/2017' (DbType = Date) +-- @value3='d3b7e9f1-4567-4abc-a102-8c2b34567890' +-- @p='4' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +WHERE r."Date" IS NULL OR r."Date" > @value OR (r."Date" = @value AND r."Time" IS NULL AND r."Id" > @value3) +ORDER BY r."Date", r."Time", r."Id" +LIMIT @p +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_Nullable_Descending_Cursor_Value_NonNull_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_Nullable_Descending_Cursor_Value_NonNull_NET11_0.md new file mode 100644 index 00000000000..5eb781b0069 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_Nullable_Descending_Cursor_Value_NonNull_NET11_0.md @@ -0,0 +1,63 @@ +# Paging_Nullable_Descending_Cursor_Value_NonNull + +## Result 1 + +```json +[ + { + "Id": "a1d5b763-6789-4f23-c405-5f5e67890123", + "Date": "2017-11-04", + "Time": "19:40:00", + "String": "19:40:00" + }, + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + }, + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + } +] +``` + +## SQL 0 + +```sql +-- @p='3' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +ORDER BY r."Date" DESC, r."Time" DESC, r."Id" DESC +LIMIT @p +``` + +## SQL 1 + +```sql +-- @value='11/04/2017' (DbType = Date) +-- @value2='14:00' (DbType = Time) +-- @value5='62ce9d54-2345-4f01-b304-6e4d56789012' +-- @p='3' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +WHERE r."Date" < @value OR (r."Date" IS NOT NULL AND r."Date" = @value AND r."Time" < @value2) OR (r."Date" IS NOT NULL AND r."Date" = @value AND r."Time" IS NOT NULL AND r."Time" = @value2 AND r."Id" < @value5) +ORDER BY r."Date" DESC, r."Time" DESC, r."Id" DESC +LIMIT @p +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_Nullable_Descending_Cursor_Value_Null_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_Nullable_Descending_Cursor_Value_Null_NET11_0.md new file mode 100644 index 00000000000..95fe0bc0cec --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperPostgreSqlNullableTests.Paging_Nullable_Descending_Cursor_Value_Null_NET11_0.md @@ -0,0 +1,68 @@ +# Paging_Nullable_Descending_Cursor_Value_Null + +## Result 1 + +```json +[ + { + "Id": "a1d5b763-6789-4f23-c405-5f5e67890123", + "Date": "2017-11-04", + "Time": "19:40:00", + "String": "19:40:00" + }, + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + }, + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + }, + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + } +] +``` + +## SQL 0 + +```sql +-- @p='4' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +ORDER BY r."Date" DESC, r."Time" DESC, r."Id" DESC +LIMIT @p +``` + +## SQL 1 + +```sql +-- @value='11/03/2017' (DbType = Date) +-- @value3='d3b7e9f1-4567-4abc-a102-8c2b34567890' +-- @p='4' +SELECT r."Id", r."Date", r."String", r."Time" +FROM "Records" AS r +WHERE r."Date" < @value OR (r."Date" IS NOT NULL AND r."Date" = @value AND r."Time" IS NOT NULL) OR (r."Date" IS NOT NULL AND r."Date" = @value AND r."Time" IS NULL AND r."Id" < @value3) +ORDER BY r."Date" DESC, r."Time" DESC, r."Id" DESC +LIMIT @p +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_NullableReference_Ascending_Cursor_Value_NonNull_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_NullableReference_Ascending_Cursor_Value_NonNull_NET11_0.md new file mode 100644 index 00000000000..1aab518bc05 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_NullableReference_Ascending_Cursor_Value_NonNull_NET11_0.md @@ -0,0 +1,69 @@ +# Paging_NullableReference_Ascending_Cursor_Value_NonNull + +## Result 1 + +```json +[ + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + }, + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + }, + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + }, + { + "Id": "a1d5b763-6789-4f23-c405-5f5e67890123", + "Date": "2017-11-04", + "Time": "19:40:00", + "String": "19:40:00" + } +] +``` + +## SQL 0 + +```sql +DECLARE @p int = 4; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +ORDER BY [r].[Date], [r].[String], [r].[Id] +``` + +## SQL 1 + +```sql +DECLARE @p int = 4; +DECLARE @value date = '2017-11-03'; +DECLARE @value2 nvarchar(4000) = N'21:45:00'; +DECLARE @value5 uniqueIdentifier = 'dd8f3a21-89ab-4cde-a203-7d3c45678901'; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +WHERE [r].[Date] > @value OR ([r].[Date] IS NOT NULL AND [r].[Date] = @value AND [r].[String] > @value2) OR ([r].[Date] IS NOT NULL AND [r].[Date] = @value AND [r].[String] IS NOT NULL AND [r].[String] = @value2 AND [r].[Id] > @value5) +ORDER BY [r].[Date], [r].[String], [r].[Id] +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_NullableReference_Ascending_Cursor_Value_Null_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_NullableReference_Ascending_Cursor_Value_Null_NET11_0.md new file mode 100644 index 00000000000..b2e982ed5a5 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_NullableReference_Ascending_Cursor_Value_Null_NET11_0.md @@ -0,0 +1,62 @@ +# Paging_NullableReference_Ascending_Cursor_Value_Null + +## Result 1 + +```json +[ + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + }, + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + }, + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + } +] +``` + +## SQL 0 + +```sql +DECLARE @p int = 3; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +ORDER BY [r].[Date], [r].[String], [r].[Id] +``` + +## SQL 1 + +```sql +DECLARE @p int = 3; +DECLARE @value date = '2017-11-03'; +DECLARE @value3 uniqueIdentifier = 'd3b7e9f1-4567-4abc-a102-8c2b34567890'; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +WHERE [r].[Date] > @value OR ([r].[Date] IS NOT NULL AND [r].[Date] = @value AND [r].[String] IS NOT NULL) OR ([r].[Date] IS NOT NULL AND [r].[Date] = @value AND [r].[String] IS NULL AND [r].[Id] > @value3) +ORDER BY [r].[Date], [r].[String], [r].[Id] +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_NullableReference_Descending_Cursor_Value_NonNull_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_NullableReference_Descending_Cursor_Value_NonNull_NET11_0.md new file mode 100644 index 00000000000..cec89c23e54 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_NullableReference_Descending_Cursor_Value_NonNull_NET11_0.md @@ -0,0 +1,69 @@ +# Paging_NullableReference_Descending_Cursor_Value_NonNull + +## Result 1 + +```json +[ + { + "Id": "a1d5b763-6789-4f23-c405-5f5e67890123", + "Date": "2017-11-04", + "Time": "19:40:00", + "String": "19:40:00" + }, + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + }, + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + }, + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + } +] +``` + +## SQL 0 + +```sql +DECLARE @p int = 4; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +ORDER BY [r].[Date] DESC, [r].[String] DESC, [r].[Id] DESC +``` + +## SQL 1 + +```sql +DECLARE @p int = 4; +DECLARE @value date = '2017-11-03'; +DECLARE @value2 nvarchar(4000) = N'21:45:00'; +DECLARE @value5 uniqueIdentifier = 'dd8f3a21-89ab-4cde-a203-7d3c45678901'; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +WHERE [r].[Date] IS NULL OR [r].[Date] < @value OR ([r].[Date] = @value AND ([r].[String] IS NULL OR [r].[String] < @value2)) OR ([r].[Date] = @value AND [r].[String] IS NOT NULL AND [r].[String] = @value2 AND [r].[Id] < @value5) +ORDER BY [r].[Date] DESC, [r].[String] DESC, [r].[Id] DESC +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_NullableReference_Descending_Cursor_Value_Null_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_NullableReference_Descending_Cursor_Value_Null_NET11_0.md new file mode 100644 index 00000000000..7db40f25cff --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_NullableReference_Descending_Cursor_Value_Null_NET11_0.md @@ -0,0 +1,68 @@ +# Paging_NullableReference_Descending_Cursor_Value_Null + +## Result 1 + +```json +[ + { + "Id": "a1d5b763-6789-4f23-c405-5f5e67890123", + "Date": "2017-11-04", + "Time": "19:40:00", + "String": "19:40:00" + }, + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + }, + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + }, + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + } +] +``` + +## SQL 0 + +```sql +DECLARE @p int = 5; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +ORDER BY [r].[Date] DESC, [r].[String] DESC, [r].[Id] DESC +``` + +## SQL 1 + +```sql +DECLARE @p int = 5; +DECLARE @value date = '2017-11-03'; +DECLARE @value3 uniqueIdentifier = 'd3b7e9f1-4567-4abc-a102-8c2b34567890'; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +WHERE [r].[Date] IS NULL OR [r].[Date] < @value OR ([r].[Date] = @value AND [r].[String] IS NULL AND [r].[Id] < @value3) +ORDER BY [r].[Date] DESC, [r].[String] DESC, [r].[Id] DESC +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_Nullable_Ascending_Cursor_Value_NonNull_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_Nullable_Ascending_Cursor_Value_NonNull_NET11_0.md new file mode 100644 index 00000000000..01fd94e5f07 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_Nullable_Ascending_Cursor_Value_NonNull_NET11_0.md @@ -0,0 +1,69 @@ +# Paging_Nullable_Ascending_Cursor_Value_NonNull + +## Result 1 + +```json +[ + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + }, + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + }, + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + }, + { + "Id": "a1d5b763-6789-4f23-c405-5f5e67890123", + "Date": "2017-11-04", + "Time": "19:40:00", + "String": "19:40:00" + } +] +``` + +## SQL 0 + +```sql +DECLARE @p int = 4; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +ORDER BY [r].[Date], [r].[Time], [r].[Id] +``` + +## SQL 1 + +```sql +DECLARE @p int = 4; +DECLARE @value date = '2017-11-03'; +DECLARE @value2 time = '21:45:00'; +DECLARE @value5 uniqueIdentifier = 'dd8f3a21-89ab-4cde-a203-7d3c45678901'; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +WHERE [r].[Date] > @value OR ([r].[Date] IS NOT NULL AND [r].[Date] = @value AND [r].[Time] > @value2) OR ([r].[Date] IS NOT NULL AND [r].[Date] = @value AND [r].[Time] IS NOT NULL AND [r].[Time] = @value2 AND [r].[Id] > @value5) +ORDER BY [r].[Date], [r].[Time], [r].[Id] +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_Nullable_Ascending_Cursor_Value_Null_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_Nullable_Ascending_Cursor_Value_Null_NET11_0.md new file mode 100644 index 00000000000..f4588d6f4af --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_Nullable_Ascending_Cursor_Value_Null_NET11_0.md @@ -0,0 +1,62 @@ +# Paging_Nullable_Ascending_Cursor_Value_Null + +## Result 1 + +```json +[ + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + }, + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + }, + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + } +] +``` + +## SQL 0 + +```sql +DECLARE @p int = 3; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +ORDER BY [r].[Date], [r].[Time], [r].[Id] +``` + +## SQL 1 + +```sql +DECLARE @p int = 3; +DECLARE @value date = '2017-11-03'; +DECLARE @value3 uniqueIdentifier = 'd3b7e9f1-4567-4abc-a102-8c2b34567890'; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +WHERE [r].[Date] > @value OR ([r].[Date] IS NOT NULL AND [r].[Date] = @value AND [r].[Time] IS NOT NULL) OR ([r].[Date] IS NOT NULL AND [r].[Date] = @value AND [r].[Time] IS NULL AND [r].[Id] > @value3) +ORDER BY [r].[Date], [r].[Time], [r].[Id] +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_Nullable_Descending_Cursor_Value_NonNull_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_Nullable_Descending_Cursor_Value_NonNull_NET11_0.md new file mode 100644 index 00000000000..2d2d189b8c6 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_Nullable_Descending_Cursor_Value_NonNull_NET11_0.md @@ -0,0 +1,69 @@ +# Paging_Nullable_Descending_Cursor_Value_NonNull + +## Result 1 + +```json +[ + { + "Id": "a1d5b763-6789-4f23-c405-5f5e67890123", + "Date": "2017-11-04", + "Time": "19:40:00", + "String": "19:40:00" + }, + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + }, + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + }, + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + } +] +``` + +## SQL 0 + +```sql +DECLARE @p int = 4; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +ORDER BY [r].[Date] DESC, [r].[Time] DESC, [r].[Id] DESC +``` + +## SQL 1 + +```sql +DECLARE @p int = 4; +DECLARE @value date = '2017-11-03'; +DECLARE @value2 time = '21:45:00'; +DECLARE @value5 uniqueIdentifier = 'dd8f3a21-89ab-4cde-a203-7d3c45678901'; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +WHERE [r].[Date] IS NULL OR [r].[Date] < @value OR ([r].[Date] = @value AND ([r].[Time] IS NULL OR [r].[Time] < @value2)) OR ([r].[Date] = @value AND [r].[Time] IS NOT NULL AND [r].[Time] = @value2 AND [r].[Id] < @value5) +ORDER BY [r].[Date] DESC, [r].[Time] DESC, [r].[Id] DESC +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_Nullable_Descending_Cursor_Value_Null_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_Nullable_Descending_Cursor_Value_Null_NET11_0.md new file mode 100644 index 00000000000..b33c1251f42 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperSqlServerNullableTests.Paging_Nullable_Descending_Cursor_Value_Null_NET11_0.md @@ -0,0 +1,68 @@ +# Paging_Nullable_Descending_Cursor_Value_Null + +## Result 1 + +```json +[ + { + "Id": "a1d5b763-6789-4f23-c405-5f5e67890123", + "Date": "2017-11-04", + "Time": "19:40:00", + "String": "19:40:00" + }, + { + "Id": "62ce9d54-2345-4f01-b304-6e4d56789012", + "Date": "2017-11-04", + "Time": "14:00:00", + "String": "14:00:00" + }, + { + "Id": "dd8f3a21-89ab-4cde-a203-7d3c45678901", + "Date": "2017-11-03", + "Time": "21:45:00", + "String": "21:45:00" + }, + { + "Id": "d3b7e9f1-4567-4abc-a102-8c2b34567890", + "Date": "2017-11-03", + "Time": null, + "String": null + } +] +``` + +## Result 2 + +```json +[ + { + "Id": "68a5c7c2-1234-4def-bc01-9f1a23456789", + "Date": "2017-10-28", + "Time": "22:00:00", + "String": "22:00:00" + } +] +``` + +## SQL 0 + +```sql +DECLARE @p int = 5; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +ORDER BY [r].[Date] DESC, [r].[Time] DESC, [r].[Id] DESC +``` + +## SQL 1 + +```sql +DECLARE @p int = 5; +DECLARE @value date = '2017-11-03'; +DECLARE @value3 uniqueIdentifier = 'd3b7e9f1-4567-4abc-a102-8c2b34567890'; + +SELECT TOP(@p) [r].[Id], [r].[Date], [r].[String], [r].[Time] +FROM [Records] AS [r] +WHERE [r].[Date] IS NULL OR [r].[Date] < @value OR ([r].[Date] = @value AND [r].[Time] IS NULL AND [r].[Id] < @value3) +ORDER BY [r].[Date] DESC, [r].[Time] DESC, [r].[Id] DESC +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_NET11_0.md new file mode 100644 index 00000000000..32c65869a69 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_NET11_0.md @@ -0,0 +1,22 @@ +# QueryContext_Simple_Selector_Include_Brand + +## SQL 0 + +```sql +-- @p='3' +SELECT p0."Id", p0."Name", b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM ( + SELECT p."Id", p."BrandId", p."Name" + FROM "Products" AS p + ORDER BY p."Id" + LIMIT @p +) AS p0 +INNER JOIN "Brands" AS b ON p0."BrandId" = b."Id" +ORDER BY p0."Id" +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Id).Select(root => new Product() {Id = root.Id, Name = root.Name, Brand = root.Brand}).Take(3) +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_Name_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_Name_NET11_0.md new file mode 100644 index 00000000000..3ed254557d5 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Brand_Name_NET11_0.md @@ -0,0 +1,22 @@ +# QueryContext_Simple_Selector_Include_Brand_Name + +## SQL 0 + +```sql +-- @p='3' +SELECT p0."Id", p0."Name", b."Name" +FROM ( + SELECT p."Id", p."BrandId", p."Name" + FROM "Products" AS p + ORDER BY p."Id" + LIMIT @p +) AS p0 +INNER JOIN "Brands" AS b ON p0."BrandId" = b."Id" +ORDER BY p0."Id" +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Id).Select(root => new Product() {Id = root.Id, Name = root.Name, Brand = new Brand() {Name = root.Brand.Name}}).Take(3) +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Product_List_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Product_List_NET11_0.md new file mode 100644 index 00000000000..419a6434d33 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_Include_Product_List_NET11_0.md @@ -0,0 +1,22 @@ +# QueryContext_Simple_Selector_Include_Product_List + +## SQL 0 + +```sql +-- @p='3' +SELECT b0."Id", b0."Name", p."Id", p."Name" +FROM ( + SELECT b."Id", b."Name" + FROM "Brands" AS b + ORDER BY b."Id" + LIMIT @p +) AS b0 +LEFT JOIN "Products" AS p ON b0."Id" = p."BrandId" +ORDER BY b0."Id" +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Id).Select(root => new Brand() {Id = root.Id, Name = root.Name, Products = root.Products.Select(p => new Product() {Id = p.Id, Name = p.Name}).ToList()}).Take(3) +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_NET11_0.md b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_NET11_0.md new file mode 100644 index 00000000000..60ae7931664 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/PagingHelperTests.QueryContext_Simple_Selector_NET11_0.md @@ -0,0 +1,17 @@ +# QueryContext_Simple_Selector + +## SQL 0 + +```sql +-- @p='3' +SELECT p."Id", p."Name" +FROM "Products" AS p +ORDER BY p."Id" +LIMIT @p +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Id).Select(t => new Product() {Id = t.Id, Name = t.Name}).Take(3) +``` diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_1_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_1_NET11_0.snap new file mode 100644 index 00000000000..f1dbf73e1a5 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_1_NET11_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 4, + "TotalCount": 20, + "Items": [ + "Glacient", + "Hyperionix" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Dynamova' +-- @value2='4' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 1 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 1 AND (b0."Name" > @value OR (b0."Name" = @value AND b0."Id" > @value2)) + ) AS b2 + WHERE 2 < b2.row AND b2.row <= 5 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_2_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_2_NET11_0.snap new file mode 100644 index 00000000000..62b149775bc --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_Page_With_Offset_2_NET11_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 4, + "TotalCount": 20, + "Items": [ + "Glacient", + "Hyperionix" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Brightex' +-- @value2='2' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 1 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 1 AND (b0."Name" > @value OR (b0."Name" = @value AND b0."Id" > @value2)) + ) AS b2 + WHERE 4 < b2.row AND b2.row <= 7 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET11_0.snap new file mode 100644 index 00000000000..13c928b0ab6 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET11_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 7, + "TotalCount": 20, + "Items": [ + "Momentumix", + "Nebularis" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Quantumis' +-- @value2='17' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 2 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 2 AND (b0."Name" < @value OR (b0."Name" = @value AND b0."Id" < @value2)) + ) AS b2 + WHERE 2 < b2.row AND b2.row <= 5 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_Offset_Negative_2_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_Offset_Negative_2_NET11_0.snap new file mode 100644 index 00000000000..771a76523e1 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Fourth_To_Last_Page_Offset_Negative_2_NET11_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 7, + "TotalCount": 20, + "Items": [ + "Momentumix", + "Nebularis" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Synerflux' +-- @value2='19' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 2 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 2 AND (b0."Name" < @value OR (b0."Name" = @value AND b0."Id" < @value2)) + ) AS b2 + WHERE 4 < b2.row AND b2.row <= 7 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_Page_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_Page_NET11_0.snap new file mode 100644 index 00000000000..2e645a2594f --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_Page_NET11_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 2, + "TotalCount": 20, + "Items": [ + "Celestara", + "Dynamova" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Brightex' +-- @value2='2' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 1 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 1 AND (b0."Name" > @value OR (b0."Name" = @value AND b0."Id" > @value2)) + ) AS b2 + WHERE b2.row <= 3 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_To_Last_Page_Offset_0_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_To_Last_Page_Offset_0_NET11_0.snap new file mode 100644 index 00000000000..cfa19c13ee2 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Second_To_Last_Page_Offset_0_NET11_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 9, + "TotalCount": 20, + "Items": [ + "Quantumis", + "Radiantum" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Synerflux' +-- @value2='19' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 2 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 2 AND (b0."Name" < @value OR (b0."Name" = @value AND b0."Id" < @value2)) + ) AS b2 + WHERE b2.row <= 3 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_Page_With_Offset_1_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_Page_With_Offset_1_NET11_0.snap new file mode 100644 index 00000000000..8642befedf2 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_Page_With_Offset_1_NET11_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 3, + "TotalCount": 20, + "Items": [ + "Evolvance", + "Futurova" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Brightex' +-- @value2='2' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 1 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name", b0."Id") AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 1 AND (b0."Name" > @value OR (b0."Name" = @value AND b0."Id" > @value2)) + ) AS b2 + WHERE 2 < b2.row AND b2.row <= 5 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name", b3."Id" +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_To_Last_Page_Offset_Negative_1_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_To_Last_Page_Offset_Negative_1_NET11_0.snap new file mode 100644 index 00000000000..aaa39f541b4 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.BatchFetch_Third_To_Last_Page_Offset_Negative_1_NET11_0.snap @@ -0,0 +1,33 @@ +--------------- +{ + "Page": 8, + "TotalCount": 20, + "Items": [ + "Omniflex", + "Pulsarix" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Synerflux' +-- @value2='19' +SELECT b1."GroupId", b3."Id", b3."GroupId", b3."Name" +FROM ( + SELECT b."GroupId" + FROM "Brands" AS b + WHERE b."GroupId" = 2 + GROUP BY b."GroupId" +) AS b1 +LEFT JOIN ( + SELECT b2."Id", b2."GroupId", b2."Name" + FROM ( + SELECT b0."Id", b0."GroupId", b0."Name", ROW_NUMBER() OVER(PARTITION BY b0."GroupId" ORDER BY b0."Name" DESC, b0."Id" DESC) AS row + FROM "Brands" AS b0 + WHERE b0."GroupId" = 2 AND (b0."Name" < @value OR (b0."Name" = @value AND b0."Id" < @value2)) + ) AS b2 + WHERE 2 < b2.row AND b2.row <= 5 +) AS b3 ON b1."GroupId" = b3."GroupId" +ORDER BY b1."GroupId", b3."GroupId", b3."Name" DESC, b3."Id" DESC +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_1_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_1_NET11_0.snap new file mode 100644 index 00000000000..fb85d5d5c2e --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_1_NET11_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 4, + "TotalCount": 20, + "Items": [ + "Glacient", + "Hyperionix" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Dynamova' +-- @value2='4' +-- @p4='3' +-- @p='2' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value2) +ORDER BY b."Name", b."Id" +LIMIT @p4 OFFSET @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_2_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_2_NET11_0.snap new file mode 100644 index 00000000000..e2cd41785f0 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_Page_With_Offset_2_NET11_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 4, + "TotalCount": 20, + "Items": [ + "Glacient", + "Hyperionix" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Brightex' +-- @value2='2' +-- @p4='3' +-- @p='4' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value2) +ORDER BY b."Name", b."Id" +LIMIT @p4 OFFSET @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET11_0.snap new file mode 100644 index 00000000000..4a9eedc80ca --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_From_Second_To_Last_Page_Offset_Negative_1_NET11_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 7, + "TotalCount": 20, + "Items": [ + "Momentumix", + "Nebularis" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Quantumis' +-- @value2='17' +-- @p4='3' +-- @p='2' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" < @value OR (b."Name" = @value AND b."Id" < @value2) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p4 OFFSET @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_Offset_Negative_2_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_Offset_Negative_2_NET11_0.snap new file mode 100644 index 00000000000..777241aa7e9 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Fourth_To_Last_Page_Offset_Negative_2_NET11_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 7, + "TotalCount": 20, + "Items": [ + "Momentumix", + "Nebularis" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Synerflux' +-- @value2='19' +-- @p4='3' +-- @p='4' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" < @value OR (b."Name" = @value AND b."Id" < @value2) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p4 OFFSET @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_Page_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_Page_NET11_0.snap new file mode 100644 index 00000000000..0f4e7717193 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_Page_NET11_0.snap @@ -0,0 +1,22 @@ +--------------- +{ + "Page": 2, + "TotalCount": 20, + "Items": [ + "Celestara", + "Dynamova" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Brightex' +-- @value2='2' +-- @p='3' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value2) +ORDER BY b."Name", b."Id" +LIMIT @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_To_Last_Page_Offset_0_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_To_Last_Page_Offset_0_NET11_0.snap new file mode 100644 index 00000000000..627bbc5cdd9 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Second_To_Last_Page_Offset_0_NET11_0.snap @@ -0,0 +1,22 @@ +--------------- +{ + "Page": 9, + "TotalCount": 20, + "Items": [ + "Quantumis", + "Radiantum" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Synerflux' +-- @value2='19' +-- @p='3' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" < @value OR (b."Name" = @value AND b."Id" < @value2) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_Page_With_Offset_1_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_Page_With_Offset_1_NET11_0.snap new file mode 100644 index 00000000000..eb019c5bc05 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_Page_With_Offset_1_NET11_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 3, + "TotalCount": 20, + "Items": [ + "Evolvance", + "Futurova" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Brightex' +-- @value2='2' +-- @p4='3' +-- @p='2' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value2) +ORDER BY b."Name", b."Id" +LIMIT @p4 OFFSET @p +--------------- diff --git a/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_To_Last_Page_Offset_Negative_1_NET11_0.snap b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_To_Last_Page_Offset_Negative_1_NET11_0.snap new file mode 100644 index 00000000000..5942c855510 --- /dev/null +++ b/src/GreenDonut/test/GreenDonut.Data.EntityFramework.Tests/__snapshots__/RelativeCursorTests.Fetch_Third_To_Last_Page_Offset_Negative_1_NET11_0.snap @@ -0,0 +1,23 @@ +--------------- +{ + "Page": 8, + "TotalCount": 20, + "Items": [ + "Omniflex", + "Pulsarix" + ] +} +--------------- + +SQL 0 +--------------- +-- @value='Synerflux' +-- @value2='19' +-- @p4='3' +-- @p='2' +SELECT b."Id", b."GroupId", b."Name" +FROM "Brands" AS b +WHERE b."Name" < @value OR (b."Name" = @value AND b."Id" < @value2) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @p4 OFFSET @p +--------------- diff --git a/src/HotChocolate/Adapters/src/Adapters.OpenApi.AspNetCore/DynamicOpenApiDocumentTransformer.cs b/src/HotChocolate/Adapters/src/Adapters.OpenApi.AspNetCore/DynamicOpenApiDocumentTransformer.cs index c4bd73bab8a..576bb6fe519 100644 --- a/src/HotChocolate/Adapters/src/Adapters.OpenApi.AspNetCore/DynamicOpenApiDocumentTransformer.cs +++ b/src/HotChocolate/Adapters/src/Adapters.OpenApi.AspNetCore/DynamicOpenApiDocumentTransformer.cs @@ -285,10 +285,17 @@ private EndpointDescriptor CreateEndpointDescriptor(OpenApiEndpointDefinition en var requestBody = new OpenApiRequestBody { Required = true, +#if NET11_0_OR_GREATER + Content = new Dictionary + { + [JsonContentType] = new OpenApiMediaType { Schema = requestBodyType } + } +#else Content = new Dictionary { [JsonContentType] = new() { Schema = requestBodyType } } +#endif }; operation.RequestBody = requestBody; @@ -317,7 +324,11 @@ private EndpointDescriptor CreateEndpointDescriptor(OpenApiEndpointDefinition en operation.Responses["200"] = new OpenApiResponse { +#if NET11_0_OR_GREATER + Content = new ConcurrentDictionary { [JsonContentType] = responseBody } +#else Content = new ConcurrentDictionary { [JsonContentType] = responseBody } +#endif }; return new EndpointDescriptor( diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Duplicated_Field_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Duplicated_Field_NET11_0.json new file mode 100644 index 00000000000..4fba7fe3f93 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Duplicated_Field_NET11_0.json @@ -0,0 +1,49 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users": { + "get": { + "operationId": "getUsers", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Duplicated_Model_Names_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Duplicated_Model_Names_NET11_0.json new file mode 100644 index 00000000000..27a501201db --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Duplicated_Model_Names_NET11_0.json @@ -0,0 +1,57 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users": { + "get": { + "operationId": "getUsers", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "required": [ + "address" + ], + "type": "object", + "properties": { + "address": { + "required": [ + "street" + ], + "type": "object", + "properties": { + "street": { + "type": "string" + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Duplicated_Operation_Names_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Duplicated_Operation_Names_NET11_0.json new file mode 100644 index 00000000000..8148a8a334a --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Duplicated_Operation_Names_NET11_0.json @@ -0,0 +1,88 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users": { + "get": { + "operationId": "getUsers", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "id", + "name" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/users/v2": { + "get": { + "operationId": "getUsers_1", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Duplicated_Routes_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Duplicated_Routes_NET11_0.json new file mode 100644 index 00000000000..595ab1117f1 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Duplicated_Routes_NET11_0.json @@ -0,0 +1,50 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users": { + "get": { + "operationId": "getUsers", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "address" + ], + "type": "object", + "properties": { + "address": { + "required": [ + "street" + ], + "type": "object", + "properties": { + "street": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_NET11_0.json new file mode 100644 index 00000000000..94d80dde115 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_NET11_0.json @@ -0,0 +1,71 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "required": [ + "name", + "email" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_Fields_And_FragmentDocument_Reference_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_Fields_And_FragmentDocument_Reference_NET11_0.json new file mode 100644 index 00000000000..c4d40c1248d --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_Fields_And_FragmentDocument_Reference_NET11_0.json @@ -0,0 +1,96 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "GlobalUser": { + "required": [ + "name", + "email" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + }, + "User": { + "allOf": [ + { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + }, + { + "$ref": "#/components/schemas/GlobalUser" + } + ] + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_Fields_And_Local_Fragment_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_Fields_And_Local_Fragment_NET11_0.json new file mode 100644 index 00000000000..e53b187d93e --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_Fields_And_Local_Fragment_NET11_0.json @@ -0,0 +1,115 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + }, + { + "$ref": "#/components/schemas/User" + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "allOf": [ + { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + }, + { + "required": [ + "name", + "email" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + ] + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_FragmentDocument_Reference_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_FragmentDocument_Reference_NET11_0.json new file mode 100644 index 00000000000..61e5d53c2f9 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_FragmentDocument_Reference_NET11_0.json @@ -0,0 +1,97 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Address": { + "required": [ + "street" + ], + "type": "object", + "properties": { + "street": { + "type": "string" + } + } + }, + "User": { + "required": [ + "id", + "name", + "email", + "address" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + }, + "address": { + "$ref": "#/components/schemas/Address" + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_Local_Fragment_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_Local_Fragment_NET11_0.json new file mode 100644 index 00000000000..80926b2ee24 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_Local_Fragment_NET11_0.json @@ -0,0 +1,94 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "required": [ + "id", + "name", + "email", + "address" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + }, + "address": { + "required": [ + "street" + ], + "type": "object", + "properties": { + "street": { + "type": "string" + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_Local_Fragment_With_FragmentDocument_Reference_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_Local_Fragment_With_FragmentDocument_Reference_NET11_0.json new file mode 100644 index 00000000000..61e5d53c2f9 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.FragmentDocument_With_Local_Fragment_With_FragmentDocument_Reference_NET11_0.json @@ -0,0 +1,97 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Address": { + "required": [ + "street" + ], + "type": "object", + "properties": { + "street": { + "type": "string" + } + } + }, + "User": { + "required": [ + "id", + "name", + "email", + "address" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + }, + "address": { + "$ref": "#/components/schemas/Address" + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.HotReload_Add_New_Document_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.HotReload_Add_New_Document_NET11_0.json new file mode 100644 index 00000000000..4fba7fe3f93 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.HotReload_Add_New_Document_NET11_0.json @@ -0,0 +1,49 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users": { + "get": { + "operationId": "getUsers", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.HotReload_Remove_Existing_Operation_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.HotReload_Remove_Existing_Operation_NET11_0.json new file mode 100644 index 00000000000..06dac73c1a4 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.HotReload_Remove_Existing_Operation_NET11_0.json @@ -0,0 +1,13 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.HotReload_Update_Existing_Document_Different_Route_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.HotReload_Update_Existing_Document_Different_Route_NET11_0.json new file mode 100644 index 00000000000..230f02fc6ee --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.HotReload_Update_Existing_Document_Different_Route_NET11_0.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users-new": { + "get": { + "operationId": "getUsers", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "id", + "name" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.HotReload_Update_Existing_Document_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.HotReload_Update_Existing_Document_NET11_0.json new file mode 100644 index 00000000000..5f47b6b5f83 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.HotReload_Update_Existing_Document_NET11_0.json @@ -0,0 +1,53 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users": { + "get": { + "operationId": "getUsers", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "id", + "name" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Missing_Field_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Missing_Field_NET11_0.json new file mode 100644 index 00000000000..4fba7fe3f93 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Missing_Field_NET11_0.json @@ -0,0 +1,49 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users": { + "get": { + "operationId": "getUsers", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Missing_Model_References_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Missing_Model_References_NET11_0.json new file mode 100644 index 00000000000..4fba7fe3f93 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.Missing_Model_References_NET11_0.json @@ -0,0 +1,49 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users": { + "get": { + "operationId": "getUsers", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET11_0.json new file mode 100644 index 00000000000..4b98a7ed394 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET11_0.json @@ -0,0 +1,1181 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/complex": { + "post": { + "operationId": "complexObjectQuery", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "any", + "base64String", + "boolean", + "byte", + "date", + "dateTime", + "decimal", + "duration", + "enum", + "float", + "id", + "int", + "json", + "list", + "localDate", + "localDateTime", + "localTime", + "long", + "nonNullDeprecated", + "object", + "short", + "string", + "unknown", + "unsignedByte", + "unsignedInt", + "unsignedLong", + "unsignedShort", + "uri", + "url", + "uuid" + ], + "type": "object", + "properties": { + "any": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "object" + }, + { + "type": "array" + } + ], + "description": "The `Any` scalar type represents any valid GraphQL value." + }, + "base64String": { + "pattern": "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$", + "type": "string", + "description": "The `Base64String` scalar type represents an array of bytes encoded as a Base64 string." + }, + "boolean": { + "type": "boolean" + }, + "byte": { + "type": "integer", + "description": "The `Byte` scalar type represents a signed 8-bit integer.", + "format": "int8" + }, + "date": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "type": "string", + "description": "The `Date` scalar type represents a date in UTC.", + "format": "date" + }, + "dateTime": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", + "type": "string", + "description": "The `DateTime` scalar type represents a date and time with time zone offset information.", + "format": "date-time" + }, + "decimal": { + "type": "number", + "description": "The `Decimal` scalar type represents a decimal floating-point number with high precision." + }, + "duration": { + "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$", + "type": "string", + "description": "The `Duration` scalar type represents a duration of time.", + "format": "duration" + }, + "enum": { + "enum": [ + "VALUE1", + "VALUE2" + ], + "type": "string" + }, + "float": { + "type": "number", + "format": "double" + }, + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "int": { + "type": "integer", + "format": "int32" + }, + "json": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "object" + }, + { + "type": "array" + } + ], + "description": "The `Any` scalar type represents any valid GraphQL value." + }, + "list": { + "type": "array", + "items": { + "type": "string" + } + }, + "localDate": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "type": "string", + "description": "The `LocalDate` scalar type represents a date without time or time zone information.", + "format": "date" + }, + "localDateTime": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": "string", + "description": "The `LocalDateTime` scalar type represents a date and time without time zone information." + }, + "localTime": { + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": "string", + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." + }, + "long": { + "type": "integer", + "description": "The `Long` scalar type represents a signed 64-bit integer.", + "format": "int64" + }, + "nonNullDeprecated": { + "type": "integer", + "description": "nonNullDeprecated description", + "format": "int32", + "deprecated": true + }, + "nullableObject": { + "allOf": [ + { + "$ref": "#/components/schemas/Object1NullableInput" + } + ], + "description": "nullableObject description", + "deprecated": true + }, + "object": { + "$ref": "#/components/schemas/Object1NonNullableInput" + }, + "short": { + "type": "integer", + "description": "The `Short` scalar type represents a signed 16-bit integer.", + "format": "int16" + }, + "string": { + "type": "string" + }, + "unknown": { + "type": "string" + }, + "unsignedByte": { + "type": "integer", + "description": "The `UnsignedByte` scalar type represents an unsigned 8-bit integer.", + "format": "uint8" + }, + "unsignedInt": { + "type": "integer", + "description": "The `UnsignedInt` scalar type represents an unsigned 32-bit integer.", + "format": "uint32" + }, + "unsignedLong": { + "type": "integer", + "description": "The `UnsignedLong` scalar type represents an unsigned 64-bit integer.", + "format": "uint64" + }, + "unsignedShort": { + "type": "integer", + "description": "The `UnsignedShort` scalar type represents an unsigned 16-bit integer.", + "format": "uint16" + }, + "uri": { + "type": "string", + "description": "The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986.", + "format": "uri" + }, + "url": { + "type": "string", + "description": "The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986.", + "format": "uri" + }, + "uuid": { + "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$", + "type": "string", + "description": "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562.", + "format": "uuid" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "any", + "base64String", + "boolean", + "byte", + "date", + "dateTime", + "decimal", + "duration", + "enum", + "float", + "id", + "int", + "json", + "list", + "localDate", + "localDateTime", + "localTime", + "long", + "object", + "short", + "string", + "unknown", + "url", + "uuid" + ], + "type": "object", + "properties": { + "any": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "object" + }, + { + "type": "array" + } + ], + "description": "The `Any` scalar type represents any valid GraphQL value." + }, + "base64String": { + "pattern": "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$", + "type": [ + "null", + "string" + ], + "description": "The `Base64String` scalar type represents an array of bytes encoded as a Base64 string." + }, + "boolean": { + "type": [ + "null", + "boolean" + ] + }, + "byte": { + "type": [ + "null", + "integer" + ], + "description": "The `Byte` scalar type represents a signed 8-bit integer.", + "format": "int8" + }, + "date": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "type": [ + "null", + "string" + ], + "description": "The `Date` scalar type represents a date in UTC.", + "format": "date" + }, + "dateTime": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", + "type": [ + "null", + "string" + ], + "description": "The `DateTime` scalar type represents a date and time with time zone offset information.", + "format": "date-time" + }, + "decimal": { + "type": [ + "null", + "number" + ], + "description": "The `Decimal` scalar type represents a decimal floating-point number with high precision." + }, + "duration": { + "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$", + "type": [ + "null", + "string" + ], + "description": "The `Duration` scalar type represents a duration of time.", + "format": "duration" + }, + "enum": { + "enum": [ + "VALUE1", + "VALUE2" + ], + "type": [ + "null", + "string" + ] + }, + "float": { + "type": [ + "null", + "number" + ], + "format": "double" + }, + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "int": { + "type": [ + "null", + "integer" + ], + "format": "int32" + }, + "json": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "object" + }, + { + "type": "array" + } + ], + "description": "The `Any` scalar type represents any valid GraphQL value." + }, + "list": { + "type": [ + "null", + "array" + ], + "items": { + "type": [ + "null", + "string" + ] + } + }, + "localDate": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "type": [ + "null", + "string" + ], + "description": "The `LocalDate` scalar type represents a date without time or time zone information.", + "format": "date" + }, + "localDateTime": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": [ + "null", + "string" + ], + "description": "The `LocalDateTime` scalar type represents a date and time without time zone information." + }, + "localTime": { + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": [ + "null", + "string" + ], + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." + }, + "long": { + "type": [ + "null", + "integer" + ], + "description": "The `Long` scalar type represents a signed 64-bit integer.", + "format": "int64" + }, + "object": { + "required": [ + "field1A" + ], + "type": [ + "null", + "object" + ], + "properties": { + "field1A": { + "required": [ + "field1B" + ], + "type": [ + "null", + "object" + ], + "properties": { + "field1B": { + "required": [ + "field1C" + ], + "type": [ + "null", + "object" + ], + "properties": { + "field1C": { + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": [ + "null", + "string" + ], + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." + } + } + } + } + } + } + }, + "short": { + "type": [ + "null", + "integer" + ], + "description": "The `Short` scalar type represents a signed 16-bit integer.", + "format": "int16" + }, + "string": { + "type": [ + "null", + "string" + ] + }, + "unknown": { + "type": [ + "null", + "string" + ] + }, + "url": { + "type": [ + "null", + "string" + ], + "description": "The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986.", + "format": "uri" + }, + "uuid": { + "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$", + "type": [ + "null", + "string" + ], + "description": "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562.", + "format": "uuid" + } + } + } + } + } + } + } + } + }, + "/users": { + "post": { + "description": "Creates a user", + "operationId": "createUser", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "email", + "id", + "name" + ], + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The user's email" + }, + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "id", + "name", + "email" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + } + } + } + } + }, + "get": { + "description": "Fetches all users", + "operationId": "getUsers", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "id" + ], + "type": [ + "null", + "object" + ], + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + } + } + } + } + } + } + } + }, + "/users/{userId}/details": { + "get": { + "operationId": "getFullUser", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + }, + { + "name": "includeAddress", + "in": "query", + "required": true, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "id", + "name", + "email" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + }, + "address": { + "$ref": "#/components/schemas/UserAddress" + } + } + } + } + } + } + } + } + }, + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "id", + "name", + "email" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + } + } + } + } + }, + "put": { + "description": "Updates a user's details", + "operationId": "updateUser", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "email", + "name" + ], + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The user's email" + }, + "name": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "id", + "name", + "email" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + } + } + } + } + } + }, + "/interface": { + "get": { + "operationId": "interfaceQuery", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "required": [ + "petType", + "name" + ], + "type": "object", + "properties": { + "petType": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "isPurring": { + "type": "boolean" + } + } + }, + { + "type": "object", + "properties": { + "isBarking": { + "type": "boolean" + } + } + } + ] + } + ] + } + } + } + } + } + } + }, + "/union": { + "get": { + "operationId": "unionQuery", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "required": [ + "petType" + ], + "type": "object", + "properties": { + "petType": { + "type": "string" + } + } + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "isPurring": { + "type": "boolean" + } + } + }, + { + "type": "object", + "properties": { + "isBarking": { + "type": "boolean" + } + } + } + ] + } + ] + } + } + } + } + } + } + }, + "/object/{userId}": { + "put": { + "operationId": "updateDeeplyNestedObject", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "field", + "in": "query", + "schema": { + "type": "string", + "default": "DefaultValue" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "field", + "object" + ], + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "object": { + "required": [ + "otherField" + ], + "type": "object", + "properties": { + "otherField": { + "type": "string" + } + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "userId", + "field", + "object" + ], + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "field": { + "type": "string" + }, + "object": { + "required": [ + "otherField", + "field2" + ], + "type": "object", + "properties": { + "otherField": { + "type": "string" + }, + "field2": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Object1NonNullableInput": { + "required": [ + "field1A" + ], + "type": "object", + "properties": { + "field1A": { + "allOf": [ + { + "$ref": "#/components/schemas/Object2NonNullableInput" + } + ], + "description": "field1A description" + } + } + }, + "Object1NullableInput": { + "type": "object", + "properties": { + "field1A": { + "allOf": [ + { + "$ref": "#/components/schemas/Object2NullableInput" + } + ], + "description": "field1A description" + } + } + }, + "Object2NonNullableInput": { + "required": [ + "field1B" + ], + "type": "object", + "properties": { + "field1B": { + "allOf": [ + { + "$ref": "#/components/schemas/Object3NonNullableInput" + } + ], + "description": "field1B description" + } + } + }, + "Object2NullableInput": { + "type": "object", + "properties": { + "field1B": { + "allOf": [ + { + "$ref": "#/components/schemas/Object3NullableInput" + } + ], + "description": "field1B description" + } + } + }, + "Object3NonNullableInput": { + "required": [ + "field1C" + ], + "type": "object", + "properties": { + "field1C": { + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": "string", + "description": "field1C description" + } + } + }, + "Object3NullableInput": { + "type": "object", + "properties": { + "field1C": { + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": "string", + "description": "field1C description" + } + } + }, + "UserAddress": { + "required": [ + "street" + ], + "type": "object", + "properties": { + "street": { + "type": "string" + } + }, + "description": "The user's address" + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET11_0_Fusion.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET11_0_Fusion.json new file mode 100644 index 00000000000..4b98a7ed394 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OpenApi_Includes_Initial_Routes_NET11_0_Fusion.json @@ -0,0 +1,1181 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/complex": { + "post": { + "operationId": "complexObjectQuery", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "any", + "base64String", + "boolean", + "byte", + "date", + "dateTime", + "decimal", + "duration", + "enum", + "float", + "id", + "int", + "json", + "list", + "localDate", + "localDateTime", + "localTime", + "long", + "nonNullDeprecated", + "object", + "short", + "string", + "unknown", + "unsignedByte", + "unsignedInt", + "unsignedLong", + "unsignedShort", + "uri", + "url", + "uuid" + ], + "type": "object", + "properties": { + "any": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "object" + }, + { + "type": "array" + } + ], + "description": "The `Any` scalar type represents any valid GraphQL value." + }, + "base64String": { + "pattern": "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$", + "type": "string", + "description": "The `Base64String` scalar type represents an array of bytes encoded as a Base64 string." + }, + "boolean": { + "type": "boolean" + }, + "byte": { + "type": "integer", + "description": "The `Byte` scalar type represents a signed 8-bit integer.", + "format": "int8" + }, + "date": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "type": "string", + "description": "The `Date` scalar type represents a date in UTC.", + "format": "date" + }, + "dateTime": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", + "type": "string", + "description": "The `DateTime` scalar type represents a date and time with time zone offset information.", + "format": "date-time" + }, + "decimal": { + "type": "number", + "description": "The `Decimal` scalar type represents a decimal floating-point number with high precision." + }, + "duration": { + "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$", + "type": "string", + "description": "The `Duration` scalar type represents a duration of time.", + "format": "duration" + }, + "enum": { + "enum": [ + "VALUE1", + "VALUE2" + ], + "type": "string" + }, + "float": { + "type": "number", + "format": "double" + }, + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "int": { + "type": "integer", + "format": "int32" + }, + "json": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "object" + }, + { + "type": "array" + } + ], + "description": "The `Any` scalar type represents any valid GraphQL value." + }, + "list": { + "type": "array", + "items": { + "type": "string" + } + }, + "localDate": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "type": "string", + "description": "The `LocalDate` scalar type represents a date without time or time zone information.", + "format": "date" + }, + "localDateTime": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": "string", + "description": "The `LocalDateTime` scalar type represents a date and time without time zone information." + }, + "localTime": { + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": "string", + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." + }, + "long": { + "type": "integer", + "description": "The `Long` scalar type represents a signed 64-bit integer.", + "format": "int64" + }, + "nonNullDeprecated": { + "type": "integer", + "description": "nonNullDeprecated description", + "format": "int32", + "deprecated": true + }, + "nullableObject": { + "allOf": [ + { + "$ref": "#/components/schemas/Object1NullableInput" + } + ], + "description": "nullableObject description", + "deprecated": true + }, + "object": { + "$ref": "#/components/schemas/Object1NonNullableInput" + }, + "short": { + "type": "integer", + "description": "The `Short` scalar type represents a signed 16-bit integer.", + "format": "int16" + }, + "string": { + "type": "string" + }, + "unknown": { + "type": "string" + }, + "unsignedByte": { + "type": "integer", + "description": "The `UnsignedByte` scalar type represents an unsigned 8-bit integer.", + "format": "uint8" + }, + "unsignedInt": { + "type": "integer", + "description": "The `UnsignedInt` scalar type represents an unsigned 32-bit integer.", + "format": "uint32" + }, + "unsignedLong": { + "type": "integer", + "description": "The `UnsignedLong` scalar type represents an unsigned 64-bit integer.", + "format": "uint64" + }, + "unsignedShort": { + "type": "integer", + "description": "The `UnsignedShort` scalar type represents an unsigned 16-bit integer.", + "format": "uint16" + }, + "uri": { + "type": "string", + "description": "The `URI` scalar type represents a Uniform Resource Identifier (URI) as defined by RFC 3986.", + "format": "uri" + }, + "url": { + "type": "string", + "description": "The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986.", + "format": "uri" + }, + "uuid": { + "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$", + "type": "string", + "description": "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562.", + "format": "uuid" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "any", + "base64String", + "boolean", + "byte", + "date", + "dateTime", + "decimal", + "duration", + "enum", + "float", + "id", + "int", + "json", + "list", + "localDate", + "localDateTime", + "localTime", + "long", + "object", + "short", + "string", + "unknown", + "url", + "uuid" + ], + "type": "object", + "properties": { + "any": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "object" + }, + { + "type": "array" + } + ], + "description": "The `Any` scalar type represents any valid GraphQL value." + }, + "base64String": { + "pattern": "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$", + "type": [ + "null", + "string" + ], + "description": "The `Base64String` scalar type represents an array of bytes encoded as a Base64 string." + }, + "boolean": { + "type": [ + "null", + "boolean" + ] + }, + "byte": { + "type": [ + "null", + "integer" + ], + "description": "The `Byte` scalar type represents a signed 8-bit integer.", + "format": "int8" + }, + "date": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "type": [ + "null", + "string" + ], + "description": "The `Date` scalar type represents a date in UTC.", + "format": "date" + }, + "dateTime": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:[Zz]|[+-]\\d{2}:\\d{2})$", + "type": [ + "null", + "string" + ], + "description": "The `DateTime` scalar type represents a date and time with time zone offset information.", + "format": "date-time" + }, + "decimal": { + "type": [ + "null", + "number" + ], + "description": "The `Decimal` scalar type represents a decimal floating-point number with high precision." + }, + "duration": { + "pattern": "^-?P(?:\\d+W|(?=\\d|T(?:\\d|$))(?:\\d+Y)?(?:\\d+M)?(?:\\d+D)?(?:T(?:\\d+H)?(?:\\d+M)?(?:\\d+(?:\\.\\d+)?S)?)?)$", + "type": [ + "null", + "string" + ], + "description": "The `Duration` scalar type represents a duration of time.", + "format": "duration" + }, + "enum": { + "enum": [ + "VALUE1", + "VALUE2" + ], + "type": [ + "null", + "string" + ] + }, + "float": { + "type": [ + "null", + "number" + ], + "format": "double" + }, + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "int": { + "type": [ + "null", + "integer" + ], + "format": "int32" + }, + "json": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "object" + }, + { + "type": "array" + } + ], + "description": "The `Any` scalar type represents any valid GraphQL value." + }, + "list": { + "type": [ + "null", + "array" + ], + "items": { + "type": [ + "null", + "string" + ] + } + }, + "localDate": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}$", + "type": [ + "null", + "string" + ], + "description": "The `LocalDate` scalar type represents a date without time or time zone information.", + "format": "date" + }, + "localDateTime": { + "pattern": "^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": [ + "null", + "string" + ], + "description": "The `LocalDateTime` scalar type represents a date and time without time zone information." + }, + "localTime": { + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": [ + "null", + "string" + ], + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." + }, + "long": { + "type": [ + "null", + "integer" + ], + "description": "The `Long` scalar type represents a signed 64-bit integer.", + "format": "int64" + }, + "object": { + "required": [ + "field1A" + ], + "type": [ + "null", + "object" + ], + "properties": { + "field1A": { + "required": [ + "field1B" + ], + "type": [ + "null", + "object" + ], + "properties": { + "field1B": { + "required": [ + "field1C" + ], + "type": [ + "null", + "object" + ], + "properties": { + "field1C": { + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": [ + "null", + "string" + ], + "description": "The `LocalTime` scalar type represents a time of day without date or time zone information." + } + } + } + } + } + } + }, + "short": { + "type": [ + "null", + "integer" + ], + "description": "The `Short` scalar type represents a signed 16-bit integer.", + "format": "int16" + }, + "string": { + "type": [ + "null", + "string" + ] + }, + "unknown": { + "type": [ + "null", + "string" + ] + }, + "url": { + "type": [ + "null", + "string" + ], + "description": "The `URL` scalar type represents a Uniform Resource Locator (URL) as defined by RFC 3986.", + "format": "uri" + }, + "uuid": { + "pattern": "^[\\da-fA-F]{8}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{4}-[\\da-fA-F]{12}$", + "type": [ + "null", + "string" + ], + "description": "The `UUID` scalar type represents a Universally Unique Identifier (UUID) as defined by RFC 9562.", + "format": "uuid" + } + } + } + } + } + } + } + } + }, + "/users": { + "post": { + "description": "Creates a user", + "operationId": "createUser", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "email", + "id", + "name" + ], + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The user's email" + }, + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "id", + "name", + "email" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + } + } + } + } + }, + "get": { + "description": "Fetches all users", + "operationId": "getUsers", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "id" + ], + "type": [ + "null", + "object" + ], + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + } + } + } + } + } + } + } + }, + "/users/{userId}/details": { + "get": { + "operationId": "getFullUser", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + }, + { + "name": "includeAddress", + "in": "query", + "required": true, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "id", + "name", + "email" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + }, + "address": { + "$ref": "#/components/schemas/UserAddress" + } + } + } + } + } + } + } + } + }, + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "id", + "name", + "email" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + } + } + } + } + }, + "put": { + "description": "Updates a user's details", + "operationId": "updateUser", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "email", + "name" + ], + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The user's email" + }, + "name": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "id", + "name", + "email" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + } + } + } + } + } + }, + "/interface": { + "get": { + "operationId": "interfaceQuery", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "required": [ + "petType", + "name" + ], + "type": "object", + "properties": { + "petType": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "isPurring": { + "type": "boolean" + } + } + }, + { + "type": "object", + "properties": { + "isBarking": { + "type": "boolean" + } + } + } + ] + } + ] + } + } + } + } + } + } + }, + "/union": { + "get": { + "operationId": "unionQuery", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "required": [ + "petType" + ], + "type": "object", + "properties": { + "petType": { + "type": "string" + } + } + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "isPurring": { + "type": "boolean" + } + } + }, + { + "type": "object", + "properties": { + "isBarking": { + "type": "boolean" + } + } + } + ] + } + ] + } + } + } + } + } + } + }, + "/object/{userId}": { + "put": { + "operationId": "updateDeeplyNestedObject", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "field", + "in": "query", + "schema": { + "type": "string", + "default": "DefaultValue" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "field", + "object" + ], + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "object": { + "required": [ + "otherField" + ], + "type": "object", + "properties": { + "otherField": { + "type": "string" + } + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "userId", + "field", + "object" + ], + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "field": { + "type": "string" + }, + "object": { + "required": [ + "otherField", + "field2" + ], + "type": "object", + "properties": { + "otherField": { + "type": "string" + }, + "field2": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Object1NonNullableInput": { + "required": [ + "field1A" + ], + "type": "object", + "properties": { + "field1A": { + "allOf": [ + { + "$ref": "#/components/schemas/Object2NonNullableInput" + } + ], + "description": "field1A description" + } + } + }, + "Object1NullableInput": { + "type": "object", + "properties": { + "field1A": { + "allOf": [ + { + "$ref": "#/components/schemas/Object2NullableInput" + } + ], + "description": "field1A description" + } + } + }, + "Object2NonNullableInput": { + "required": [ + "field1B" + ], + "type": "object", + "properties": { + "field1B": { + "allOf": [ + { + "$ref": "#/components/schemas/Object3NonNullableInput" + } + ], + "description": "field1B description" + } + } + }, + "Object2NullableInput": { + "type": "object", + "properties": { + "field1B": { + "allOf": [ + { + "$ref": "#/components/schemas/Object3NullableInput" + } + ], + "description": "field1B description" + } + } + }, + "Object3NonNullableInput": { + "required": [ + "field1C" + ], + "type": "object", + "properties": { + "field1C": { + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": "string", + "description": "field1C description" + } + } + }, + "Object3NullableInput": { + "type": "object", + "properties": { + "field1C": { + "pattern": "^\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?$", + "type": "string", + "description": "field1C description" + } + } + }, + "UserAddress": { + "required": [ + "street" + ], + "type": "object", + "properties": { + "street": { + "type": "string" + } + }, + "description": "The user's address" + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_NET11_0.json new file mode 100644 index 00000000000..d09669613a1 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_NET11_0.json @@ -0,0 +1,64 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "name", + "email" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Default_Value_For_Variable_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Default_Value_For_Variable_NET11_0.json new file mode 100644 index 00000000000..9e25ad2843f --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Default_Value_For_Variable_NET11_0.json @@ -0,0 +1,86 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}/details": { + "get": { + "operationId": "getFullUser", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + }, + { + "name": "includeAddress", + "in": "query", + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "id", + "name" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "address": { + "required": [ + "street" + ], + "type": "object", + "properties": { + "street": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Fields_And_FragmentDocument_Reference_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Fields_And_FragmentDocument_Reference_NET11_0.json new file mode 100644 index 00000000000..005bd3808f5 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Fields_And_FragmentDocument_Reference_NET11_0.json @@ -0,0 +1,93 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + }, + { + "$ref": "#/components/schemas/User" + } + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "required": [ + "name", + "email" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Fields_And_Local_Fragment_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Fields_And_Local_Fragment_NET11_0.json new file mode 100644 index 00000000000..21e2edd7a82 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Fields_And_Local_Fragment_NET11_0.json @@ -0,0 +1,86 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + }, + { + "required": [ + "name", + "email" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + ] + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_FragmentDocument_Reference_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_FragmentDocument_Reference_NET11_0.json new file mode 100644 index 00000000000..ddecfa5f597 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_FragmentDocument_Reference_NET11_0.json @@ -0,0 +1,82 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "User": { + "required": [ + "id", + "name", + "email" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_FragmentDocument_Reference_On_Nullable_Field_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_FragmentDocument_Reference_On_Nullable_Field_NET11_0.json new file mode 100644 index 00000000000..07051e7d398 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_FragmentDocument_Reference_On_Nullable_Field_NET11_0.json @@ -0,0 +1,79 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "preferences" + ], + "type": "object", + "properties": { + "preferences": { + "allOf": [ + { + "$ref": "#/components/schemas/Preferences" + }, + { + "type": "null" + } + ] + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Preferences": { + "required": [ + "color" + ], + "type": "object", + "properties": { + "color": { + "type": "string" + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_List_Of_Unions_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_List_Of_Unions_NET11_0.json new file mode 100644 index 00000000000..51ddf7ce939 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_List_Of_Unions_NET11_0.json @@ -0,0 +1,82 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/pets": { + "get": { + "description": "Fetches a list of pets", + "operationId": "getPets", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "allOf": [ + { + "required": [ + "petType" + ], + "type": "object", + "properties": { + "petType": { + "type": "string" + } + } + }, + { + "oneOf": [ + { + "allOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + { + "type": "object", + "properties": { + "isPurring": { + "type": "boolean" + } + } + } + ] + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "isBarking": { + "type": "boolean" + } + } + } + ] + } + ] + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_List_With_Nullable_And_NonNull_Items_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_List_With_Nullable_And_NonNull_Items_NET11_0.json new file mode 100644 index 00000000000..86d946c31a6 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_List_With_Nullable_And_NonNull_Items_NET11_0.json @@ -0,0 +1,59 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/list-nonnull": { + "get": { + "description": "Fetches a list with non-null items", + "operationId": "getListNonNullItems", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "/list-nullable": { + "get": { + "description": "Fetches a list with nullable items", + "operationId": "getListNullableItems", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": [ + "null", + "string" + ] + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Local_Fragment_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Local_Fragment_NET11_0.json new file mode 100644 index 00000000000..3e453e0ed01 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Local_Fragment_NET11_0.json @@ -0,0 +1,75 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "id", + "name", + "email" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Local_Fragment_With_FragmentDocument_Reference_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Local_Fragment_With_FragmentDocument_Reference_NET11_0.json new file mode 100644 index 00000000000..7bb0e9d657c --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTestBase.OperationDocument_With_Local_Fragment_With_FragmentDocument_Reference_NET11_0.json @@ -0,0 +1,95 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/users/{userId}": { + "get": { + "description": "Fetches a user by their id", + "operationId": "getUserById", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + } + ], + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "id", + "name", + "email", + "address" + ], + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "name": { + "type": "string" + }, + "email": { + "type": [ + "null", + "string" + ] + }, + "address": { + "$ref": "#/components/schemas/Address" + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Address": { + "required": [ + "street" + ], + "type": "object", + "properties": { + "street": { + "type": "string" + } + }, + "description": "An address" + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.Indirect_Input_Type_Via_Mutation_Body_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.Indirect_Input_Type_Via_Mutation_Body_NET11_0.json new file mode 100644 index 00000000000..a52ae68f416 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.Indirect_Input_Type_Via_Mutation_Body_NET11_0.json @@ -0,0 +1,75 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/indirect-input": { + "post": { + "operationId": "submitIndirect", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "middle": { + "$ref": "#/components/schemas/IndirectMiddleInput" + }, + "name": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "IndirectMiddleInput": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "parent": { + "$ref": "#/components/schemas/IndirectParentInput" + } + } + }, + "IndirectParentInput": { + "type": "object", + "properties": { + "middle": { + "$ref": "#/components/schemas/IndirectMiddleInput" + }, + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.Indirect_Input_Type_With_Two_Sibling_Occurrences_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.Indirect_Input_Type_With_Two_Sibling_Occurrences_NET11_0.json new file mode 100644 index 00000000000..0829867d747 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.Indirect_Input_Type_With_Two_Sibling_Occurrences_NET11_0.json @@ -0,0 +1,64 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/two-children": { + "post": { + "operationId": "submitTwoChildren", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "left": { + "$ref": "#/components/schemas/SelfReferencingInput" + }, + "right": { + "$ref": "#/components/schemas/SelfReferencingInput" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SelfReferencingInput": { + "type": "object", + "properties": { + "child": { + "$ref": "#/components/schemas/SelfReferencingInput" + }, + "value": { + "type": "string" + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.Indirect_Output_Type_Via_Query_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.Indirect_Output_Type_Via_Query_NET11_0.json new file mode 100644 index 00000000000..eb5d441659d --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.Indirect_Output_Type_Via_Query_NET11_0.json @@ -0,0 +1,84 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/indirect-output": { + "get": { + "operationId": "getIndirect", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "value", + "middle" + ], + "type": "object", + "properties": { + "value": { + "type": "string" + }, + "middle": { + "required": [ + "label", + "parent" + ], + "type": [ + "null", + "object" + ], + "properties": { + "label": { + "type": "string" + }, + "parent": { + "required": [ + "value", + "middle" + ], + "type": [ + "null", + "object" + ], + "properties": { + "value": { + "type": "string" + }, + "middle": { + "required": [ + "label" + ], + "type": [ + "null", + "object" + ], + "properties": { + "label": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.SelfRef_Input_Type_Via_Mutation_Body_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.SelfRef_Input_Type_Via_Mutation_Body_NET11_0.json new file mode 100644 index 00000000000..3a63e7f1580 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.SelfRef_Input_Type_Via_Mutation_Body_NET11_0.json @@ -0,0 +1,64 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/self-ref": { + "post": { + "operationId": "submitSelfRef", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "child": { + "$ref": "#/components/schemas/SelfReferencingInput" + }, + "value": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SelfReferencingInput": { + "type": "object", + "properties": { + "child": { + "$ref": "#/components/schemas/SelfReferencingInput" + }, + "value": { + "type": "string" + } + } + } + } + } +} diff --git a/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.SelfRef_Output_Type_Via_Query_NET11_0.json b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.SelfRef_Output_Type_Via_Query_NET11_0.json new file mode 100644 index 00000000000..cc976e04ad1 --- /dev/null +++ b/src/HotChocolate/Adapters/test/Adapters.OpenApi.Tests/OpenApi/__snapshots__/OpenApiIntegrationTests.SelfRef_Output_Type_Via_Query_NET11_0.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.1.2", + "info": { + "title": "HotChocolate.Adapters.OpenApi.Tests | v1", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://localhost" + } + ], + "paths": { + "/tree": { + "get": { + "operationId": "getTree", + "responses": { + "200": { + "description": null, + "content": { + "application/json": { + "schema": { + "required": [ + "value", + "children" + ], + "type": "object", + "properties": { + "value": { + "type": "string" + }, + "children": { + "type": "array", + "items": { + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/src/HotChocolate/Core/benchmarks/Execution.Abstractions.Benchmarks/HotChocolate.Execution.Abstractions.Benchmarks.csproj b/src/HotChocolate/Core/benchmarks/Execution.Abstractions.Benchmarks/HotChocolate.Execution.Abstractions.Benchmarks.csproj index be09cc91e25..39e10f50f2a 100644 --- a/src/HotChocolate/Core/benchmarks/Execution.Abstractions.Benchmarks/HotChocolate.Execution.Abstractions.Benchmarks.csproj +++ b/src/HotChocolate/Core/benchmarks/Execution.Abstractions.Benchmarks/HotChocolate.Execution.Abstractions.Benchmarks.csproj @@ -2,7 +2,7 @@ Exe - net10.0 + net11.0 true Preview HotChocolate.Execution.Abstractions.Benchmarks diff --git a/src/HotChocolate/Core/benchmarks/Validation.Benchmarks/HotChocolate.Validation.Benchmarks.csproj b/src/HotChocolate/Core/benchmarks/Validation.Benchmarks/HotChocolate.Validation.Benchmarks.csproj index 7f58445b780..641c1ac9ed7 100644 --- a/src/HotChocolate/Core/benchmarks/Validation.Benchmarks/HotChocolate.Validation.Benchmarks.csproj +++ b/src/HotChocolate/Core/benchmarks/Validation.Benchmarks/HotChocolate.Validation.Benchmarks.csproj @@ -2,7 +2,7 @@ Exe - net10.0 + net11.0 true Preview HotChocolate.Validation.Benchmarks diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/DateTimeType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/DateTimeType.cs index 207d611cb37..9be0b7b6a29 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/DateTimeType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/DateTimeType.cs @@ -143,10 +143,16 @@ protected override StringValueNode OnValueToLiteral(DateTimeOffset runtimeValue) private bool TryParseStringValue(string serialized, out DateTimeOffset value) { // Check format. - if (_options.ValidateInputFormat && !_dateTimeRegex.IsMatch(serialized)) + if (_options.ValidateInputFormat) { - value = default; - return false; + var match = _dateTimeRegex.Match(serialized); + + // RFC 3339 does not support specifying the hour as 24. + if (!match.Success || match.Groups["hour"].Value == "24") + { + value = default; + return false; + } } if (DateTimeOffset.TryParse( @@ -208,52 +214,52 @@ private Regex GetDateTimeRegex() }; [GeneratedRegex( - @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})\z", + @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex DateTimeRegex0(); [GeneratedRegex( - @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9])?(Z|[+-][0-9]{2}:[0-9]{2})\z", + @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9])?(Z|[+-][0-9]{2}:[0-9]{2})\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex DateTimeRegex1(); [GeneratedRegex( - @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,2})?(Z|[+-][0-9]{2}:[0-9]{2})\z", + @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,2})?(Z|[+-][0-9]{2}:[0-9]{2})\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex DateTimeRegex2(); [GeneratedRegex( - @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,3})?(Z|[+-][0-9]{2}:[0-9]{2})\z", + @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,3})?(Z|[+-][0-9]{2}:[0-9]{2})\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex DateTimeRegex3(); [GeneratedRegex( - @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,4})?(Z|[+-][0-9]{2}:[0-9]{2})\z", + @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,4})?(Z|[+-][0-9]{2}:[0-9]{2})\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex DateTimeRegex4(); [GeneratedRegex( - @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,5})?(Z|[+-][0-9]{2}:[0-9]{2})\z", + @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,5})?(Z|[+-][0-9]{2}:[0-9]{2})\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex DateTimeRegex5(); [GeneratedRegex( - @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,6})?(Z|[+-][0-9]{2}:[0-9]{2})\z", + @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,6})?(Z|[+-][0-9]{2}:[0-9]{2})\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex DateTimeRegex6(); [GeneratedRegex( - @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,7})?(Z|[+-][0-9]{2}:[0-9]{2})\z", + @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,7})?(Z|[+-][0-9]{2}:[0-9]{2})\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex DateTimeRegex7(); [GeneratedRegex( - @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,8})?(Z|[+-][0-9]{2}:[0-9]{2})\z", + @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,8})?(Z|[+-][0-9]{2}:[0-9]{2})\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex DateTimeRegex8(); [GeneratedRegex( - @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,9})?(Z|[+-][0-9]{2}:[0-9]{2})\z", + @"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,9})?(Z|[+-][0-9]{2}:[0-9]{2})\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex DateTimeRegex9(); } diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/LocalDateTimeType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/LocalDateTimeType.cs index 9ade9201c2c..80d2e7e15bf 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/LocalDateTimeType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/LocalDateTimeType.cs @@ -133,10 +133,16 @@ protected override StringValueNode OnValueToLiteral(DateTime runtimeValue) private bool TryParseStringValue(string serialized, out DateTime value) { // Check format. - if (_options.ValidateInputFormat && !_localDateTimeRegex.IsMatch(serialized)) + if (_options.ValidateInputFormat) { - value = default; - return false; + var match = _localDateTimeRegex.Match(serialized); + + // RFC 3339 does not support specifying the hour as 24. + if (!match.Success || match.Groups["hour"].Value == "24") + { + value = default; + return false; + } } if (DateTime.TryParse( @@ -184,43 +190,43 @@ private Regex GetLocalDateTimeRegex() _ => LocalDateTimeRegex9() }; - [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\z", + [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex LocalDateTimeRegex0(); - [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9])?\z", + [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9])?\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex LocalDateTimeRegex1(); - [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,2})?\z", + [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,2})?\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex LocalDateTimeRegex2(); - [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,3})?\z", + [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,3})?\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex LocalDateTimeRegex3(); - [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,4})?\z", + [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,4})?\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex LocalDateTimeRegex4(); - [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,5})?\z", + [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,5})?\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex LocalDateTimeRegex5(); - [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,6})?\z", + [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,6})?\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex LocalDateTimeRegex6(); - [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,7})?\z", + [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,7})?\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex LocalDateTimeRegex7(); - [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,8})?\z", + [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,8})?\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex LocalDateTimeRegex8(); - [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,9})?\z", + [GeneratedRegex(@"^[0-9]{4}-[0-9]{2}-[0-9]{2}T(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,9})?\z", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase)] private static partial Regex LocalDateTimeRegex9(); } diff --git a/src/HotChocolate/Core/src/Types/Types/Scalars/LocalTimeType.cs b/src/HotChocolate/Core/src/Types/Types/Scalars/LocalTimeType.cs index 78f58848af6..48f2b2bd643 100644 --- a/src/HotChocolate/Core/src/Types/Types/Scalars/LocalTimeType.cs +++ b/src/HotChocolate/Core/src/Types/Types/Scalars/LocalTimeType.cs @@ -132,10 +132,16 @@ protected override StringValueNode OnValueToLiteral(TimeOnly runtimeValue) private bool TryParseStringValue(string serialized, out TimeOnly value) { // Check format. - if (_options.ValidateInputFormat && !_localTimeRegex.IsMatch(serialized)) + if (_options.ValidateInputFormat) { - value = default; - return false; + var match = _localTimeRegex.Match(serialized); + + // RFC 3339 does not support specifying the hour as 24. + if (!match.Success || match.Groups["hour"].Value == "24") + { + value = default; + return false; + } } if (TimeOnly.TryParse( @@ -182,33 +188,33 @@ private Regex GetLocalTimeRegex() _ => LocalTimeRegex9() }; - [GeneratedRegex(@"^[0-9]{2}:[0-9]{2}:[0-9]{2}\z", RegexOptions.ExplicitCapture)] + [GeneratedRegex(@"^(?[0-9]{2}):[0-9]{2}:[0-9]{2}\z", RegexOptions.ExplicitCapture)] private static partial Regex LocalTimeRegex0(); - [GeneratedRegex(@"^[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9])?\z", RegexOptions.ExplicitCapture)] + [GeneratedRegex(@"^(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9])?\z", RegexOptions.ExplicitCapture)] private static partial Regex LocalTimeRegex1(); - [GeneratedRegex(@"^[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,2})?\z", RegexOptions.ExplicitCapture)] + [GeneratedRegex(@"^(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,2})?\z", RegexOptions.ExplicitCapture)] private static partial Regex LocalTimeRegex2(); - [GeneratedRegex(@"^[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,3})?\z", RegexOptions.ExplicitCapture)] + [GeneratedRegex(@"^(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,3})?\z", RegexOptions.ExplicitCapture)] private static partial Regex LocalTimeRegex3(); - [GeneratedRegex(@"^[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,4})?\z", RegexOptions.ExplicitCapture)] + [GeneratedRegex(@"^(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,4})?\z", RegexOptions.ExplicitCapture)] private static partial Regex LocalTimeRegex4(); - [GeneratedRegex(@"^[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,5})?\z", RegexOptions.ExplicitCapture)] + [GeneratedRegex(@"^(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,5})?\z", RegexOptions.ExplicitCapture)] private static partial Regex LocalTimeRegex5(); - [GeneratedRegex(@"^[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,6})?\z", RegexOptions.ExplicitCapture)] + [GeneratedRegex(@"^(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,6})?\z", RegexOptions.ExplicitCapture)] private static partial Regex LocalTimeRegex6(); - [GeneratedRegex(@"^[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,7})?\z", RegexOptions.ExplicitCapture)] + [GeneratedRegex(@"^(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,7})?\z", RegexOptions.ExplicitCapture)] private static partial Regex LocalTimeRegex7(); - [GeneratedRegex(@"^[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,8})?\z", RegexOptions.ExplicitCapture)] + [GeneratedRegex(@"^(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,8})?\z", RegexOptions.ExplicitCapture)] private static partial Regex LocalTimeRegex8(); - [GeneratedRegex(@"^[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{1,9})?\z", RegexOptions.ExplicitCapture)] + [GeneratedRegex(@"^(?[0-9]{2}):[0-9]{2}:[0-9]{2}(\.[0-9]{1,9})?\z", RegexOptions.ExplicitCapture)] private static partial Regex LocalTimeRegex9(); } diff --git a/src/HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj b/src/HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj index 620acd1856e..30eec63dde9 100644 --- a/src/HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj +++ b/src/HotChocolate/Core/test/Types.Analyzers.Tests/HotChocolate.Types.Analyzers.Tests.csproj @@ -31,6 +31,7 @@ + diff --git a/src/HotChocolate/Core/test/Types.Analyzers.Tests/SourceGeneratorOffsetPagingReproTests.cs b/src/HotChocolate/Core/test/Types.Analyzers.Tests/SourceGeneratorOffsetPagingReproTests.cs index 5f7c31e09be..676d9838af5 100644 --- a/src/HotChocolate/Core/test/Types.Analyzers.Tests/SourceGeneratorOffsetPagingReproTests.cs +++ b/src/HotChocolate/Core/test/Types.Analyzers.Tests/SourceGeneratorOffsetPagingReproTests.cs @@ -521,6 +521,8 @@ private static Assembly CompileReproAssembly(string source, string assemblyName) .. Net90.References.All, #elif NET10_0 .. Net100.References.All, +#elif NET11_0 + .. Net110.References.All, #endif MetadataReference.CreateFromFile(typeof(ITypeSystemMember).Assembly.Location), MetadataReference.CreateFromFile(typeof(RequestDelegate).Assembly.Location), diff --git a/src/HotChocolate/Core/test/Types.Analyzers.Tests/TestHelper.cs b/src/HotChocolate/Core/test/Types.Analyzers.Tests/TestHelper.cs index a3654b3ff55..696610a57ad 100644 --- a/src/HotChocolate/Core/test/Types.Analyzers.Tests/TestHelper.cs +++ b/src/HotChocolate/Core/test/Types.Analyzers.Tests/TestHelper.cs @@ -26,7 +26,8 @@ namespace HotChocolate.Types; internal static partial class TestHelper { - private static readonly HashSet s_ignoreCodes = ["CS8652", "CS8632", "CS5001", "CS8019"]; + private static readonly HashSet s_ignoreCodes = + ["CS1701", "CS1702", "CS8652", "CS8632", "CS5001", "CS8019"]; public static Snapshot GetGeneratedSourceSnapshot([StringSyntax("csharp")] string sourceText) => GetGeneratedSourceSnapshot([sourceText]); @@ -45,6 +46,8 @@ public static Snapshot GetGeneratedSourceSnapshot( .. Net90.References.All, #elif NET10_0 .. Net100.References.All, +#elif NET11_0 + .. Net110.References.All, #endif // HotChocolate.Primitives MetadataReference.CreateFromFile(typeof(ITypeSystemMember).Assembly.Location), diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/DateTimeTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/DateTimeTypeTests.cs index 84e4003ae5a..0d16795593a 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/DateTimeTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/DateTimeTypeTests.cs @@ -461,8 +461,8 @@ public static TheoryData InvalidInput() { DateTimeOptions.DefaultInputPrecision, "2023-12-24T15:30:00" }, // Space instead of T or t separator. { DateTimeOptions.DefaultInputPrecision, "2023-12-24 15:30:00Z" }, - // Invalid hour (25). - { DateTimeOptions.DefaultInputPrecision, "2023-12-24T25:00:00Z" }, + // Invalid hour (24). + { DateTimeOptions.DefaultInputPrecision, "2023-12-24T24:00:00Z" }, // Invalid minute (60). { DateTimeOptions.DefaultInputPrecision, "2023-12-24T15:60:00Z" }, // ReSharper disable once GrammarMistakeInComment diff --git a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalDateTimeTypeTests.cs b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalDateTimeTypeTests.cs index 124f319f768..eb3d5e28430 100644 --- a/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalDateTimeTypeTests.cs +++ b/src/HotChocolate/Core/test/Types.Tests/Types/Scalars/LocalDateTimeTypeTests.cs @@ -419,8 +419,8 @@ public static TheoryData InvalidInput() { DateTimeOptions.DefaultInputPrecision, "2023-12-24T15:30:00+05:30" }, // Invalid separator (space instead of T or t). { DateTimeOptions.DefaultInputPrecision, "2023-12-24 15:30:00" }, - // Invalid hour (25). - { DateTimeOptions.DefaultInputPrecision, "2023-12-24T25:00:00" }, + // Invalid hour (24). + { DateTimeOptions.DefaultInputPrecision, "2023-12-24T24:00:00" }, // Invalid minute (60). { DateTimeOptions.DefaultInputPrecision, "2023-12-24T15:60:00" }, // ReSharper disable once GrammarMistakeInComment diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/IntegrationTests.cs b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/IntegrationTests.cs index 3ea9aaf3f15..713c62c9fc4 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/IntegrationTests.cs +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/IntegrationTests.cs @@ -11,6 +11,7 @@ using HotChocolate.Types.Pagination.Utilities; using Microsoft.Extensions.DependencyInjection; using Squadron; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data; @@ -50,10 +51,7 @@ public async Task Paging_With_Default_Sorting() """) .SetGlobalState("printSQL", true), Xunit.TestContext.Current.CancellationToken); - result.MatchMarkdownSnapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null); + result.MatchMarkdownSnapshot(Postfix([NET8_0, NET9_0], [NET10_0])); } [Fact] @@ -86,10 +84,7 @@ public async Task Paging_Next_2_With_Default_Sorting() """) .SetGlobalState("printSQL", true), Xunit.TestContext.Current.CancellationToken); - result.MatchMarkdownSnapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null); + result.MatchMarkdownSnapshot(Postfix([NET8_0, NET9_0], [NET10_0])); } [Fact] @@ -123,10 +118,7 @@ public async Task Paging_With_Default_Sorting_And_TotalCount() """) .SetGlobalState("printSQL", true), Xunit.TestContext.Current.CancellationToken); - result.MatchMarkdownSnapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null); + result.MatchMarkdownSnapshot(Postfix([NET8_0, NET9_0], [NET10_0])); } [Fact] @@ -183,10 +175,7 @@ public async Task Paging_With_PagingFlags_Override() """) .SetGlobalState("printSQL", true), Xunit.TestContext.Current.CancellationToken); - result.MatchMarkdownSnapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null); + result.MatchMarkdownSnapshot(Postfix([NET8_0, NET9_0], [NET10_0])); } [Fact] @@ -219,10 +208,7 @@ public async Task Paging_With_User_Sorting() """) .SetGlobalState("printSQL", true), Xunit.TestContext.Current.CancellationToken); - result.MatchMarkdownSnapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null); + result.MatchMarkdownSnapshot(Postfix([NET8_0, NET9_0], [NET10_0])); } [Fact] @@ -255,10 +241,7 @@ public async Task Paging_Next_2_With_User_Sorting() """) .SetGlobalState("printSQL", true), Xunit.TestContext.Current.CancellationToken); - result.MatchMarkdownSnapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null); + result.MatchMarkdownSnapshot(Postfix([NET8_0, NET9_0], [NET10_0])); } [Fact] @@ -293,10 +276,7 @@ public async Task Paging_First_10_With_Default_Sorting_HasNextPage() """) .SetGlobalState("printSQL", true), Xunit.TestContext.Current.CancellationToken); - result.MatchMarkdownSnapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null); + result.MatchMarkdownSnapshot(Postfix([NET8_0, NET9_0], [NET10_0])); } [Fact] @@ -331,10 +311,7 @@ public async Task Paging_Last_10_With_Default_Sorting_HasPreviousPage() """) .SetGlobalState("printSQL", true), Xunit.TestContext.Current.CancellationToken); - result.MatchMarkdownSnapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null); + result.MatchMarkdownSnapshot(Postfix([NET8_0, NET9_0], [NET10_0])); } [Fact] @@ -370,10 +347,7 @@ public async Task Paging_Fetch_First_2_Items_Between() """) .SetGlobalState("printSQL", true), Xunit.TestContext.Current.CancellationToken); - result.MatchMarkdownSnapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null); + result.MatchMarkdownSnapshot(Postfix([NET8_0, NET9_0], [NET10_0])); } [Fact] @@ -409,10 +383,7 @@ public async Task Paging_Fetch_Last_2_Items_Between() """) .SetGlobalState("printSQL", true), Xunit.TestContext.Current.CancellationToken); - result.MatchMarkdownSnapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null); + result.MatchMarkdownSnapshot(Postfix([NET8_0, NET9_0], [NET10_0])); } [Fact] diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_First_2_Items_Between.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_First_2_Items_Between.md index 159107a9c58..d6a766ec306 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_First_2_Items_Between.md +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_First_2_Items_Between.md @@ -21,7 +21,7 @@ } }, "extensions": { - "sql": "-- @__value_0='1'\n-- @__value_1='4'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @__value_0 AND b.\"Id\" < @__value_1\nORDER BY b.\"Id\"\nLIMIT @__p_2" + "sql": "-- @value='1'\n-- @value1='4'\n-- @p='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @value AND b.\"Id\" < @value1\nORDER BY b.\"Id\"\nLIMIT @p" } } ``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_First_2_Items_Between_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_First_2_Items_Between_NET8_0_NET9_0.md new file mode 100644 index 00000000000..159107a9c58 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_First_2_Items_Between_NET8_0_NET9_0.md @@ -0,0 +1,27 @@ +# Paging_Fetch_First_2_Items_Between + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand1" + }, + { + "name": "Brand2" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": true, + "endCursor": "e30z", + "startCursor": "e30y" + } + } + }, + "extensions": { + "sql": "-- @__value_0='1'\n-- @__value_1='4'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @__value_0 AND b.\"Id\" < @__value_1\nORDER BY b.\"Id\"\nLIMIT @__p_2" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_Last_2_Items_Between.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_Last_2_Items_Between.md index 0067bcc6e2c..4c21904a4d8 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_Last_2_Items_Between.md +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_Last_2_Items_Between.md @@ -21,7 +21,7 @@ } }, "extensions": { - "sql": "-- @__value_0='97'\n-- @__value_1='100'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @__value_0 AND b.\"Id\" < @__value_1\nORDER BY b.\"Id\" DESC\nLIMIT @__p_2" + "sql": "-- @value='97'\n-- @value1='100'\n-- @p='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @value AND b.\"Id\" < @value1\nORDER BY b.\"Id\" DESC\nLIMIT @p" } } ``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_Last_2_Items_Between_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_Last_2_Items_Between_NET8_0_NET9_0.md new file mode 100644 index 00000000000..0067bcc6e2c --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Fetch_Last_2_Items_Between_NET8_0_NET9_0.md @@ -0,0 +1,27 @@ +# Paging_Fetch_Last_2_Items_Between + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand97" + }, + { + "name": "Brand98" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": true, + "endCursor": "e305OQ==", + "startCursor": "e305OA==" + } + } + }, + "extensions": { + "sql": "-- @__value_0='97'\n-- @__value_1='100'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @__value_0 AND b.\"Id\" < @__value_1\nORDER BY b.\"Id\" DESC\nLIMIT @__p_2" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_First_10_With_Default_Sorting_HasNextPage.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_First_10_With_Default_Sorting_HasNextPage.md index 3c5927cd5bc..af8dd68846d 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_First_10_With_Default_Sorting_HasNextPage.md +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_First_10_With_Default_Sorting_HasNextPage.md @@ -44,7 +44,7 @@ } }, "extensions": { - "sql": "-- @__p_0='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Id\"\nLIMIT @__p_0" + "sql": "-- @p='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Id\"\nLIMIT @p" } } ``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_First_10_With_Default_Sorting_HasNextPage_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_First_10_With_Default_Sorting_HasNextPage_NET8_0_NET9_0.md new file mode 100644 index 00000000000..3c5927cd5bc --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_First_10_With_Default_Sorting_HasNextPage_NET8_0_NET9_0.md @@ -0,0 +1,50 @@ +# Paging_First_10_With_Default_Sorting_HasNextPage + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand0" + }, + { + "name": "Brand1" + }, + { + "name": "Brand2" + }, + { + "name": "Brand3" + }, + { + "name": "Brand4" + }, + { + "name": "Brand5" + }, + { + "name": "Brand6" + }, + { + "name": "Brand7" + }, + { + "name": "Brand8" + }, + { + "name": "Brand9" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": false, + "endCursor": "e30xMA==" + } + } + }, + "extensions": { + "sql": "-- @__p_0='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Id\"\nLIMIT @__p_0" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Last_10_With_Default_Sorting_HasPreviousPage.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Last_10_With_Default_Sorting_HasPreviousPage.md index c2e32d28cbe..15f74feade0 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Last_10_With_Default_Sorting_HasPreviousPage.md +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Last_10_With_Default_Sorting_HasPreviousPage.md @@ -44,7 +44,7 @@ } }, "extensions": { - "sql": "-- @__p_0='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Id\" DESC\nLIMIT @__p_0" + "sql": "-- @p='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Id\" DESC\nLIMIT @p" } } ``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Last_10_With_Default_Sorting_HasPreviousPage_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Last_10_With_Default_Sorting_HasPreviousPage_NET8_0_NET9_0.md new file mode 100644 index 00000000000..c2e32d28cbe --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Last_10_With_Default_Sorting_HasPreviousPage_NET8_0_NET9_0.md @@ -0,0 +1,50 @@ +# Paging_Last_10_With_Default_Sorting_HasPreviousPage + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand90" + }, + { + "name": "Brand91" + }, + { + "name": "Brand92" + }, + { + "name": "Brand93" + }, + { + "name": "Brand94" + }, + { + "name": "Brand95" + }, + { + "name": "Brand96" + }, + { + "name": "Brand97" + }, + { + "name": "Brand98" + }, + { + "name": "Brand99" + } + ], + "pageInfo": { + "hasNextPage": false, + "hasPreviousPage": true, + "endCursor": "e30xMDA=" + } + } + }, + "extensions": { + "sql": "-- @__p_0='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Id\" DESC\nLIMIT @__p_0" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_Default_Sorting.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_Default_Sorting.md index b9e674d8359..ea8f74a303d 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_Default_Sorting.md +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_Default_Sorting.md @@ -18,7 +18,7 @@ } }, "extensions": { - "sql": "-- @__value_0='10'\n-- @__p_1='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @__value_0\nORDER BY b.\"Id\"\nLIMIT @__p_1" + "sql": "-- @value='10'\n-- @p='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @value\nORDER BY b.\"Id\"\nLIMIT @p" } } ``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_Default_Sorting_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_Default_Sorting_NET8_0_NET9_0.md new file mode 100644 index 00000000000..b9e674d8359 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_Default_Sorting_NET8_0_NET9_0.md @@ -0,0 +1,24 @@ +# Paging_Next_2_With_Default_Sorting + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand10" + }, + { + "name": "Brand11" + } + ], + "pageInfo": { + "endCursor": "e30xMg==" + } + } + }, + "extensions": { + "sql": "-- @__value_0='10'\n-- @__p_1='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Id\" > @__value_0\nORDER BY b.\"Id\"\nLIMIT @__p_1" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting.md index 6f66e23f6c1..f9f13a16aa9 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting.md +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting.md @@ -18,7 +18,7 @@ } }, "extensions": { - "sql": "-- @__value_0='Brand17'\n-- @__value_1='18'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Name\" > @__value_0 OR (b.\"Name\" = @__value_0 AND b.\"Id\" > @__value_1)\nORDER BY b.\"Name\", b.\"Id\"\nLIMIT @__p_2" + "sql": "-- @value='Brand17'\n-- @value2='18'\n-- @p='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Name\" > @value OR (b.\"Name\" = @value AND b.\"Id\" > @value2)\nORDER BY b.\"Name\", b.\"Id\"\nLIMIT @p" } } ``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting_NET8_0_NET9_0.md new file mode 100644 index 00000000000..6f66e23f6c1 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_Next_2_With_User_Sorting_NET8_0_NET9_0.md @@ -0,0 +1,24 @@ +# Paging_Next_2_With_User_Sorting + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand18" + }, + { + "name": "Brand19" + } + ], + "pageInfo": { + "endCursor": "e31CcmFuZDE5OjIw" + } + } + }, + "extensions": { + "sql": "-- @__value_0='Brand17'\n-- @__value_1='18'\n-- @__p_2='3'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nWHERE b.\"Name\" > @__value_0 OR (b.\"Name\" = @__value_0 AND b.\"Id\" > @__value_1)\nORDER BY b.\"Name\", b.\"Id\"\nLIMIT @__p_2" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting.md index d3b5d6aef0f..fa053263b73 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting.md +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting.md @@ -42,7 +42,7 @@ } }, "extensions": { - "sql": "-- @__p_0='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Id\"\nLIMIT @__p_0" + "sql": "-- @p='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Id\"\nLIMIT @p" } } ``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_And_TotalCount.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_And_TotalCount.md index e20684c56e4..e140bd8f6fa 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_And_TotalCount.md +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_And_TotalCount.md @@ -43,7 +43,7 @@ } }, "extensions": { - "sql": "-- @__p_0='11'\nSELECT p.\"Id\", p.\"AvailableStock\", p.\"BrandId\", p.\"Description\", p.\"ImageFileName\", p.\"MaxStockThreshold\", p.\"Name\", p.\"OnReorder\", p.\"Price\", p.\"RestockThreshold\", p.\"TypeId\"\nFROM \"Products\" AS p\nORDER BY p.\"Id\"\nLIMIT @__p_0" + "sql": "-- @p='11'\nSELECT p.\"Id\", p.\"AvailableStock\", p.\"BrandId\", p.\"Description\", p.\"ImageFileName\", p.\"MaxStockThreshold\", p.\"Name\", p.\"OnReorder\", p.\"Price\", p.\"RestockThreshold\", p.\"TypeId\"\nFROM \"Products\" AS p\nORDER BY p.\"Id\"\nLIMIT @p" } } ``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_And_TotalCount_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_And_TotalCount_NET8_0_NET9_0.md new file mode 100644 index 00000000000..e20684c56e4 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_And_TotalCount_NET8_0_NET9_0.md @@ -0,0 +1,49 @@ +# Paging_With_Default_Sorting_And_TotalCount + +```json +{ + "data": { + "products": { + "nodes": [ + { + "name": "Product 0-0" + }, + { + "name": "Product 0-1" + }, + { + "name": "Product 0-2" + }, + { + "name": "Product 0-3" + }, + { + "name": "Product 0-4" + }, + { + "name": "Product 0-5" + }, + { + "name": "Product 0-6" + }, + { + "name": "Product 0-7" + }, + { + "name": "Product 0-8" + }, + { + "name": "Product 0-9" + } + ], + "pageInfo": { + "endCursor": "e30xMA==" + }, + "totalCount": 10000 + } + }, + "extensions": { + "sql": "-- @__p_0='11'\nSELECT p.\"Id\", p.\"AvailableStock\", p.\"BrandId\", p.\"Description\", p.\"ImageFileName\", p.\"MaxStockThreshold\", p.\"Name\", p.\"OnReorder\", p.\"Price\", p.\"RestockThreshold\", p.\"TypeId\"\nFROM \"Products\" AS p\nORDER BY p.\"Id\"\nLIMIT @__p_0" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_NET8_0_NET9_0.md new file mode 100644 index 00000000000..d3b5d6aef0f --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_Default_Sorting_NET8_0_NET9_0.md @@ -0,0 +1,48 @@ +# Paging_With_Default_Sorting + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand0" + }, + { + "name": "Brand1" + }, + { + "name": "Brand2" + }, + { + "name": "Brand3" + }, + { + "name": "Brand4" + }, + { + "name": "Brand5" + }, + { + "name": "Brand6" + }, + { + "name": "Brand7" + }, + { + "name": "Brand8" + }, + { + "name": "Brand9" + } + ], + "pageInfo": { + "endCursor": "e30xMA==" + } + } + }, + "extensions": { + "sql": "-- @__p_0='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Id\"\nLIMIT @__p_0" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_PagingFlags_Override.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_PagingFlags_Override.md index 7b8f3fa5e9f..088e49b2ede 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_PagingFlags_Override.md +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_PagingFlags_Override.md @@ -8,7 +8,7 @@ } }, "extensions": { - "sql": "-- @__p_0='11'\nSELECT p.\"Id\", p.\"AvailableStock\", p.\"BrandId\", p.\"Description\", p.\"ImageFileName\", p.\"MaxStockThreshold\", p.\"Name\", p.\"OnReorder\", p.\"Price\", p.\"RestockThreshold\", p.\"TypeId\"\nFROM \"Products\" AS p\nORDER BY p.\"Id\"\nLIMIT @__p_0" + "sql": "-- @p='11'\nSELECT p.\"Id\", p.\"AvailableStock\", p.\"BrandId\", p.\"Description\", p.\"ImageFileName\", p.\"MaxStockThreshold\", p.\"Name\", p.\"OnReorder\", p.\"Price\", p.\"RestockThreshold\", p.\"TypeId\"\nFROM \"Products\" AS p\nORDER BY p.\"Id\"\nLIMIT @p" } } ``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_PagingFlags_Override_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_PagingFlags_Override_NET8_0_NET9_0.md new file mode 100644 index 00000000000..7b8f3fa5e9f --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_PagingFlags_Override_NET8_0_NET9_0.md @@ -0,0 +1,14 @@ +# Paging_With_PagingFlags_Override + +```json +{ + "data": { + "products": { + "pageCount": 10 + } + }, + "extensions": { + "sql": "-- @__p_0='11'\nSELECT p.\"Id\", p.\"AvailableStock\", p.\"BrandId\", p.\"Description\", p.\"ImageFileName\", p.\"MaxStockThreshold\", p.\"Name\", p.\"OnReorder\", p.\"Price\", p.\"RestockThreshold\", p.\"TypeId\"\nFROM \"Products\" AS p\nORDER BY p.\"Id\"\nLIMIT @__p_0" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_User_Sorting.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_User_Sorting.md index 028591a273a..8c6bdd75620 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_User_Sorting.md +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_User_Sorting.md @@ -42,7 +42,7 @@ } }, "extensions": { - "sql": "-- @__p_0='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Name\", b.\"Id\"\nLIMIT @__p_0" + "sql": "-- @p='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Name\", b.\"Id\"\nLIMIT @p" } } ``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_User_Sorting_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_User_Sorting_NET8_0_NET9_0.md new file mode 100644 index 00000000000..028591a273a --- /dev/null +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/__snapshots__/IntegrationTests.Paging_With_User_Sorting_NET8_0_NET9_0.md @@ -0,0 +1,48 @@ +# Paging_With_User_Sorting + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "name": "Brand0" + }, + { + "name": "Brand1" + }, + { + "name": "Brand10" + }, + { + "name": "Brand11" + }, + { + "name": "Brand12" + }, + { + "name": "Brand13" + }, + { + "name": "Brand14" + }, + { + "name": "Brand15" + }, + { + "name": "Brand16" + }, + { + "name": "Brand17" + } + ], + "pageInfo": { + "endCursor": "e31CcmFuZDE3OjE4" + } + } + }, + "extensions": { + "sql": "-- @__p_0='11'\nSELECT b.\"Id\", b.\"AlwaysNull\", b.\"DisplayName\", b.\"Name\", b.\"BrandDetails_Country_Name\"\nFROM \"Brands\" AS b\nORDER BY b.\"Name\", b.\"Id\"\nLIMIT @__p_0" + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/EntityFrameworkExecutableTests.cs b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/EntityFrameworkExecutableTests.cs index 01760993445..004745404b5 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/EntityFrameworkExecutableTests.cs +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/EntityFrameworkExecutableTests.cs @@ -1,3 +1,5 @@ +using static CookieCrumble.TestEnvironment; + namespace HotChocolate.Data; public class EntityFrameworkExecutableTests(AuthorFixture authorFixture) @@ -57,10 +59,7 @@ public async Task ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault() var result = await executable.SingleOrDefaultAsync(CancellationToken.None); // assert - new { result, executable = executable.Print() }.MatchSnapshot( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null); + new { result, executable = executable.Print() }.MatchSnapshot(Postfix([NET8_0, NET9_0])); } [Fact] diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault.snap b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault.snap index d56dccd2827..94b00172d25 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault.snap +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault.snap @@ -10,5 +10,5 @@ } ] }, - "executable": ".param set @__p_0 1\n\nSELECT \"a\".\"Id\", \"a\".\"Name\"\nFROM \"Authors\" AS \"a\"\nLIMIT @__p_0" + "executable": ".param set @p 1\n\nSELECT \"a\".\"Id\", \"a\".\"Name\"\nFROM \"Authors\" AS \"a\"\nLIMIT @p" } diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET10_0.snap b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET8_0_NET9_0.snap similarity index 56% rename from src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET10_0.snap rename to src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET8_0_NET9_0.snap index 94b00172d25..d56dccd2827 100644 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/__snapshots__/EntityFrameworkExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET8_0_NET9_0.snap @@ -10,5 +10,5 @@ } ] }, - "executable": ".param set @p 1\n\nSELECT \"a\".\"Id\", \"a\".\"Name\"\nFROM \"Authors\" AS \"a\"\nLIMIT @p" + "executable": ".param set @__p_0 1\n\nSELECT \"a\".\"Id\", \"a\".\"Name\"\nFROM \"Authors\" AS \"a\"\nLIMIT @__p_0" } diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/DataLoaderTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/DataLoaderTests.cs index 723f02ebdde..2d7bd95496e 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/DataLoaderTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/DataLoaderTests.cs @@ -6,6 +6,7 @@ using HotChocolate.Data.TestContext; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data.Predicates; @@ -39,10 +40,7 @@ public async Task Filter_With_Expression() cancellationToken: Xunit.TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -76,10 +74,7 @@ public async Task Filter_With_Multi_Expression() cancellationToken: Xunit.TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0], [NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -113,10 +108,7 @@ public async Task Filter_With_Filtering() cancellationToken: Xunit.TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -153,10 +145,7 @@ public async Task Filter_With_Aliased_Filtering() cancellationToken: Xunit.TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -190,10 +179,7 @@ public async Task Filter_With_Expression_Null() cancellationToken: Xunit.TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorBooleanTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorBooleanTests.cs index 5992a166202..c6c85713827 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorBooleanTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorBooleanTests.cs @@ -1,4 +1,5 @@ using HotChocolate.Execution; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data.Filters; @@ -41,8 +42,8 @@ public async Task Create_BooleanEqual_Expression() // assert await Snapshot .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework + postFix: TargetFramework == "NET10_0" + ? TargetFramework : null) .AddResult(res1, "true") .AddResult(res2, "false") @@ -71,8 +72,8 @@ public async Task Create_BooleanNotEqual_Expression() // assert await Snapshot .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework + postFix: TargetFramework == "NET10_0" + ? TargetFramework : null) .AddResult(res1, "true") .AddResult(res2, "false") @@ -106,10 +107,7 @@ public async Task Create_NullableBooleanEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "true") .AddResult(res2, "false") .AddResult(res3, "null") @@ -144,10 +142,7 @@ public async Task Create_NullableBooleanNotEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "true") .AddResult(res2, "false") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorComparableTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorComparableTests.cs index 86f943286ea..18050e63093 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorComparableTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorComparableTests.cs @@ -1,4 +1,5 @@ using HotChocolate.Execution; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data.Filters; @@ -48,10 +49,7 @@ public async Task Create_ShortEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -85,10 +83,7 @@ public async Task Create_ShortNotEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -128,10 +123,7 @@ public async Task Create_ShortGreaterThan_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -172,10 +164,7 @@ public async Task Create_ShortNotGreaterThan_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -216,10 +205,7 @@ public async Task Create_ShortGreaterThanOrEquals_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -260,10 +246,7 @@ public async Task Create_ShortNotGreaterThanOrEquals_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -304,10 +287,7 @@ public async Task Create_ShortLowerThan_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -348,10 +328,7 @@ public async Task Create_ShortNotLowerThan_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -392,10 +369,7 @@ public async Task Create_ShortLowerThanOrEquals_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -436,10 +410,7 @@ public async Task Create_ShortNotLowerThanOrEquals_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -474,10 +445,7 @@ public async Task Create_ShortIn_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12and13") .AddResult(res2, "13and14") .AddResult(res3, "nullAnd14") @@ -511,10 +479,7 @@ public async Task Create_ShortNotIn_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12and13") .AddResult(res2, "13and14") .AddResult(res3, "nullAnd14") @@ -548,10 +513,7 @@ public async Task Create_ShortNullableEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -585,10 +547,7 @@ public async Task Create_ShortNullableNotEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -628,10 +587,7 @@ public async Task Create_ShortNullableGreaterThan_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -672,7 +628,7 @@ public async Task Create_ShortNullableNotGreaterThan_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -713,10 +669,7 @@ public async Task Create_ShortNullableGreaterThanOrEquals_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -757,7 +710,7 @@ public async Task Create_ShortNullableNotGreaterThanOrEquals_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -798,10 +751,7 @@ public async Task Create_ShortNullableLowerThan_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -842,7 +792,7 @@ public async Task Create_ShortNullableNotLowerThan_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -883,10 +833,7 @@ public async Task Create_ShortNullableLowerThanOrEquals_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -927,7 +874,7 @@ public async Task Create_ShortNullableNotLowerThanOrEquals_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "14") @@ -962,7 +909,7 @@ public async Task Create_ShortNullableIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12and13") .AddResult(res2, "13and14") .AddResult(res3, "13andNull") @@ -996,7 +943,7 @@ public async Task Create_ShortNullableNotIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12and13") .AddResult(res2, "13and14") .AddResult(res3, "13andNull") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorEnumTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorEnumTests.cs index f4d5ee56473..6aa0133b358 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorEnumTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorEnumTests.cs @@ -1,4 +1,5 @@ using HotChocolate.Execution; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data.Filters; @@ -50,10 +51,7 @@ public async Task Create_EnumEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") @@ -87,10 +85,7 @@ public async Task Create_EnumNotEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") @@ -124,10 +119,7 @@ public async Task Create_EnumIn_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "BarAndFoo") .AddResult(res2, "FOO") .AddResult(res3, "nullAndFoo") @@ -161,10 +153,7 @@ public async Task Create_EnumNotIn_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "BarAndFoo") .AddResult(res2, "FOO") .AddResult(res3, "nullAndFoo") @@ -199,10 +188,7 @@ public async Task Create_NullableEnumEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") @@ -236,10 +222,7 @@ public async Task Create_NullableEnumNotEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") @@ -273,7 +256,7 @@ public async Task Create_NullableEnumIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "BarAndFoo") .AddResult(res2, "FOO") .AddResult(res3, "nullAndFoo") @@ -307,7 +290,7 @@ public async Task Create_NullableEnumNotIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "BarAndFoo") .AddResult(res2, "FOO") .AddResult(res3, "nullAndFoo") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorExpressionTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorExpressionTests.cs index 781692f2afb..214e4b669f1 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorExpressionTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorExpressionTests.cs @@ -1,4 +1,5 @@ using HotChocolate.Execution; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data.Filters; @@ -57,10 +58,7 @@ public async Task Create_StringConcatExpression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "Sam_Sampleman") .AddResult(res2, "NoMatch") .AddResult(res3, "null") @@ -94,10 +92,7 @@ public async Task Create_CollectionLengthExpression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "1") .AddResult(res2, "0") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorInterfacesTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorInterfacesTests.cs index eec006ca964..5bfcd3f8a0c 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorInterfacesTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorInterfacesTests.cs @@ -2,6 +2,7 @@ using HotChocolate.Execution; using HotChocolate.Types; using Microsoft.EntityFrameworkCore; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data.Filters; @@ -57,10 +58,7 @@ public async Task Create_InterfaceStringEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "a") .AddResult(res2, "ba") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorListTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorListTests.cs index c9a71c39659..0f0604c22c7 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorListTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorListTests.cs @@ -1,4 +1,5 @@ using HotChocolate.Execution; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data.Filters; @@ -93,10 +94,7 @@ public async Task Create_ArraySomeObjectStringEqualWithNull_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "a") .AddResult(res2, "d") .AddResult(res3, "null") @@ -133,10 +131,7 @@ public async Task Create_ArrayNoneObjectStringEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "a") .AddResult(res2, "d") .AddResult(res3, "null") @@ -173,10 +168,7 @@ public async Task Create_ArrayAllObjectStringEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "a") .AddResult(res2, "d") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorObjectTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorObjectTests.cs index 8c400720592..fdf14ec721b 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorObjectTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorObjectTests.cs @@ -1,4 +1,5 @@ using HotChocolate.Execution; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data.Filters; @@ -127,10 +128,7 @@ public async Task Create_ObjectShortEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -170,10 +168,7 @@ public async Task Create_ObjectShortIn_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12and13") .AddResult(res2, "13and14") .AddResult(res3, "nullAnd14") @@ -213,10 +208,7 @@ public async Task Create_ObjectNullableShortEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "12") .AddResult(res2, "13") .AddResult(res3, "null") @@ -256,7 +248,7 @@ public async Task Create_ObjectNullableShortIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(postFix: TargetFramework) .AddResult(res1, "12and13") .AddResult(res2, "13and14") .AddResult(res3, "13andNull") @@ -289,8 +281,8 @@ public async Task Create_ObjectBooleanEqual_Expression() // assert await Snapshot .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework + postFix: TargetFramework == "NET10_0" + ? TargetFramework : null) .AddResult(res1, "true") .AddResult(res2, "false") @@ -330,10 +322,7 @@ public async Task Create_ObjectNullableBooleanEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "true") .AddResult(res2, "false") .AddResult(res3, "null") @@ -373,10 +362,7 @@ public async Task Create_ObjectEnumEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") @@ -416,10 +402,7 @@ public async Task Create_ObjectEnumIn_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "BarAndFoo") .AddResult(res2, "FOO") .AddResult(res3, "nullAndFoo") @@ -460,10 +443,7 @@ public async Task Create_ObjectNullableEnumEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "BAR") .AddResult(res2, "FOO") .AddResult(res3, "null") @@ -503,7 +483,7 @@ public async Task Create_ObjectNullableEnumIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(postFix: TargetFramework) .AddResult(res1, "BarAndFoo") .AddResult(res2, "FOO") .AddResult(res3, "nullAndFoo") @@ -542,10 +522,7 @@ public async Task Create_ObjectStringEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -586,10 +563,7 @@ public async Task Create_ObjectStringIn_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testatestAndtestb") .AddResult(res2, "testbtestAndNull") .AddResult(res3, "testatest") @@ -632,10 +606,7 @@ public async Task Create_ArrayObjectNestedArraySomeStringEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "a") .AddResult(res2, "b") .AddResult(res3, "null") @@ -717,10 +688,7 @@ public async Task Create_ObjectStringEqual_Flattened() Assert.Empty(Assert.IsType(res2).Errors); Assert.Empty(Assert.IsType(res3).Errors); await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -763,10 +731,7 @@ public async Task Create_ObjectStringEquals_Related_Flattened() Assert.Empty(Assert.IsType(res2).Errors); Assert.Empty(Assert.IsType(res3).Errors); await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorStringTests.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorStringTests.cs index a0ed8ea61f0..018604a15a1 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorStringTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorStringTests.cs @@ -1,4 +1,5 @@ using HotChocolate.Execution; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data.Filters; @@ -46,10 +47,7 @@ public async Task Create_StringEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -83,10 +81,7 @@ public async Task Create_StringNotEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -121,10 +116,7 @@ public async Task Create_StringIn_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testatestAndtestb") .AddResult(res2, "testbtestAndNull") .AddResult(res3, "testatest") @@ -159,7 +151,7 @@ public async Task Create_StringNotIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testatestAndtestb") .AddResult(res2, "testbtestAndNull") .AddResult(res3, "testatest") @@ -193,10 +185,7 @@ public async Task Create_StringContains_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "a") .AddResult(res2, "b") .AddResult(res3, "null") @@ -230,7 +219,7 @@ public async Task Create_StringNoContains_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddResult(res1, "a") .AddResult(res2, "b") .AddResult(res3, "null") @@ -265,7 +254,7 @@ public async Task Create_StringStartsWith_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testa") .AddResult(res2, "testb") .AddResult(res3, "null") @@ -299,7 +288,7 @@ public async Task Create_StringNotStartsWith_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testa") .AddResult(res2, "testb") .AddResult(res3, "null") @@ -333,7 +322,7 @@ public async Task Create_StringEndsWith_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "atest") .AddResult(res2, "btest") .AddResult(res3, "null") @@ -367,7 +356,7 @@ public async Task Create_StringNotEndsWith_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "atest") .AddResult(res2, "btest") .AddResult(res3, "null") @@ -401,10 +390,7 @@ public async Task Create_NullableStringEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -439,10 +425,7 @@ public async Task Create_NullableStringNotEqual_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testatest") .AddResult(res2, "testbtest") .AddResult(res3, "null") @@ -477,7 +460,7 @@ public async Task Create_NullableStringIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testatestAndtestb") .AddResult(res2, "testbtestAndNull") .AddResult(res3, "testatest") @@ -513,7 +496,7 @@ public async Task Create_NullableStringNotIn_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testatestAndtestb") .AddResult(res2, "testbtestAndNull") .AddResult(res3, "testatest") @@ -548,10 +531,7 @@ public async Task Create_NullableStringContains_Expression() // assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "a") .AddResult(res2, "b") .AddResult(res3, "null") @@ -585,7 +565,7 @@ public async Task Create_NullableStringNoContains_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddResult(res1, "a") .AddResult(res2, "b") .AddResult(res3, "null") @@ -620,7 +600,7 @@ public async Task Create_NullableStringStartsWith_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testa") .AddResult(res2, "testb") .AddResult(res3, "null") @@ -655,7 +635,7 @@ public async Task Create_NullableStringNotStartsWith_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "testa") .AddResult(res2, "testb") .AddResult(res3, "null") @@ -690,7 +670,7 @@ public async Task Create_NullableStringEndsWith_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "atest") .AddResult(res2, "btest") .AddResult(res3, "null") @@ -726,7 +706,7 @@ public async Task Create_NullableStringNotEndsWith_Expression() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0, NET9_0])) .AddResult(res1, "atest") .AddResult(res2, "btest") .AddResult(res3, "null") diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Aliased_Filtering.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Aliased_Filtering.md index 9fbcd8f3d21..ac5f75f4fc1 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Aliased_Filtering.md +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Aliased_Filtering.md @@ -3,24 +3,18 @@ ## SQL ```text -.param set @__keys_0 '[1]' -.param set @__p_1_rewritten 'Product%' +.param set @keys1 1 +.param set @p_startswith 'Product%' SELECT "p"."Id", "p"."AvailableStock", "p"."BrandId", "p"."Description", "p"."ImageFileName", "p"."MaxStockThreshold", "p"."Name", "p"."OnReorder", "p"."Price", "p"."RestockThreshold", "p"."TypeId" FROM "Products" AS "p" -WHERE "p"."BrandId" IN ( - SELECT "k"."value" - FROM json_each(@__keys_0) AS "k" -) AND "p"."Name" LIKE @__p_1_rewritten ESCAPE '\' -.param set @__keys_0 '[1]' -.param set @__p_1 'Product 0-0' +WHERE "p"."BrandId" = @keys1 AND "p"."Name" LIKE @p_startswith ESCAPE '\' +.param set @keys1 1 +.param set @p 'Product 0-0' SELECT "p"."Id", "p"."AvailableStock", "p"."BrandId", "p"."Description", "p"."ImageFileName", "p"."MaxStockThreshold", "p"."Name", "p"."OnReorder", "p"."Price", "p"."RestockThreshold", "p"."TypeId" FROM "Products" AS "p" -WHERE "p"."BrandId" IN ( - SELECT "k"."value" - FROM json_each(@__keys_0) AS "k" -) AND "p"."Name" = @__p_1 +WHERE "p"."BrandId" = @keys1 AND "p"."Name" = @p ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Aliased_Filtering_NET10_0.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Aliased_Filtering_NET8_0_NET9_0.md similarity index 64% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Aliased_Filtering_NET10_0.md rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Aliased_Filtering_NET8_0_NET9_0.md index ac5f75f4fc1..9fbcd8f3d21 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Aliased_Filtering_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Aliased_Filtering_NET8_0_NET9_0.md @@ -3,18 +3,24 @@ ## SQL ```text -.param set @keys1 1 -.param set @p_startswith 'Product%' +.param set @__keys_0 '[1]' +.param set @__p_1_rewritten 'Product%' SELECT "p"."Id", "p"."AvailableStock", "p"."BrandId", "p"."Description", "p"."ImageFileName", "p"."MaxStockThreshold", "p"."Name", "p"."OnReorder", "p"."Price", "p"."RestockThreshold", "p"."TypeId" FROM "Products" AS "p" -WHERE "p"."BrandId" = @keys1 AND "p"."Name" LIKE @p_startswith ESCAPE '\' -.param set @keys1 1 -.param set @p 'Product 0-0' +WHERE "p"."BrandId" IN ( + SELECT "k"."value" + FROM json_each(@__keys_0) AS "k" +) AND "p"."Name" LIKE @__p_1_rewritten ESCAPE '\' +.param set @__keys_0 '[1]' +.param set @__p_1 'Product 0-0' SELECT "p"."Id", "p"."AvailableStock", "p"."BrandId", "p"."Description", "p"."ImageFileName", "p"."MaxStockThreshold", "p"."Name", "p"."OnReorder", "p"."Price", "p"."RestockThreshold", "p"."TypeId" FROM "Products" AS "p" -WHERE "p"."BrandId" = @keys1 AND "p"."Name" = @p +WHERE "p"."BrandId" IN ( + SELECT "k"."value" + FROM json_each(@__keys_0) AS "k" +) AND "p"."Name" = @__p_1 ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression.md index 65c4769d8ba..c13fb29208c 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression.md +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression.md @@ -3,14 +3,11 @@ ## SQL ```text -.param set @__keys_0 '[1]' +.param set @keys1 1 SELECT "b"."Id", "b"."DisplayName", "b"."Name", "b"."Details_Country_Name" FROM "Brands" AS "b" -WHERE "b"."Id" IN ( - SELECT "k"."value" - FROM json_each(@__keys_0) AS "k" -) AND "b"."Name" LIKE 'Brand%' +WHERE "b"."Id" = @keys1 AND "b"."Name" LIKE 'Brand%' ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_NET10_0.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_NET8_0_NET9_0.md similarity index 63% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_NET10_0.md rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_NET8_0_NET9_0.md index c13fb29208c..65c4769d8ba 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_NET8_0_NET9_0.md @@ -3,11 +3,14 @@ ## SQL ```text -.param set @keys1 1 +.param set @__keys_0 '[1]' SELECT "b"."Id", "b"."DisplayName", "b"."Name", "b"."Details_Country_Name" FROM "Brands" AS "b" -WHERE "b"."Id" = @keys1 AND "b"."Name" LIKE 'Brand%' +WHERE "b"."Id" IN ( + SELECT "k"."value" + FROM json_each(@__keys_0) AS "k" +) AND "b"."Name" LIKE 'Brand%' ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null.md index 1abde9f88ba..e755e0ad0c9 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null.md +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null.md @@ -3,14 +3,11 @@ ## SQL ```text -.param set @__keys_0 '[1]' +.param set @keys1 1 SELECT "b"."Id", "b"."DisplayName", "b"."Name", "b"."Details_Country_Name" FROM "Brands" AS "b" -WHERE "b"."Id" IN ( - SELECT "k"."value" - FROM json_each(@__keys_0) AS "k" -) +WHERE "b"."Id" = @keys1 ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null_NET10_0.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null_NET8_0_NET9_0.md similarity index 69% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null_NET10_0.md rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null_NET8_0_NET9_0.md index e755e0ad0c9..1abde9f88ba 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Expression_Null_NET8_0_NET9_0.md @@ -3,11 +3,14 @@ ## SQL ```text -.param set @keys1 1 +.param set @__keys_0 '[1]' SELECT "b"."Id", "b"."DisplayName", "b"."Name", "b"."Details_Country_Name" FROM "Brands" AS "b" -WHERE "b"."Id" = @keys1 +WHERE "b"."Id" IN ( + SELECT "k"."value" + FROM json_each(@__keys_0) AS "k" +) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering.md index ca3fde604fb..c12cd0441b4 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering.md +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering.md @@ -3,15 +3,12 @@ ## SQL ```text -.param set @__keys_0 '[1]' -.param set @__p_1_rewritten 'Product%' +.param set @keys1 1 +.param set @p_startswith 'Product%' SELECT "p"."Id", "p"."AvailableStock", "p"."BrandId", "p"."Description", "p"."ImageFileName", "p"."MaxStockThreshold", "p"."Name", "p"."OnReorder", "p"."Price", "p"."RestockThreshold", "p"."TypeId" FROM "Products" AS "p" -WHERE "p"."BrandId" IN ( - SELECT "k"."value" - FROM json_each(@__keys_0) AS "k" -) AND "p"."Name" LIKE @__p_1_rewritten ESCAPE '\' +WHERE "p"."BrandId" = @keys1 AND "p"."Name" LIKE @p_startswith ESCAPE '\' ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering_NET10_0.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering_NET8_0_NET9_0.md similarity index 65% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering_NET10_0.md rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering_NET8_0_NET9_0.md index c12cd0441b4..ca3fde604fb 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Filtering_NET8_0_NET9_0.md @@ -3,12 +3,15 @@ ## SQL ```text -.param set @keys1 1 -.param set @p_startswith 'Product%' +.param set @__keys_0 '[1]' +.param set @__p_1_rewritten 'Product%' SELECT "p"."Id", "p"."AvailableStock", "p"."BrandId", "p"."Description", "p"."ImageFileName", "p"."MaxStockThreshold", "p"."Name", "p"."OnReorder", "p"."Price", "p"."RestockThreshold", "p"."TypeId" FROM "Products" AS "p" -WHERE "p"."BrandId" = @keys1 AND "p"."Name" LIKE @p_startswith ESCAPE '\' +WHERE "p"."BrandId" IN ( + SELECT "k"."value" + FROM json_each(@__keys_0) AS "k" +) AND "p"."Name" LIKE @__p_1_rewritten ESCAPE '\' ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression.md index d6aef0e50c8..06619e6f94c 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression.md +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression.md @@ -3,29 +3,21 @@ ## SQL ```text +.param set @keys1 1 +SELECT "b"."Id", "b"."DisplayName", "b"."Name", "b"."Details_Country_Name" +FROM "Brands" AS "b" +WHERE "b"."Id" = @keys1 AND "b"."Name" LIKE 'Brand%' AND "b"."Name" LIKE '%0' ``` ## Result ```json { - "errors": [ - { - "message": "Unexpected Execution Error", - "path": [ - "multiFilterExpression" - ], - "extensions": { - "exception": { - "message": "The LINQ expression 'DbSet()\n .Where(b => __keys_0\n .Contains(b.Id))\n .Where(b => b.Name.StartsWith(\"Brand\") && b.Name.EndsWith(0))' could not be translated. Additional information: Translation of method 'string.EndsWith' failed. If this method can be mapped to your custom function, see https://go.microsoft.com/fwlink/?linkid=2132413 for more information. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.", - "stackTrace": " at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.Translate(Expression expression)\n at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.Translate(Expression expression)\n at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)\n at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)\n at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)\n at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_0`1.b__0()\n at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)\n at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)\n at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToQueryString(IQueryable source)\n at HotChocolate.Data.Predicates.DataLoaderTests.BrandByIdDataLoader.LoadBatchAsync(IReadOnlyList`1 keys, DataLoaderFetchContext`1 context, CancellationToken cancellationToken) in /workspaces/repo/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/DataLoaderTests.cs:line 275\n at GreenDonut.StatefulBatchDataLoader`2.FetchAsync(IReadOnlyList`1 keys, Memory`1 results, DataLoaderFetchContext`1 context, CancellationToken cancellationToken) in /workspaces/repo/src/GreenDonut/src/GreenDonut/BatchDataLoader.cs:line 116\n at GreenDonut.DataLoaderBase`2.<>c__DisplayClass34_0.<g__StartDispatchingAsync|0>d.MoveNext() in /workspaces/repo/src/GreenDonut/src/GreenDonut/DataLoaderBase.cs:line 372\n--- End of stack trace from previous location ---\n at HotChocolate.Data.Predicates.DataLoaderTests.Query.MultiFilterExpression(Int32 id, BrandByIdDataLoader brandById, CancellationToken cancellationToken) in /workspaces/repo/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/DataLoaderTests.cs:line 211\n at HotChocolate.Resolvers.Expressions.ExpressionHelper.AwaitTaskHelper[T](Task`1 task) in /workspaces/repo/src/HotChocolate/Core/src/Types/Resolvers/Expressions/ExpressionHelper.cs:line 16\n at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.<b__0>d.MoveNext() in /workspaces/repo/src/HotChocolate/Core/src/Types/Types/Helpers/FieldMiddlewareCompiler.cs:line 127\n--- End of stack trace from previous location ---\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken) in /workspaces/repo/src/HotChocolate/Core/src/Types/Execution/Processing/Tasks/ResolverTask.Execute.cs:line 135\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken) in /workspaces/repo/src/HotChocolate/Core/src/Types/Execution/Processing/Tasks/ResolverTask.Execute.cs:line 81" - } - } - } - ], "data": { - "multiFilterExpression": null + "multiFilterExpression": { + "name": "Brand0" + } } } ``` diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression_NET10_0.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression_NET10_0.md deleted file mode 100644 index 06619e6f94c..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression_NET10_0.md +++ /dev/null @@ -1,23 +0,0 @@ -# Filter_With_Multi_Expression - -## SQL - -```text -.param set @keys1 1 - -SELECT "b"."Id", "b"."DisplayName", "b"."Name", "b"."Details_Country_Name" -FROM "Brands" AS "b" -WHERE "b"."Id" = @keys1 AND "b"."Name" LIKE 'Brand%' AND "b"."Name" LIKE '%0' -``` - -## Result - -```json -{ - "data": { - "multiFilterExpression": { - "name": "Brand0" - } - } -} -``` diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression_NET8_0.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression_NET8_0.md new file mode 100644 index 00000000000..5599950fbde --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression_NET8_0.md @@ -0,0 +1,31 @@ +# Filter_With_Multi_Expression + +## SQL + +```text + +``` + +## Result + +```json +{ + "errors": [ + { + "message": "Unexpected Execution Error", + "path": [ + "multiFilterExpression" + ], + "extensions": { + "exception": { + "message": "The LINQ expression 'DbSet()\n .Where(b => __keys_0\n .Contains(b.Id))\n .Where(b => b.Name.StartsWith(\"Brand\") && b.Name.EndsWith(0))' could not be translated. Additional information: Translation of method 'string.EndsWith' failed. If this method can be mapped to your custom function, see https://go.microsoft.com/fwlink/?linkid=2132413 for more information. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.", + "stackTrace": " at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.Translate(Expression expression)\n at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.Translate(Expression expression)\n at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)\n at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)\n at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)\n at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_0`1.b__0()\n at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)\n at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)\n at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToQueryString(IQueryable source)\n at HotChocolate.Data.Predicates.DataLoaderTests.BrandByIdDataLoader.LoadBatchAsync(IReadOnlyList`1 keys, DataLoaderFetchContext`1 context, CancellationToken cancellationToken) in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\HotChocolate\\Data\\test\\Data.Filters.SqlServer.Tests\\DataLoaderTests.cs:line 261\n at GreenDonut.StatefulBatchDataLoader`2.FetchAsync(IReadOnlyList`1 keys, Memory`1 results, DataLoaderFetchContext`1 context, CancellationToken cancellationToken) in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\GreenDonut\\src\\GreenDonut\\BatchDataLoader.cs:line 116\n at GreenDonut.DataLoaderBase`2.<>c__DisplayClass34_0.<g__StartDispatchingAsync|0>d.MoveNext() in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\GreenDonut\\src\\GreenDonut\\DataLoaderBase.cs:line 372\n--- End of stack trace from previous location ---\n at HotChocolate.Data.Predicates.DataLoaderTests.Query.MultiFilterExpression(Int32 id, BrandByIdDataLoader brandById, CancellationToken cancellationToken) in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\HotChocolate\\Data\\test\\Data.Filters.SqlServer.Tests\\DataLoaderTests.cs:line 197\n at HotChocolate.Resolvers.Expressions.ExpressionHelper.AwaitTaskHelper[T](Task`1 task) in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\HotChocolate\\Core\\src\\Types\\Resolvers\\Expressions\\ExpressionHelper.cs:line 16\n at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.<b__0>d.MoveNext() in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\HotChocolate\\Core\\src\\Types\\Types\\Helpers\\FieldMiddlewareCompiler.cs:line 127\n--- End of stack trace from previous location ---\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken) in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\HotChocolate\\Core\\src\\Types\\Execution\\Processing\\Tasks\\ResolverTask.Execute.cs:line 135\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken) in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\HotChocolate\\Core\\src\\Types\\Execution\\Processing\\Tasks\\ResolverTask.Execute.cs:line 81" + } + } + } + ], + "data": { + "multiFilterExpression": null + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression_NET9_0.md b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression_NET9_0.md new file mode 100644 index 00000000000..4f32ed08e5a --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/DataLoaderTests.Filter_With_Multi_Expression_NET9_0.md @@ -0,0 +1,31 @@ +# Filter_With_Multi_Expression + +## SQL + +```text + +``` + +## Result + +```json +{ + "errors": [ + { + "message": "Unexpected Execution Error", + "path": [ + "multiFilterExpression" + ], + "extensions": { + "exception": { + "message": "The LINQ expression 'DbSet()\n .Where(b => __keys_0\n .Contains(b.Id))\n .Where(b => b.Name.StartsWith(\"Brand\") && b.Name.EndsWith(0))' could not be translated. Additional information: Translation of method 'string.EndsWith' failed. If this method can be mapped to your custom function, see https://go.microsoft.com/fwlink/?linkid=2132413 for more information. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.", + "stackTrace": " at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.Translate(Expression expression)\n at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutorExpression[TResult](Expression query)\n at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)\n at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)\n at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)\n at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass11_0`1.b__0()\n at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)\n at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteCore[TResult](Expression query, Boolean async, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)\n at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToQueryString(IQueryable source)\n at HotChocolate.Data.Predicates.DataLoaderTests.BrandByIdDataLoader.LoadBatchAsync(IReadOnlyList`1 keys, DataLoaderFetchContext`1 context, CancellationToken cancellationToken) in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\HotChocolate\\Data\\test\\Data.Filters.SqlServer.Tests\\DataLoaderTests.cs:line 261\n at GreenDonut.StatefulBatchDataLoader`2.FetchAsync(IReadOnlyList`1 keys, Memory`1 results, DataLoaderFetchContext`1 context, CancellationToken cancellationToken) in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\GreenDonut\\src\\GreenDonut\\BatchDataLoader.cs:line 116\n at GreenDonut.DataLoaderBase`2.<>c__DisplayClass34_0.<g__StartDispatchingAsync|0>d.MoveNext() in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\GreenDonut\\src\\GreenDonut\\DataLoaderBase.cs:line 372\n--- End of stack trace from previous location ---\n at HotChocolate.Data.Predicates.DataLoaderTests.Query.MultiFilterExpression(Int32 id, BrandByIdDataLoader brandById, CancellationToken cancellationToken) in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\HotChocolate\\Data\\test\\Data.Filters.SqlServer.Tests\\DataLoaderTests.cs:line 197\n at HotChocolate.Resolvers.Expressions.ExpressionHelper.AwaitTaskHelper[T](Task`1 task) in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\HotChocolate\\Core\\src\\Types\\Resolvers\\Expressions\\ExpressionHelper.cs:line 16\n at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.<b__0>d.MoveNext() in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\HotChocolate\\Core\\src\\Types\\Types\\Helpers\\FieldMiddlewareCompiler.cs:line 127\n--- End of stack trace from previous location ---\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken) in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\HotChocolate\\Core\\src\\Types\\Execution\\Processing\\Tasks\\ResolverTask.Execute.cs:line 135\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken) in D:\\Programming\\Projects\\ChilliCream\\graphql-platform\\graphql-platform-misc\\src\\HotChocolate\\Core\\src\\Types\\Execution\\Processing\\Tasks\\ResolverTask.Execute.cs:line 81" + } + } + } + ], + "data": { + "multiFilterExpression": null + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression.snap index 1acea75d7a1..f458a1c5844 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression.snap @@ -13,11 +13,11 @@ true Result: true SQL: --------------- -.param set @__p_0 1 +.param set @p 1 SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @__p_0 +WHERE "d"."Bar" = @p --------------- false Result: @@ -35,11 +35,11 @@ false Result: false SQL: --------------- -.param set @__p_0 0 +.param set @p 0 SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @__p_0 +WHERE "d"."Bar" = @p --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression_NET8_0_NET9_0.snap similarity index 88% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression_NET8_0_NET9_0.snap index f458a1c5844..1acea75d7a1 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanEqual_Expression_NET8_0_NET9_0.snap @@ -13,11 +13,11 @@ true Result: true SQL: --------------- -.param set @p 1 +.param set @__p_0 1 SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @p +WHERE "d"."Bar" = @__p_0 --------------- false Result: @@ -35,11 +35,11 @@ false Result: false SQL: --------------- -.param set @p 0 +.param set @__p_0 0 SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @p +WHERE "d"."Bar" = @__p_0 --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression.snap index c05143c3c25..66aef7e7af7 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression.snap @@ -16,11 +16,11 @@ true Result: true SQL: --------------- -.param set @__p_0 1 +.param set @p 1 SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> @__p_0 OR "d"."Bar" IS NULL +WHERE "d"."Bar" <> @p OR "d"."Bar" IS NULL --------------- false Result: @@ -41,11 +41,11 @@ false Result: false SQL: --------------- -.param set @__p_0 0 +.param set @p 0 SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> @__p_0 OR "d"."Bar" IS NULL +WHERE "d"."Bar" <> @p OR "d"."Bar" IS NULL --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET8_0_NET9_0.snap similarity index 85% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET8_0_NET9_0.snap index 66aef7e7af7..c05143c3c25 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorBooleanTests.Create_NullableBooleanNotEqual_Expression_NET8_0_NET9_0.snap @@ -16,11 +16,11 @@ true Result: true SQL: --------------- -.param set @p 1 +.param set @__p_0 1 SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> @p OR "d"."Bar" IS NULL +WHERE "d"."Bar" <> @__p_0 OR "d"."Bar" IS NULL --------------- false Result: @@ -41,11 +41,11 @@ false Result: false SQL: --------------- -.param set @p 0 +.param set @__p_0 0 SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> @p OR "d"."Bar" IS NULL +WHERE "d"."Bar" <> @__p_0 OR "d"."Bar" IS NULL --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression.snap index a17939f55fa..db3bf4a24b4 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression.snap @@ -13,11 +13,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" = @__p_0 +WHERE "d"."BarShort" = @p --------------- 13 Result: @@ -35,11 +35,11 @@ WHERE "d"."BarShort" = @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" = @__p_0 +WHERE "d"."BarShort" = @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression_NET8_0_NET9_0.snap similarity index 91% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression_NET8_0_NET9_0.snap index db3bf4a24b4..a17939f55fa 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortEqual_Expression_NET8_0_NET9_0.snap @@ -13,11 +13,11 @@ 12 SQL: --------------- -.param set @p 12 +.param set @__p_0 12 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" = @p +WHERE "d"."BarShort" = @__p_0 --------------- 13 Result: @@ -35,11 +35,11 @@ WHERE "d"."BarShort" = @p 13 SQL: --------------- -.param set @p 13 +.param set @__p_0 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" = @p +WHERE "d"."BarShort" = @__p_0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThanOrEquals_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThanOrEquals_Expression.snap index 99ff8e2b063..6a883fa3fa1 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThanOrEquals_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThanOrEquals_Expression.snap @@ -19,11 +19,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" >= @__p_0 +WHERE "d"."BarShort" >= @p --------------- 13 Result: @@ -44,11 +44,11 @@ WHERE "d"."BarShort" >= @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" >= @__p_0 +WHERE "d"."BarShort" >= @p --------------- 14 Result: @@ -66,11 +66,11 @@ WHERE "d"."BarShort" >= @__p_0 14 SQL: --------------- -.param set @__p_0 14 +.param set @p 14 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" >= @__p_0 +WHERE "d"."BarShort" >= @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThanOrEquals_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThanOrEquals_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..99ff8e2b063 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThanOrEquals_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,102 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @__p_0 +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @__p_0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `gte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThan_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThan_Expression.snap index 4e8fb7b75a3..59c6f1619da 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThan_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThan_Expression.snap @@ -16,11 +16,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" > @__p_0 +WHERE "d"."BarShort" > @p --------------- 13 Result: @@ -38,11 +38,11 @@ WHERE "d"."BarShort" > @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" > @__p_0 +WHERE "d"."BarShort" > @p --------------- 14 Result: @@ -56,11 +56,11 @@ WHERE "d"."BarShort" > @__p_0 14 SQL: --------------- -.param set @__p_0 14 +.param set @p 14 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" > @__p_0 +WHERE "d"."BarShort" > @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThan_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThan_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..4e8fb7b75a3 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortGreaterThan_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,92 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @__p_0 +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @__p_0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `gt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 33 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression.snap index a22ffff9cca..29169ac9085 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression.snap @@ -16,14 +16,12 @@ 12and13 SQL: --------------- -.param set @__p_0 '[12,13]' +.param set @p1 12 +.param set @p2 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "d"."BarShort" IN (@p1, @p2) --------------- 13and14 Result: @@ -44,14 +42,12 @@ WHERE "d"."BarShort" IN ( 13and14 SQL: --------------- -.param set @__p_0 '[13,14]' +.param set @p1 13 +.param set @p2 14 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "d"."BarShort" IN (@p1, @p2) --------------- nullAnd14 diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..a22ffff9cca --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortIn_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,83 @@ +12and13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12and13 SQL: +--------------- +.param set @__p_0 '[12,13]' + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) +--------------- + +13and14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13and14 SQL: +--------------- +.param set @__p_0 '[13,14]' + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) +--------------- + +nullAnd14 +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `in` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 33 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "[Short!]", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThanOrEquals_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThanOrEquals_Expression.snap index 640e056d88f..63a34989ec9 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThanOrEquals_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThanOrEquals_Expression.snap @@ -13,11 +13,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <= @__p_0 +WHERE "d"."BarShort" <= @p --------------- 13 Result: @@ -38,11 +38,11 @@ WHERE "d"."BarShort" <= @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <= @__p_0 +WHERE "d"."BarShort" <= @p --------------- 14 Result: @@ -66,11 +66,11 @@ WHERE "d"."BarShort" <= @__p_0 14 SQL: --------------- -.param set @__p_0 14 +.param set @p 14 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <= @__p_0 +WHERE "d"."BarShort" <= @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThanOrEquals_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThanOrEquals_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..640e056d88f --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThanOrEquals_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,102 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @__p_0 +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @__p_0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `lte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThan_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThan_Expression.snap index c48d26fdcb3..6cc8d7f6821 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThan_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThan_Expression.snap @@ -9,11 +9,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" < @__p_0 +WHERE "d"."BarShort" < @p --------------- 13 Result: @@ -31,11 +31,11 @@ WHERE "d"."BarShort" < @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" < @__p_0 +WHERE "d"."BarShort" < @p --------------- 14 Result: @@ -56,11 +56,11 @@ WHERE "d"."BarShort" < @__p_0 14 SQL: --------------- -.param set @__p_0 14 +.param set @p 14 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" < @__p_0 +WHERE "d"."BarShort" < @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThan_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThan_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..c48d26fdcb3 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortLowerThan_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,92 @@ +12 Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @__p_0 +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @__p_0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `lt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 33 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotEqual_Expression.snap index 8a60b5a2115..b4cdf6cf28e 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotEqual_Expression.snap @@ -16,11 +16,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <> @__p_0 +WHERE "d"."BarShort" <> @p --------------- 13 Result: @@ -41,11 +41,11 @@ WHERE "d"."BarShort" <> @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <> @__p_0 +WHERE "d"."BarShort" <> @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotEqual_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotEqual_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..8a60b5a2115 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotEqual_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,77 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <> @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <> @__p_0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `neq` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThanOrEquals_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThanOrEquals_Expression.snap index 7c5543b5641..925ef96bc4e 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThanOrEquals_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThanOrEquals_Expression.snap @@ -9,11 +9,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" < @__p_0 +WHERE "d"."BarShort" < @p --------------- 13 Result: @@ -31,11 +31,11 @@ WHERE "d"."BarShort" < @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" < @__p_0 +WHERE "d"."BarShort" < @p --------------- 14 Result: @@ -56,11 +56,11 @@ WHERE "d"."BarShort" < @__p_0 14 SQL: --------------- -.param set @__p_0 14 +.param set @p 14 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" < @__p_0 +WHERE "d"."BarShort" < @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThanOrEquals_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThanOrEquals_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..7c5543b5641 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThanOrEquals_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,92 @@ +12 Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @__p_0 +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @__p_0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `ngte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 35 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThan_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThan_Expression.snap index 667b53e2d47..407a872dd15 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThan_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThan_Expression.snap @@ -13,11 +13,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <= @__p_0 +WHERE "d"."BarShort" <= @p --------------- 13 Result: @@ -38,11 +38,11 @@ WHERE "d"."BarShort" <= @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <= @__p_0 +WHERE "d"."BarShort" <= @p --------------- 14 Result: @@ -66,11 +66,11 @@ WHERE "d"."BarShort" <= @__p_0 14 SQL: --------------- -.param set @__p_0 14 +.param set @p 14 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <= @__p_0 +WHERE "d"."BarShort" <= @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThan_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThan_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..667b53e2d47 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotGreaterThan_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,102 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @__p_0 +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @__p_0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `ngt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression.snap index 6da4fd4e544..fbd1d43ab08 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression.snap @@ -13,14 +13,12 @@ 12and13 SQL: --------------- -.param set @__p_0 '[12,13]' +.param set @p1 12 +.param set @p2 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "d"."BarShort" NOT IN (@p1, @p2) --------------- 13and14 Result: @@ -38,14 +36,12 @@ WHERE "d"."BarShort" NOT IN ( 13and14 SQL: --------------- -.param set @__p_0 '[13,14]' +.param set @p1 13 +.param set @p2 14 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "d"."BarShort" NOT IN (@p1, @p2) --------------- nullAnd14 diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..6da4fd4e544 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotIn_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,77 @@ +12and13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +12and13 SQL: +--------------- +.param set @__p_0 '[12,13]' + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) +--------------- + +13and14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +13and14 SQL: +--------------- +.param set @__p_0 '[13,14]' + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) +--------------- + +nullAnd14 +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nin` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "[Short!]", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThanOrEquals_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThanOrEquals_Expression.snap index 290cddb29de..712a3b28bb5 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThanOrEquals_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThanOrEquals_Expression.snap @@ -16,11 +16,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" > @__p_0 +WHERE "d"."BarShort" > @p --------------- 13 Result: @@ -38,11 +38,11 @@ WHERE "d"."BarShort" > @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" > @__p_0 +WHERE "d"."BarShort" > @p --------------- 14 Result: @@ -56,11 +56,11 @@ WHERE "d"."BarShort" > @__p_0 14 SQL: --------------- -.param set @__p_0 14 +.param set @p 14 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" > @__p_0 +WHERE "d"."BarShort" > @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThanOrEquals_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThanOrEquals_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..290cddb29de --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThanOrEquals_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,92 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @__p_0 +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" > @__p_0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nlte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 35 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThan_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThan_Expression.snap index 3c7f19803ea..8d9e9239a07 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThan_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThan_Expression.snap @@ -19,11 +19,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" >= @__p_0 +WHERE "d"."BarShort" >= @p --------------- 13 Result: @@ -44,11 +44,11 @@ WHERE "d"."BarShort" >= @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" >= @__p_0 +WHERE "d"."BarShort" >= @p --------------- 14 Result: @@ -66,11 +66,11 @@ WHERE "d"."BarShort" >= @__p_0 14 SQL: --------------- -.param set @__p_0 14 +.param set @p 14 SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" >= @__p_0 +WHERE "d"."BarShort" >= @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThan_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThan_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..3c7f19803ea --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNotLowerThan_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,102 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @__p_0 +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @__p_0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `nlt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableEqual_Expression.snap index e64920be970..aae7a91081f 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableEqual_Expression.snap @@ -13,11 +13,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" = @__p_0 +WHERE "d"."BarShort" = @p --------------- 13 Result: @@ -35,11 +35,11 @@ WHERE "d"."BarShort" = @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" = @__p_0 +WHERE "d"."BarShort" = @p --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableEqual_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableEqual_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..e64920be970 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableEqual_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,63 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" = @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" = @__p_0 +--------------- + +null Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": null + } + ] + } +} +--------------- + +null SQL: +--------------- +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" IS NULL +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThanOrEquals_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThanOrEquals_Expression.snap index 2f039cb53a5..50376b84291 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThanOrEquals_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThanOrEquals_Expression.snap @@ -19,11 +19,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" >= @__p_0 +WHERE "d"."BarShort" >= @p --------------- 13 Result: @@ -44,11 +44,11 @@ WHERE "d"."BarShort" >= @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" >= @__p_0 +WHERE "d"."BarShort" >= @p --------------- 14 Result: @@ -66,11 +66,11 @@ WHERE "d"."BarShort" >= @__p_0 14 SQL: --------------- -.param set @__p_0 14 +.param set @p 14 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" >= @__p_0 +WHERE "d"."BarShort" >= @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThanOrEquals_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThanOrEquals_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..2f039cb53a5 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThanOrEquals_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,102 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @__p_0 +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 14 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" >= @__p_0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `gte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression.snap index f1e76dbc41d..c1bea0679f4 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression.snap @@ -16,11 +16,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" > @__p_0 +WHERE "d"."BarShort" > @p --------------- 13 Result: @@ -38,11 +38,11 @@ WHERE "d"."BarShort" > @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" > @__p_0 +WHERE "d"."BarShort" > @p --------------- 14 Result: @@ -56,11 +56,11 @@ WHERE "d"."BarShort" > @__p_0 14 SQL: --------------- -.param set @__p_0 14 +.param set @p 14 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" > @__p_0 +WHERE "d"."BarShort" > @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression_NET8_0_NET9_0.snap similarity index 88% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression_NET8_0_NET9_0.snap index c1bea0679f4..f1e76dbc41d 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableGreaterThan_Expression_NET8_0_NET9_0.snap @@ -16,11 +16,11 @@ 12 SQL: --------------- -.param set @p 12 +.param set @__p_0 12 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" > @p +WHERE "d"."BarShort" > @__p_0 --------------- 13 Result: @@ -38,11 +38,11 @@ WHERE "d"."BarShort" > @p 13 SQL: --------------- -.param set @p 13 +.param set @__p_0 13 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" > @p +WHERE "d"."BarShort" > @__p_0 --------------- 14 Result: @@ -56,11 +56,11 @@ WHERE "d"."BarShort" > @p 14 SQL: --------------- -.param set @p 14 +.param set @__p_0 14 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" > @p +WHERE "d"."BarShort" > @__p_0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThanOrEquals_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThanOrEquals_Expression.snap index 3cb54d1be73..180a1a6ee28 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThanOrEquals_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThanOrEquals_Expression.snap @@ -13,11 +13,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <= @__p_0 +WHERE "d"."BarShort" <= @p --------------- 13 Result: @@ -38,11 +38,11 @@ WHERE "d"."BarShort" <= @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <= @__p_0 +WHERE "d"."BarShort" <= @p --------------- 14 Result: @@ -66,11 +66,11 @@ WHERE "d"."BarShort" <= @__p_0 14 SQL: --------------- -.param set @__p_0 14 +.param set @p 14 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <= @__p_0 +WHERE "d"."BarShort" <= @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThanOrEquals_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThanOrEquals_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..3cb54d1be73 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThanOrEquals_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,102 @@ +12 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @__p_0 +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 14 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" <= @__p_0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `lte` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 34 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThan_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThan_Expression.snap index c65fb798240..54e49a5f24e 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThan_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThan_Expression.snap @@ -9,11 +9,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" < @__p_0 +WHERE "d"."BarShort" < @p --------------- 13 Result: @@ -31,11 +31,11 @@ WHERE "d"."BarShort" < @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" < @__p_0 +WHERE "d"."BarShort" < @p --------------- 14 Result: @@ -56,11 +56,11 @@ WHERE "d"."BarShort" < @__p_0 14 SQL: --------------- -.param set @__p_0 14 +.param set @p 14 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" < @__p_0 +WHERE "d"."BarShort" < @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThan_Expression_NET8_0_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThan_Expression_NET8_0_NET9_0.snap new file mode 100644 index 00000000000..c65fb798240 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableLowerThan_Expression_NET8_0_NET9_0.snap @@ -0,0 +1,92 @@ +12 Result: +--------------- +{ + "data": { + "root": [] + } +} +--------------- + +12 SQL: +--------------- +.param set @__p_0 12 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @__p_0 +--------------- + +13 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + } + ] + } +} +--------------- + +13 SQL: +--------------- +.param set @__p_0 13 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @__p_0 +--------------- + +14 Result: +--------------- +{ + "data": { + "root": [ + { + "barShort": 12 + }, + { + "barShort": 13 + } + ] + } +} +--------------- + +14 SQL: +--------------- +.param set @__p_0 14 + +SELECT "d"."Id", "d"."BarShort" +FROM "Data" AS "d" +WHERE "d"."BarShort" < @__p_0 +--------------- + +null +--------------- +{ + "errors": [ + { + "message": "The provided value for filter `lt` of type ShortOperationFilterInput is invalid. Null values are not supported.", + "locations": [ + { + "line": 1, + "column": 33 + } + ], + "path": [ + "root" + ], + "extensions": { + "code": "HC0026", + "expectedType": "Short!", + "filterType": "ShortOperationFilterInput" + } + } + ], + "data": { + "root": null + } +} +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression.snap index b3b7074d1e5..6f3647798f5 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression.snap @@ -19,11 +19,11 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <> @__p_0 OR "d"."BarShort" IS NULL +WHERE "d"."BarShort" <> @p OR "d"."BarShort" IS NULL --------------- 13 Result: @@ -47,11 +47,11 @@ WHERE "d"."BarShort" <> @__p_0 OR "d"."BarShort" IS NULL 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" <> @__p_0 OR "d"."BarShort" IS NULL +WHERE "d"."BarShort" <> @p OR "d"."BarShort" IS NULL --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET8_0_NET9_0.snap similarity index 57% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET9_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET8_0_NET9_0.snap index 39ff3fefa3b..b3b7074d1e5 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET9_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET8_0_NET9_0.snap @@ -1,10 +1,13 @@ -12and13 Result: +12 Result: --------------- { "data": { "root": [ { - "barShort": 12 + "barShort": null + }, + { + "barShort": 14 }, { "barShort": 13 @@ -14,53 +17,53 @@ } --------------- -12and13 SQL: +12 SQL: --------------- -.param set @__p_0 '[12,13]' +.param set @__p_0 12 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "d"."BarShort" <> @__p_0 OR "d"."BarShort" IS NULL --------------- -13and14 Result: +13 Result: --------------- { "data": { "root": [ { - "barShort": 14 + "barShort": 12 }, { - "barShort": 13 + "barShort": null + }, + { + "barShort": 14 } ] } } --------------- -13and14 SQL: +13 SQL: --------------- -.param set @__p_0 '[13,14]' +.param set @__p_0 13 SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "d"."BarShort" <> @__p_0 OR "d"."BarShort" IS NULL --------------- -13andNull Result: +null Result: --------------- { "data": { "root": [ { - "barShort": null + "barShort": 12 + }, + { + "barShort": 14 }, { "barShort": 13 @@ -70,14 +73,9 @@ WHERE "d"."BarShort" IN ( } --------------- -13andNull SQL: +null SQL: --------------- -.param set @__p_0_without_nulls '[13]' - SELECT "d"."Id", "d"."BarShort" FROM "Data" AS "d" -WHERE "d"."BarShort" IN ( - SELECT "p"."value" - FROM json_each(@__p_0_without_nulls) AS "p" -) OR "d"."BarShort" IS NULL +WHERE "d"."BarShort" IS NOT NULL --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThanOrEquals_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotGreaterThan_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET9_0.snap deleted file mode 100644 index 120bf90817f..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET9_0.snap +++ /dev/null @@ -1,83 +0,0 @@ -12and13 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": null - }, - { - "barShort": 14 - } - ] - } -} ---------------- - -12and13 SQL: ---------------- -.param set @__p_0 '[12,13]' - -SELECT "d"."Id", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) OR "d"."BarShort" IS NULL ---------------- - -13and14 Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 12 - }, - { - "barShort": null - } - ] - } -} ---------------- - -13and14 SQL: ---------------- -.param set @__p_0 '[13,14]' - -SELECT "d"."Id", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) OR "d"."BarShort" IS NULL ---------------- - -13andNull Result: ---------------- -{ - "data": { - "root": [ - { - "barShort": 12 - }, - { - "barShort": 14 - } - ] - } -} ---------------- - -13andNull SQL: ---------------- -.param set @__p_0_without_nulls '[13]' - -SELECT "d"."Id", "d"."BarShort" -FROM "Data" AS "d" -WHERE "d"."BarShort" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0_without_nulls) AS "p" -) AND "d"."BarShort" IS NOT NULL ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThanOrEquals_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotLowerThan_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression.snap index fee4eb3d4af..efdcd684f79 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression.snap @@ -13,11 +13,11 @@ BAR Result: BAR SQL: --------------- -.param set @__p_0 1 +.param set @p 1 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" = @__p_0 +WHERE "d"."BarEnum" = @p --------------- FOO Result: @@ -35,11 +35,11 @@ FOO Result: FOO SQL: --------------- -.param set @__p_0 0 +.param set @p 0 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" = @__p_0 +WHERE "d"."BarEnum" = @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression_NET8_0_NET9_0.snap similarity index 90% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression_NET8_0_NET9_0.snap index efdcd684f79..fee4eb3d4af 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumEqual_Expression_NET8_0_NET9_0.snap @@ -13,11 +13,11 @@ BAR Result: BAR SQL: --------------- -.param set @p 1 +.param set @__p_0 1 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" = @p +WHERE "d"."BarEnum" = @__p_0 --------------- FOO Result: @@ -35,11 +35,11 @@ FOO Result: FOO SQL: --------------- -.param set @p 0 +.param set @__p_0 0 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" = @p +WHERE "d"."BarEnum" = @__p_0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression.snap index 42b18f8395a..4c04960d38d 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression.snap @@ -16,14 +16,12 @@ BarAndFoo Result: BarAndFoo SQL: --------------- -.param set @__p_0 '[1,0]' +.param set @p1 1 +.param set @p2 0 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "d"."BarEnum" IN (@p1, @p2) --------------- FOO Result: @@ -41,14 +39,11 @@ FOO Result: FOO SQL: --------------- -.param set @__p_0 '[0]' +.param set @p1 0 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "d"."BarEnum" = @p1 --------------- nullAndFoo Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET8_0_NET9_0.snap similarity index 82% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET8_0_NET9_0.snap index 4c04960d38d..42b18f8395a 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumIn_Expression_NET8_0_NET9_0.snap @@ -16,12 +16,14 @@ BarAndFoo Result: BarAndFoo SQL: --------------- -.param set @p1 1 -.param set @p2 0 +.param set @__p_0 '[1,0]' SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" IN (@p1, @p2) +WHERE "d"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- FOO Result: @@ -39,11 +41,14 @@ FOO Result: FOO SQL: --------------- -.param set @p1 0 +.param set @__p_0 '[0]' SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" = @p1 +WHERE "d"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- nullAndFoo Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression.snap index 5432abc2324..70e79e6972d 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression.snap @@ -19,11 +19,11 @@ BAR Result: BAR SQL: --------------- -.param set @__p_0 1 +.param set @p 1 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" <> @__p_0 +WHERE "d"."BarEnum" <> @p --------------- FOO Result: @@ -47,11 +47,11 @@ FOO Result: FOO SQL: --------------- -.param set @__p_0 0 +.param set @p 0 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" <> @__p_0 +WHERE "d"."BarEnum" <> @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression_NET8_0_NET9_0.snap similarity index 91% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression_NET8_0_NET9_0.snap index 70e79e6972d..5432abc2324 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotEqual_Expression_NET8_0_NET9_0.snap @@ -19,11 +19,11 @@ BAR Result: BAR SQL: --------------- -.param set @p 1 +.param set @__p_0 1 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" <> @p +WHERE "d"."BarEnum" <> @__p_0 --------------- FOO Result: @@ -47,11 +47,11 @@ FOO Result: FOO SQL: --------------- -.param set @p 0 +.param set @__p_0 0 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" <> @p +WHERE "d"."BarEnum" <> @__p_0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression.snap index 6a07ddc74d4..f629d538a25 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression.snap @@ -16,14 +16,12 @@ BarAndFoo Result: BarAndFoo SQL: --------------- -.param set @__p_0 '[1,0]' +.param set @p1 1 +.param set @p2 0 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "d"."BarEnum" NOT IN (@p1, @p2) --------------- FOO Result: @@ -47,14 +45,11 @@ FOO Result: FOO SQL: --------------- -.param set @__p_0 '[0]' +.param set @p1 0 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "d"."BarEnum" <> @p1 --------------- nullAndFoo Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET8_0_NET9_0.snap similarity index 83% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET8_0_NET9_0.snap index f629d538a25..6a07ddc74d4 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_EnumNotIn_Expression_NET8_0_NET9_0.snap @@ -16,12 +16,14 @@ BarAndFoo Result: BarAndFoo SQL: --------------- -.param set @p1 1 -.param set @p2 0 +.param set @__p_0 '[1,0]' SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" NOT IN (@p1, @p2) +WHERE "d"."BarEnum" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- FOO Result: @@ -45,11 +47,14 @@ FOO Result: FOO SQL: --------------- -.param set @p1 0 +.param set @__p_0 '[0]' SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" <> @p1 +WHERE "d"."BarEnum" NOT IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- nullAndFoo Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression.snap index f313eae7a6e..a1a3271c78b 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression.snap @@ -13,11 +13,11 @@ BAR Result: BAR SQL: --------------- -.param set @__p_0 1 +.param set @p 1 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" = @__p_0 +WHERE "d"."BarEnum" = @p --------------- FOO Result: @@ -35,11 +35,11 @@ FOO Result: FOO SQL: --------------- -.param set @__p_0 0 +.param set @p 0 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" = @__p_0 +WHERE "d"."BarEnum" = @p --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression_NET8_0_NET9_0.snap similarity index 87% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression_NET8_0_NET9_0.snap index a1a3271c78b..f313eae7a6e 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumEqual_Expression_NET8_0_NET9_0.snap @@ -13,11 +13,11 @@ BAR Result: BAR SQL: --------------- -.param set @p 1 +.param set @__p_0 1 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" = @p +WHERE "d"."BarEnum" = @__p_0 --------------- FOO Result: @@ -35,11 +35,11 @@ FOO Result: FOO SQL: --------------- -.param set @p 0 +.param set @__p_0 0 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" = @p +WHERE "d"."BarEnum" = @__p_0 --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET9_0.snap deleted file mode 100644 index 6e98dc2b031..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET9_0.snap +++ /dev/null @@ -1,80 +0,0 @@ -BarAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "FOO" - } - ] - } -} ---------------- - -BarAndFoo SQL: ---------------- -.param set @__p_0 '[1,0]' - -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "FOO" - } - ] - } -} ---------------- - -FOO SQL: ---------------- -.param set @__p_0 '[0]' - -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) ---------------- - -nullAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "FOO" - }, - { - "barEnum": null - } - ] - } -} ---------------- - -nullAndFoo SQL: ---------------- -.param set @__p_0_without_nulls '[0]' - -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" IN ( - SELECT "p"."value" - FROM json_each(@__p_0_without_nulls) AS "p" -) OR "d"."BarEnum" IS NULL ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression.snap index 944014046d2..05109068c3f 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression.snap @@ -22,11 +22,11 @@ BAR Result: BAR SQL: --------------- -.param set @__p_0 1 +.param set @p 1 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" <> @__p_0 OR "d"."BarEnum" IS NULL +WHERE "d"."BarEnum" <> @p OR "d"."BarEnum" IS NULL --------------- FOO Result: @@ -53,11 +53,11 @@ FOO Result: FOO SQL: --------------- -.param set @__p_0 0 +.param set @p 0 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" <> @__p_0 OR "d"."BarEnum" IS NULL +WHERE "d"."BarEnum" <> @p OR "d"."BarEnum" IS NULL --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET8_0_NET9_0.snap similarity index 87% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET8_0_NET9_0.snap index 05109068c3f..944014046d2 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET8_0_NET9_0.snap @@ -22,11 +22,11 @@ BAR Result: BAR SQL: --------------- -.param set @p 1 +.param set @__p_0 1 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" <> @p OR "d"."BarEnum" IS NULL +WHERE "d"."BarEnum" <> @__p_0 OR "d"."BarEnum" IS NULL --------------- FOO Result: @@ -53,11 +53,11 @@ FOO Result: FOO SQL: --------------- -.param set @p 0 +.param set @__p_0 0 SELECT "d"."Id", "d"."BarEnum" FROM "Data" AS "d" -WHERE "d"."BarEnum" <> @p OR "d"."BarEnum" IS NULL +WHERE "d"."BarEnum" <> @__p_0 OR "d"."BarEnum" IS NULL --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET9_0.snap deleted file mode 100644 index 250998cf0fb..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET9_0.snap +++ /dev/null @@ -1,95 +0,0 @@ -BarAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAZ" - }, - { - "barEnum": null - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -BarAndFoo SQL: ---------------- -.param set @__p_0 '[1,0]' - -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) OR "d"."BarEnum" IS NULL ---------------- - -FOO Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "BAZ" - }, - { - "barEnum": null - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -FOO SQL: ---------------- -.param set @__p_0 '[0]' - -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) OR "d"."BarEnum" IS NULL ---------------- - -nullAndFoo Result: ---------------- -{ - "data": { - "root": [ - { - "barEnum": "BAR" - }, - { - "barEnum": "BAZ" - }, - { - "barEnum": "QUX" - } - ] - } -} ---------------- - -nullAndFoo SQL: ---------------- -.param set @__p_0_without_nulls '[0]' - -SELECT "d"."Id", "d"."BarEnum" -FROM "Data" AS "d" -WHERE "d"."BarEnum" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0_without_nulls) AS "p" -) AND "d"."BarEnum" IS NOT NULL ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression.snap index 68ee52add58..ef7a8b954f0 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression.snap @@ -14,14 +14,14 @@ 1 SQL: --------------- -.param set @__p_0 1 +.param set @p 1 SELECT "d"."Id", "d"."LastName", "d"."Name" FROM "Data" AS "d" WHERE ( SELECT COUNT(*) FROM "Bar" AS "b" - WHERE "d"."Id" = "b"."FooId") = @__p_0 + WHERE "d"."Id" = "b"."FooId") = @p --------------- 0 Result: @@ -40,14 +40,14 @@ WHERE ( 0 SQL: --------------- -.param set @__p_0 0 +.param set @p 0 SELECT "d"."Id", "d"."LastName", "d"."Name" FROM "Data" AS "d" WHERE ( SELECT COUNT(*) FROM "Bar" AS "b" - WHERE "d"."Id" = "b"."FooId") = @__p_0 + WHERE "d"."Id" = "b"."FooId") = @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression_NET8_0_NET9_0.snap similarity index 89% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression_NET8_0_NET9_0.snap index ef7a8b954f0..68ee52add58 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_CollectionLengthExpression_NET8_0_NET9_0.snap @@ -14,14 +14,14 @@ 1 SQL: --------------- -.param set @p 1 +.param set @__p_0 1 SELECT "d"."Id", "d"."LastName", "d"."Name" FROM "Data" AS "d" WHERE ( SELECT COUNT(*) FROM "Bar" AS "b" - WHERE "d"."Id" = "b"."FooId") = @p + WHERE "d"."Id" = "b"."FooId") = @__p_0 --------------- 0 Result: @@ -40,14 +40,14 @@ WHERE ( 0 SQL: --------------- -.param set @p 0 +.param set @__p_0 0 SELECT "d"."Id", "d"."LastName", "d"."Name" FROM "Data" AS "d" WHERE ( SELECT COUNT(*) FROM "Bar" AS "b" - WHERE "d"."Id" = "b"."FooId") = @p + WHERE "d"."Id" = "b"."FooId") = @__p_0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression.snap index efa4d42ba1a..fe3e80799ce 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression.snap @@ -14,11 +14,11 @@ Sam_Sampleman Result: Sam_Sampleman SQL: --------------- -.param set @__p_0 'Sam Sampleman' +.param set @p 'Sam Sampleman' SELECT "d"."Id", "d"."LastName", "d"."Name" FROM "Data" AS "d" -WHERE COALESCE("d"."Name", '') || ' ' || COALESCE("d"."LastName", '') = @__p_0 +WHERE COALESCE("d"."Name", '') || ' ' || COALESCE("d"."LastName", '') = @p --------------- NoMatch Result: @@ -32,11 +32,11 @@ NoMatch Result: NoMatch SQL: --------------- -.param set @__p_0 'NoMatch' +.param set @p 'NoMatch' SELECT "d"."Id", "d"."LastName", "d"."Name" FROM "Data" AS "d" -WHERE COALESCE("d"."Name", '') || ' ' || COALESCE("d"."LastName", '') = @__p_0 +WHERE COALESCE("d"."Name", '') || ' ' || COALESCE("d"."LastName", '') = @p --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET8_0_NET9_0.snap similarity index 89% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET8_0_NET9_0.snap index fe3e80799ce..efa4d42ba1a 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorExpressionTests.Create_StringConcatExpression_NET8_0_NET9_0.snap @@ -14,11 +14,11 @@ Sam_Sampleman Result: Sam_Sampleman SQL: --------------- -.param set @p 'Sam Sampleman' +.param set @__p_0 'Sam Sampleman' SELECT "d"."Id", "d"."LastName", "d"."Name" FROM "Data" AS "d" -WHERE COALESCE("d"."Name", '') || ' ' || COALESCE("d"."LastName", '') = @p +WHERE COALESCE("d"."Name", '') || ' ' || COALESCE("d"."LastName", '') = @__p_0 --------------- NoMatch Result: @@ -32,11 +32,11 @@ NoMatch Result: NoMatch SQL: --------------- -.param set @p 'NoMatch' +.param set @__p_0 'NoMatch' SELECT "d"."Id", "d"."LastName", "d"."Name" FROM "Data" AS "d" -WHERE COALESCE("d"."Name", '') || ' ' || COALESCE("d"."LastName", '') = @p +WHERE COALESCE("d"."Name", '') || ' ' || COALESCE("d"."LastName", '') = @__p_0 --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression.snap index 30f200ccb38..245c50adcc7 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression.snap @@ -15,12 +15,12 @@ a Result: a SQL: --------------- -.param set @__p_0 'a' +.param set @p 'a' SELECT "d"."Id", "d"."TestId" FROM "Data" AS "d" INNER JOIN "Test" AS "t" ON "d"."TestId" = "t"."Id" -WHERE "t"."Prop" = @__p_0 +WHERE "t"."Prop" = @p --------------- ba Result: @@ -40,12 +40,12 @@ ba Result: ba SQL: --------------- -.param set @__p_0 'b' +.param set @p 'b' SELECT "d"."Id", "d"."TestId" FROM "Data" AS "d" INNER JOIN "Test" AS "t" ON "d"."TestId" = "t"."Id" -WHERE "t"."Prop" = @__p_0 +WHERE "t"."Prop" = @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression_NET8_0_NET9_0.snap similarity index 91% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression_NET8_0_NET9_0.snap index 245c50adcc7..30f200ccb38 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorInterfacesTests.Create_InterfaceStringEqual_Expression_NET8_0_NET9_0.snap @@ -15,12 +15,12 @@ a Result: a SQL: --------------- -.param set @p 'a' +.param set @__p_0 'a' SELECT "d"."Id", "d"."TestId" FROM "Data" AS "d" INNER JOIN "Test" AS "t" ON "d"."TestId" = "t"."Id" -WHERE "t"."Prop" = @p +WHERE "t"."Prop" = @__p_0 --------------- ba Result: @@ -40,12 +40,12 @@ ba Result: ba SQL: --------------- -.param set @p 'b' +.param set @__p_0 'b' SELECT "d"."Id", "d"."TestId" FROM "Data" AS "d" INNER JOIN "Test" AS "t" ON "d"."TestId" = "t"."Id" -WHERE "t"."Prop" = @p +WHERE "t"."Prop" = @__p_0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression.snap index 5d6f8c0f35a..a30b15c44e3 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression.snap @@ -23,14 +23,14 @@ a Result: a SQL: --------------- -.param set @__p_0 'a' +.param set @p 'a' SELECT "d"."Id" FROM "Data" AS "d" WHERE NOT EXISTS ( SELECT 1 FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR "f"."Bar" IS NULL)) + WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @p OR "f"."Bar" IS NULL)) --------------- d Result: @@ -44,14 +44,14 @@ d Result: d SQL: --------------- -.param set @__p_0 'd' +.param set @p 'd' SELECT "d"."Id" FROM "Data" AS "d" WHERE NOT EXISTS ( SELECT 1 FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR "f"."Bar" IS NULL)) + WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @p OR "f"."Bar" IS NULL)) --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET8_0_NET9_0.snap similarity index 81% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET8_0_NET9_0.snap index a30b15c44e3..5d6f8c0f35a 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET8_0_NET9_0.snap @@ -23,14 +23,14 @@ a Result: a SQL: --------------- -.param set @p 'a' +.param set @__p_0 'a' SELECT "d"."Id" FROM "Data" AS "d" WHERE NOT EXISTS ( SELECT 1 FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @p OR "f"."Bar" IS NULL)) + WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR "f"."Bar" IS NULL)) --------------- d Result: @@ -44,14 +44,14 @@ d Result: d SQL: --------------- -.param set @p 'd' +.param set @__p_0 'd' SELECT "d"."Id" FROM "Data" AS "d" WHERE NOT EXISTS ( SELECT 1 FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @p OR "f"."Bar" IS NULL)) + WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR "f"."Bar" IS NULL)) --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression.snap index 63822313708..8125c203591 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression.snap @@ -36,14 +36,14 @@ a Result: a SQL: --------------- -.param set @__p_0 'a' +.param set @p 'a' SELECT "d"."Id" FROM "Data" AS "d" WHERE NOT EXISTS ( SELECT 1 FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @__p_0) + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @p) --------------- d Result: @@ -84,14 +84,14 @@ d Result: d SQL: --------------- -.param set @__p_0 'd' +.param set @p 'd' SELECT "d"."Id" FROM "Data" AS "d" WHERE NOT EXISTS ( SELECT 1 FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @__p_0) + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @p) --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET8_0_NET9_0.snap similarity index 93% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET8_0_NET9_0.snap index 8125c203591..63822313708 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET8_0_NET9_0.snap @@ -36,14 +36,14 @@ a Result: a SQL: --------------- -.param set @p 'a' +.param set @__p_0 'a' SELECT "d"."Id" FROM "Data" AS "d" WHERE NOT EXISTS ( SELECT 1 FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @p) + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @__p_0) --------------- d Result: @@ -84,14 +84,14 @@ d Result: d SQL: --------------- -.param set @p 'd' +.param set @__p_0 'd' SELECT "d"."Id" FROM "Data" AS "d" WHERE NOT EXISTS ( SELECT 1 FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @p) + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @__p_0) --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression.snap index c29562a4db0..8ab6907cc03 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression.snap @@ -49,14 +49,14 @@ a Result: a SQL: --------------- -.param set @__p_0 'a' +.param set @p 'a' SELECT "d"."Id" FROM "Data" AS "d" WHERE EXISTS ( SELECT 1 FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @__p_0) + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @p) --------------- d Result: @@ -110,14 +110,14 @@ d Result: d SQL: --------------- -.param set @__p_0 'd' +.param set @p 'd' SELECT "d"."Id" FROM "Data" AS "d" WHERE EXISTS ( SELECT 1 FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @__p_0) + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @p) --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET8_0_NET9_0.snap similarity index 92% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET8_0_NET9_0.snap index 8ab6907cc03..c29562a4db0 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET8_0_NET9_0.snap @@ -49,14 +49,14 @@ a Result: a SQL: --------------- -.param set @p 'a' +.param set @__p_0 'a' SELECT "d"."Id" FROM "Data" AS "d" WHERE EXISTS ( SELECT 1 FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @p) + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @__p_0) --------------- d Result: @@ -110,14 +110,14 @@ d Result: d SQL: --------------- -.param set @p 'd' +.param set @__p_0 'd' SELECT "d"."Id" FROM "Data" AS "d" WHERE EXISTS ( SELECT 1 FROM "FooNested" AS "f" - WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @p) + WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" = @__p_0) --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression.snap index 1474f5f43c0..67fa1c8b66d 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression.snap @@ -9,7 +9,7 @@ a Result: a SQL: --------------- -.param set @__p_0 'a' +.param set @p 'a' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" @@ -18,7 +18,7 @@ WHERE EXISTS ( SELECT 1 FROM "Data" AS "d0" INNER JOIN "Foo" AS "f0" ON "d0"."FooId" = "f0"."Id" - WHERE "f"."Id" = "d0"."FooId" AND "f0"."BarString" = @__p_0) + WHERE "f"."Id" = "d0"."FooId" AND "f0"."BarString" = @p) --------------- b Result: @@ -32,7 +32,7 @@ b Result: b SQL: --------------- -.param set @__p_0 'd' +.param set @p 'd' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" @@ -41,7 +41,7 @@ WHERE EXISTS ( SELECT 1 FROM "Data" AS "d0" INNER JOIN "Foo" AS "f0" ON "d0"."FooId" = "f0"."Id" - WHERE "f"."Id" = "d0"."FooId" AND "f0"."BarString" = @__p_0) + WHERE "f"."Id" = "d0"."FooId" AND "f0"."BarString" = @p) --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET8_0_NET9_0.snap similarity index 87% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET8_0_NET9_0.snap index 67fa1c8b66d..1474f5f43c0 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ArrayObjectNestedArraySomeStringEqual_Expression_NET8_0_NET9_0.snap @@ -9,7 +9,7 @@ a Result: a SQL: --------------- -.param set @p 'a' +.param set @__p_0 'a' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" @@ -18,7 +18,7 @@ WHERE EXISTS ( SELECT 1 FROM "Data" AS "d0" INNER JOIN "Foo" AS "f0" ON "d0"."FooId" = "f0"."Id" - WHERE "f"."Id" = "d0"."FooId" AND "f0"."BarString" = @p) + WHERE "f"."Id" = "d0"."FooId" AND "f0"."BarString" = @__p_0) --------------- b Result: @@ -32,7 +32,7 @@ b Result: b SQL: --------------- -.param set @p 'd' +.param set @__p_0 'd' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" @@ -41,7 +41,7 @@ WHERE EXISTS ( SELECT 1 FROM "Data" AS "d0" INNER JOIN "Foo" AS "f0" ON "d0"."FooId" = "f0"."Id" - WHERE "f"."Id" = "d0"."FooId" AND "f0"."BarString" = @p) + WHERE "f"."Id" = "d0"."FooId" AND "f0"."BarString" = @__p_0) --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression.snap index 3369f483965..5071856339a 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression.snap @@ -20,12 +20,12 @@ BAR Result: BAR SQL: --------------- -.param set @__p_0 1 +.param set @p 1 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = @__p_0 +WHERE "f"."BarEnum" = @p --------------- FOO Result: @@ -45,12 +45,12 @@ FOO Result: FOO SQL: --------------- -.param set @__p_0 0 +.param set @p 0 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = @__p_0 +WHERE "f"."BarEnum" = @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression_NET8_0_NET9_0.snap similarity index 92% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression_NET8_0_NET9_0.snap index 5071856339a..3369f483965 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumEqual_Expression_NET8_0_NET9_0.snap @@ -20,12 +20,12 @@ BAR Result: BAR SQL: --------------- -.param set @p 1 +.param set @__p_0 1 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = @p +WHERE "f"."BarEnum" = @__p_0 --------------- FOO Result: @@ -45,12 +45,12 @@ FOO Result: FOO SQL: --------------- -.param set @p 0 +.param set @__p_0 0 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = @p +WHERE "f"."BarEnum" = @__p_0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression.snap index 80992004192..cb4eb7bcddf 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression.snap @@ -25,15 +25,13 @@ BarAndFoo Result: BarAndFoo SQL: --------------- -.param set @__p_0 '[1,0]' +.param set @p1 1 +.param set @p2 0 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "f"."BarEnum" IN (@p1, @p2) --------------- FOO Result: @@ -53,15 +51,12 @@ FOO Result: FOO SQL: --------------- -.param set @__p_0 '[0]' +.param set @p1 0 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "f"."BarEnum" = @p1 --------------- nullAndFoo Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET8_0_NET9_0.snap similarity index 85% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET8_0_NET9_0.snap index cb4eb7bcddf..80992004192 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectEnumIn_Expression_NET8_0_NET9_0.snap @@ -25,13 +25,15 @@ BarAndFoo Result: BarAndFoo SQL: --------------- -.param set @p1 1 -.param set @p2 0 +.param set @__p_0 '[1,0]' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" IN (@p1, @p2) +WHERE "f"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- FOO Result: @@ -51,12 +53,15 @@ FOO Result: FOO SQL: --------------- -.param set @p1 0 +.param set @__p_0 '[0]' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = @p1 +WHERE "f"."BarEnum" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- nullAndFoo Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression.snap index d926087a0f8..a8119069e64 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression.snap @@ -20,12 +20,12 @@ true Result: true SQL: --------------- -.param set @__p_0 1 +.param set @p 1 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarBool" = @__p_0 +WHERE "f"."BarBool" = @p --------------- false Result: @@ -55,12 +55,12 @@ false Result: false SQL: --------------- -.param set @__p_0 0 +.param set @p 0 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarBool" = @__p_0 +WHERE "f"."BarBool" = @p --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression_NET8_0_NET9_0.snap similarity index 92% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression_NET8_0_NET9_0.snap index a8119069e64..d926087a0f8 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableBooleanEqual_Expression_NET8_0_NET9_0.snap @@ -20,12 +20,12 @@ true Result: true SQL: --------------- -.param set @p 1 +.param set @__p_0 1 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarBool" = @p +WHERE "f"."BarBool" = @__p_0 --------------- false Result: @@ -55,12 +55,12 @@ false Result: false SQL: --------------- -.param set @p 0 +.param set @__p_0 0 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarBool" = @p +WHERE "f"."BarBool" = @__p_0 --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression.snap index 19dd8f2cbb0..f2765c76788 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression.snap @@ -20,12 +20,12 @@ BAR Result: BAR SQL: --------------- -.param set @__p_0 1 +.param set @p 1 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = @__p_0 +WHERE "f"."BarEnum" = @p --------------- FOO Result: @@ -45,12 +45,12 @@ FOO Result: FOO SQL: --------------- -.param set @__p_0 0 +.param set @p 0 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = @__p_0 +WHERE "f"."BarEnum" = @p --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression_NET8_0_NET9_0.snap similarity index 90% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression_NET8_0_NET9_0.snap index f2765c76788..19dd8f2cbb0 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumEqual_Expression_NET8_0_NET9_0.snap @@ -20,12 +20,12 @@ BAR Result: BAR SQL: --------------- -.param set @p 1 +.param set @__p_0 1 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = @p +WHERE "f"."BarEnum" = @__p_0 --------------- FOO Result: @@ -45,12 +45,12 @@ FOO Result: FOO SQL: --------------- -.param set @p 0 +.param set @__p_0 0 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarEnum" = @p +WHERE "f"."BarEnum" = @__p_0 --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET11_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET11_0.snap new file mode 100644 index 00000000000..80b7405fafd --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET11_0.snap @@ -0,0 +1,85 @@ +BarAndFoo Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barEnum": "BAR" + } + }, + { + "foo": { + "barEnum": "BAR" + } + }, + { + "foo": { + "barEnum": "FOO" + } + } + ] + } +} +--------------- + +BarAndFoo SQL: +--------------- +.param set @p1 1 +.param set @p2 0 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" IN (@p1, @p2) +--------------- + +FOO Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barEnum": "FOO" + } + } + ] + } +} +--------------- + +FOO SQL: +--------------- +.param set @p1 0 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" = @p1 +--------------- + +nullAndFoo Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barEnum": "FOO" + } + } + ] + } +} +--------------- + +nullAndFoo SQL: +--------------- +.param set @p1 0 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarEnum" IS NULL OR "f"."BarEnum" = @p1 +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression.snap index f9fa821e049..e250bf97941 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression.snap @@ -20,12 +20,12 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" = @__p_0 +WHERE "f"."BarShort" = @p --------------- 13 Result: @@ -45,12 +45,12 @@ WHERE "f"."BarShort" = @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" = @__p_0 +WHERE "f"."BarShort" = @p --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression_NET8_0_NET9_0.snap similarity index 91% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression_NET8_0_NET9_0.snap index e250bf97941..f9fa821e049 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortEqual_Expression_NET8_0_NET9_0.snap @@ -20,12 +20,12 @@ 12 SQL: --------------- -.param set @p 12 +.param set @__p_0 12 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" = @p +WHERE "f"."BarShort" = @__p_0 --------------- 13 Result: @@ -45,12 +45,12 @@ WHERE "f"."BarShort" = @p 13 SQL: --------------- -.param set @p 13 +.param set @__p_0 13 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" = @p +WHERE "f"."BarShort" = @__p_0 --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET11_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET11_0.snap new file mode 100644 index 00000000000..23906540d03 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET11_0.snap @@ -0,0 +1,106 @@ +12and13 Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": 12 + } + }, + { + "foo": { + "barShort": 12 + } + }, + { + "foo": { + "barShort": 13 + } + } + ] + } +} +--------------- + +12and13 SQL: +--------------- +.param set @p1 12 +.param set @p2 13 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" IN (@p1, @p2) +--------------- + +13and14 Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": 14 + } + }, + { + "foo": { + "barShort": 14 + } + }, + { + "foo": { + "barShort": 13 + } + } + ] + } +} +--------------- + +13and14 SQL: +--------------- +.param set @p1 13 +.param set @p2 14 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" IN (@p1, @p2) +--------------- + +13andNull Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barShort": null + } + }, + { + "foo": { + "barShort": null + } + }, + { + "foo": { + "barShort": 13 + } + } + ] + } +} +--------------- + +13andNull SQL: +--------------- +.param set @p1 13 + +SELECT "d"."Id", "d"."FooId" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +WHERE "f"."BarShort" IS NULL OR "f"."BarShort" = @p1 +--------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression.snap index bfa7f565a8d..c8b5e0e6aac 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression.snap @@ -20,12 +20,12 @@ 12 SQL: --------------- -.param set @__p_0 12 +.param set @p 12 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" = @__p_0 +WHERE "f"."BarShort" = @p --------------- 13 Result: @@ -45,12 +45,12 @@ WHERE "f"."BarShort" = @__p_0 13 SQL: --------------- -.param set @__p_0 13 +.param set @p 13 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" = @__p_0 +WHERE "f"."BarShort" = @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression_NET8_0_NET9_0.snap similarity index 91% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression_NET8_0_NET9_0.snap index c8b5e0e6aac..bfa7f565a8d 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortEqual_Expression_NET8_0_NET9_0.snap @@ -20,12 +20,12 @@ 12 SQL: --------------- -.param set @p 12 +.param set @__p_0 12 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" = @p +WHERE "f"."BarShort" = @__p_0 --------------- 13 Result: @@ -45,12 +45,12 @@ WHERE "f"."BarShort" = @p 13 SQL: --------------- -.param set @p 13 +.param set @__p_0 13 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" = @p +WHERE "f"."BarShort" = @__p_0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression.snap index 9e5609e3733..19610fc49f5 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression.snap @@ -25,15 +25,13 @@ 12and13 SQL: --------------- -.param set @__p_0 '[12,13]' +.param set @p1 12 +.param set @p2 13 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "f"."BarShort" IN (@p1, @p2) --------------- 13and14 Result: @@ -63,15 +61,13 @@ WHERE "f"."BarShort" IN ( 13and14 SQL: --------------- -.param set @__p_0 '[13,14]' +.param set @p1 13 +.param set @p2 14 SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "f"."BarShort" IN (@p1, @p2) --------------- nullAnd14 diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET8_0_NET9_0.snap similarity index 86% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET8_0_NET9_0.snap index 19610fc49f5..9e5609e3733 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectShortIn_Expression_NET8_0_NET9_0.snap @@ -25,13 +25,15 @@ 12and13 SQL: --------------- -.param set @p1 12 -.param set @p2 13 +.param set @__p_0 '[12,13]' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" IN (@p1, @p2) +WHERE "f"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- 13and14 Result: @@ -61,13 +63,15 @@ WHERE "f"."BarShort" IN (@p1, @p2) 13and14 SQL: --------------- -.param set @p1 13 -.param set @p2 14 +.param set @__p_0 '[13,14]' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarShort" IN (@p1, @p2) +WHERE "f"."BarShort" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- nullAnd14 diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression.snap index e9902a99e08..0b6a2b661c1 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression.snap @@ -20,12 +20,12 @@ testatest Result: testatest SQL: --------------- -.param set @__p_0 'testatest' +.param set @p 'testatest' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" = @__p_0 +WHERE "f"."BarString" = @p --------------- testbtest Result: @@ -50,12 +50,12 @@ testbtest Result: testbtest SQL: --------------- -.param set @__p_0 'testbtest' +.param set @p 'testbtest' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" = @__p_0 +WHERE "f"."BarString" = @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression_NET8_0_NET9_0.snap similarity index 91% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression_NET8_0_NET9_0.snap index 0b6a2b661c1..e9902a99e08 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Expression_NET8_0_NET9_0.snap @@ -20,12 +20,12 @@ testatest Result: testatest SQL: --------------- -.param set @p 'testatest' +.param set @__p_0 'testatest' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" = @p +WHERE "f"."BarString" = @__p_0 --------------- testbtest Result: @@ -50,12 +50,12 @@ testbtest Result: testbtest SQL: --------------- -.param set @p 'testbtest' +.param set @__p_0 'testbtest' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" = @p +WHERE "f"."BarString" = @__p_0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened.snap index a30aaf90887..31e0af75765 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened.snap @@ -20,12 +20,12 @@ testatest Result: testatest SQL: --------------- -.param set @__p_0 'testatest' +.param set @p 'testatest' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" = @__p_0 +WHERE "f"."BarString" = @p --------------- testbtest Result: @@ -50,12 +50,12 @@ testbtest Result: testbtest SQL: --------------- -.param set @__p_0 'testbtest' +.param set @p 'testbtest' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" = @__p_0 +WHERE "f"."BarString" = @p --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened_NET8_0_NET9_0.snap similarity index 89% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened_NET8_0_NET9_0.snap index 31e0af75765..a30aaf90887 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEqual_Flattened_NET8_0_NET9_0.snap @@ -20,12 +20,12 @@ testatest Result: testatest SQL: --------------- -.param set @p 'testatest' +.param set @__p_0 'testatest' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" = @p +WHERE "f"."BarString" = @__p_0 --------------- testbtest Result: @@ -50,12 +50,12 @@ testbtest Result: testbtest SQL: --------------- -.param set @p 'testbtest' +.param set @__p_0 'testbtest' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" = @p +WHERE "f"."BarString" = @__p_0 --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened.snap index 016bb0dd8e4..7a9d431d8b1 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened.snap @@ -17,13 +17,13 @@ testatest Result: testatest SQL: --------------- -.param set @__p_0 'testatest' +.param set @p 'testatest' SELECT "d"."Id", "d"."BarId" FROM "Data" AS "d" INNER JOIN "Bar" AS "b" ON "d"."BarId" = "b"."Id" INNER JOIN "Foo" AS "f" ON "b"."FooId" = "f"."Id" -WHERE "f"."BarString" = @__p_0 +WHERE "f"."BarString" = @p --------------- testbtest Result: @@ -45,13 +45,13 @@ testbtest Result: testbtest SQL: --------------- -.param set @__p_0 'testbtest' +.param set @p 'testbtest' SELECT "d"."Id", "d"."BarId" FROM "Data" AS "d" INNER JOIN "Bar" AS "b" ON "d"."BarId" = "b"."Id" INNER JOIN "Foo" AS "f" ON "b"."FooId" = "f"."Id" -WHERE "f"."BarString" = @__p_0 +WHERE "f"."BarString" = @p --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened_NET8_0_NET9_0.snap similarity index 89% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened_NET8_0_NET9_0.snap index 7a9d431d8b1..016bb0dd8e4 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringEquals_Related_Flattened_NET8_0_NET9_0.snap @@ -17,13 +17,13 @@ testatest Result: testatest SQL: --------------- -.param set @p 'testatest' +.param set @__p_0 'testatest' SELECT "d"."Id", "d"."BarId" FROM "Data" AS "d" INNER JOIN "Bar" AS "b" ON "d"."BarId" = "b"."Id" INNER JOIN "Foo" AS "f" ON "b"."FooId" = "f"."Id" -WHERE "f"."BarString" = @p +WHERE "f"."BarString" = @__p_0 --------------- testbtest Result: @@ -45,13 +45,13 @@ testbtest Result: testbtest SQL: --------------- -.param set @p 'testbtest' +.param set @__p_0 'testbtest' SELECT "d"."Id", "d"."BarId" FROM "Data" AS "d" INNER JOIN "Bar" AS "b" ON "d"."BarId" = "b"."Id" INNER JOIN "Foo" AS "f" ON "b"."FooId" = "f"."Id" -WHERE "f"."BarString" = @p +WHERE "f"."BarString" = @__p_0 --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression.snap index 15c6c31d2b8..444587d84f3 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression.snap @@ -30,15 +30,13 @@ testatestAndtestb Result: testatestAndtestb SQL: --------------- -.param set @__p_0 '["testatest","testbtest"]' +.param set @p1 'testatest' +.param set @p2 'testbtest' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "f"."BarString" IN (@p1, @p2) --------------- testbtestAndNull @@ -91,13 +89,10 @@ testatest Result: testatest SQL: --------------- -.param set @__p_0 '["testatest"]' +.param set @p1 'testatest' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "f"."BarString" = @p1 --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET8_0_NET9_0.snap similarity index 85% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET8_0_NET9_0.snap index 444587d84f3..15c6c31d2b8 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectStringIn_Expression_NET8_0_NET9_0.snap @@ -30,13 +30,15 @@ testatestAndtestb Result: testatestAndtestb SQL: --------------- -.param set @p1 'testatest' -.param set @p2 'testbtest' +.param set @__p_0 '["testatest","testbtest"]' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" IN (@p1, @p2) +WHERE "f"."BarString" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- testbtestAndNull @@ -89,10 +91,13 @@ testatest Result: testatest SQL: --------------- -.param set @p1 'testatest' +.param set @__p_0 '["testatest"]' SELECT "d"."Id", "d"."FooId" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" -WHERE "f"."BarString" = @p1 +WHERE "f"."BarString" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression.snap index 65b8d3c118b..a0ace3f2075 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression.snap @@ -13,11 +13,11 @@ a Result: a SQL: --------------- -.param set @__p_0 'a' +.param set @p 'a' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND instr("d"."Bar", @__p_0) > 0 +WHERE "d"."Bar" IS NOT NULL AND instr("d"."Bar", @p) > 0 --------------- b Result: @@ -35,11 +35,11 @@ b Result: b SQL: --------------- -.param set @__p_0 'b' +.param set @p 'b' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND instr("d"."Bar", @__p_0) > 0 +WHERE "d"."Bar" IS NOT NULL AND instr("d"."Bar", @p) > 0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET8_0_NET9_0.snap similarity index 85% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET8_0_NET9_0.snap index a0ace3f2075..65b8d3c118b 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET8_0_NET9_0.snap @@ -13,11 +13,11 @@ a Result: a SQL: --------------- -.param set @p 'a' +.param set @__p_0 'a' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND instr("d"."Bar", @p) > 0 +WHERE "d"."Bar" IS NOT NULL AND instr("d"."Bar", @__p_0) > 0 --------------- b Result: @@ -35,11 +35,11 @@ b Result: b SQL: --------------- -.param set @p 'b' +.param set @__p_0 'b' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND instr("d"."Bar", @p) > 0 +WHERE "d"."Bar" IS NOT NULL AND instr("d"."Bar", @__p_0) > 0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET9_0.snap deleted file mode 100644 index 1b1d2c51906..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET9_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -atest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -atest SQL: ---------------- -.param set @__p_0_endswith '%atest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND "d"."Bar" LIKE @__p_0_endswith ESCAPE '\' ---------------- - -btest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -btest SQL: ---------------- -.param set @__p_0_endswith '%btest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND "d"."Bar" LIKE @__p_0_endswith ESCAPE '\' ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `endsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 34 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression.snap index 9729777a87f..5614588b332 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression.snap @@ -13,11 +13,11 @@ testatest Result: testatest SQL: --------------- -.param set @__p_0 'testatest' +.param set @p 'testatest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @__p_0 +WHERE "d"."Bar" = @p --------------- testbtest Result: @@ -35,11 +35,11 @@ testbtest Result: testbtest SQL: --------------- -.param set @__p_0 'testbtest' +.param set @p 'testbtest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @__p_0 +WHERE "d"."Bar" = @p --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression_NET8_0_NET9_0.snap similarity index 86% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression_NET8_0_NET9_0.snap index 5614588b332..9729777a87f 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEqual_Expression_NET8_0_NET9_0.snap @@ -13,11 +13,11 @@ testatest Result: testatest SQL: --------------- -.param set @p 'testatest' +.param set @__p_0 'testatest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @p +WHERE "d"."Bar" = @__p_0 --------------- testbtest Result: @@ -35,11 +35,11 @@ testbtest Result: testbtest SQL: --------------- -.param set @p 'testbtest' +.param set @__p_0 'testbtest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @p +WHERE "d"."Bar" = @__p_0 --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET9_0.snap deleted file mode 100644 index 9059a2331b1..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET9_0.snap +++ /dev/null @@ -1,80 +0,0 @@ -testatestAndtestb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": "testbtest" - } - ] - } -} ---------------- - -testatestAndtestb SQL: ---------------- -.param set @__p_0 '["testatest","testbtest"]' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) ---------------- - -testbtestAndNull Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testbtestAndNull SQL: ---------------- -.param set @__p_0_without_nulls '["testbtest"]' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IN ( - SELECT "p"."value" - FROM json_each(@__p_0_without_nulls) AS "p" -) OR "d"."Bar" IS NULL ---------------- - -testatest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -testatest SQL: ---------------- -.param set @__p_0 '["testatest"]' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET9_0.snap deleted file mode 100644 index 96e427a0820..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET9_0.snap +++ /dev/null @@ -1,77 +0,0 @@ -atest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - }, - { - "bar": null - } - ] - } -} ---------------- - -atest SQL: ---------------- -.param set @__p_0_endswith '%atest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NULL OR "d"."Bar" NOT LIKE @__p_0_endswith ESCAPE '\' ---------------- - -btest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": null - } - ] - } -} ---------------- - -btest SQL: ---------------- -.param set @__p_0_endswith '%btest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NULL OR "d"."Bar" NOT LIKE @__p_0_endswith ESCAPE '\' ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `nendsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 35 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression.snap index 53b3004c365..59770b8a362 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression.snap @@ -16,11 +16,11 @@ testatest Result: testatest SQL: --------------- -.param set @__p_0 'testatest' +.param set @p 'testatest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> @__p_0 OR "d"."Bar" IS NULL +WHERE "d"."Bar" <> @p OR "d"."Bar" IS NULL --------------- testbtest Result: @@ -41,11 +41,11 @@ testbtest Result: testbtest SQL: --------------- -.param set @__p_0 'testbtest' +.param set @p 'testbtest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> @__p_0 OR "d"."Bar" IS NULL +WHERE "d"."Bar" <> @p OR "d"."Bar" IS NULL --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET8_0_NET9_0.snap similarity index 84% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET8_0_NET9_0.snap index 59770b8a362..53b3004c365 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET8_0_NET9_0.snap @@ -16,11 +16,11 @@ testatest Result: testatest SQL: --------------- -.param set @p 'testatest' +.param set @__p_0 'testatest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> @p OR "d"."Bar" IS NULL +WHERE "d"."Bar" <> @__p_0 OR "d"."Bar" IS NULL --------------- testbtest Result: @@ -41,11 +41,11 @@ testbtest Result: testbtest SQL: --------------- -.param set @p 'testbtest' +.param set @__p_0 'testbtest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> @p OR "d"."Bar" IS NULL +WHERE "d"."Bar" <> @__p_0 OR "d"."Bar" IS NULL --------------- null Result: diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET9_0.snap deleted file mode 100644 index ffa93543cda..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET9_0.snap +++ /dev/null @@ -1,77 +0,0 @@ -testatestAndtestb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": null - } - ] - } -} ---------------- - -testatestAndtestb SQL: ---------------- -.param set @__p_0 '["testatest","testbtest"]' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) OR "d"."Bar" IS NULL ---------------- - -testbtestAndNull Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -testbtestAndNull SQL: ---------------- -.param set @__p_0_without_nulls '["testbtest"]' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0_without_nulls) AS "p" -) AND "d"."Bar" IS NOT NULL ---------------- - -testatest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testatest SQL: ---------------- -.param set @__p_0 '["testatest"]' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) OR "d"."Bar" IS NULL ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET9_0.snap deleted file mode 100644 index 77a754414f2..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET9_0.snap +++ /dev/null @@ -1,77 +0,0 @@ -testa Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testa SQL: ---------------- -.param set @__p_0_startswith 'testa%' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NULL OR "d"."Bar" NOT LIKE @__p_0_startswith ESCAPE '\' ---------------- - -testb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - }, - { - "bar": null - } - ] - } -} ---------------- - -testb SQL: ---------------- -.param set @__p_0_startswith 'testb%' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NULL OR "d"."Bar" NOT LIKE @__p_0_startswith ESCAPE '\' ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `nstartsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 37 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET9_0.snap deleted file mode 100644 index ef3b1890a74..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET9_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -testa Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -testa SQL: ---------------- -.param set @__p_0_startswith 'testa%' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND "d"."Bar" LIKE @__p_0_startswith ESCAPE '\' ---------------- - -testb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -testb SQL: ---------------- -.param set @__p_0_startswith 'testb%' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" IS NOT NULL AND "d"."Bar" LIKE @__p_0_startswith ESCAPE '\' ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `startsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 36 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression.snap index 06a53f9909b..bcacc6b82ed 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression.snap @@ -13,11 +13,11 @@ a Result: a SQL: --------------- -.param set @__p_0 'a' +.param set @p 'a' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE instr("d"."Bar", @__p_0) > 0 +WHERE instr("d"."Bar", @p) > 0 --------------- b Result: @@ -35,11 +35,11 @@ b Result: b SQL: --------------- -.param set @__p_0 'b' +.param set @p 'b' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE instr("d"."Bar", @__p_0) > 0 +WHERE instr("d"."Bar", @p) > 0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET8_0_NET9_0.snap similarity index 89% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET8_0_NET9_0.snap index bcacc6b82ed..06a53f9909b 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringContains_Expression_NET8_0_NET9_0.snap @@ -13,11 +13,11 @@ a Result: a SQL: --------------- -.param set @p 'a' +.param set @__p_0 'a' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE instr("d"."Bar", @p) > 0 +WHERE instr("d"."Bar", @__p_0) > 0 --------------- b Result: @@ -35,11 +35,11 @@ b Result: b SQL: --------------- -.param set @p 'b' +.param set @__p_0 'b' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE instr("d"."Bar", @p) > 0 +WHERE instr("d"."Bar", @__p_0) > 0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET9_0.snap deleted file mode 100644 index bdf5a199f37..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEndsWith_Expression_NET9_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -atest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -atest SQL: ---------------- -.param set @__p_0_endswith '%atest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" LIKE @__p_0_endswith ESCAPE '\' ---------------- - -btest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -btest SQL: ---------------- -.param set @__p_0_endswith '%btest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" LIKE @__p_0_endswith ESCAPE '\' ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `endsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 34 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression.snap index d7944d2311b..30a4100fe0e 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression.snap @@ -13,11 +13,11 @@ testatest Result: testatest SQL: --------------- -.param set @__p_0 'testatest' +.param set @p 'testatest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @__p_0 +WHERE "d"."Bar" = @p --------------- testbtest Result: @@ -35,11 +35,11 @@ testbtest Result: testbtest SQL: --------------- -.param set @__p_0 'testbtest' +.param set @p 'testbtest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @__p_0 +WHERE "d"."Bar" = @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression_NET8_0_NET9_0.snap similarity index 89% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression_NET8_0_NET9_0.snap index 30a4100fe0e..d7944d2311b 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringEqual_Expression_NET8_0_NET9_0.snap @@ -13,11 +13,11 @@ testatest Result: testatest SQL: --------------- -.param set @p 'testatest' +.param set @__p_0 'testatest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @p +WHERE "d"."Bar" = @__p_0 --------------- testbtest Result: @@ -35,11 +35,11 @@ testbtest Result: testbtest SQL: --------------- -.param set @p 'testbtest' +.param set @__p_0 'testbtest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @p +WHERE "d"."Bar" = @__p_0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression.snap index ea83f18bfb9..82855f7cd00 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression.snap @@ -16,14 +16,12 @@ testatestAndtestb Result: testatestAndtestb SQL: --------------- -.param set @__p_0 '["testatest","testbtest"]' +.param set @p1 'testatest' +.param set @p2 'testbtest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "d"."Bar" IN (@p1, @p2) --------------- testbtestAndNull @@ -69,12 +67,9 @@ testatest Result: testatest SQL: --------------- -.param set @__p_0 '["testatest"]' +.param set @p1 'testatest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) +WHERE "d"."Bar" = @p1 --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET8_0_NET9_0.snap similarity index 81% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET8_0_NET9_0.snap index 82855f7cd00..ea83f18bfb9 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringIn_Expression_NET8_0_NET9_0.snap @@ -16,12 +16,14 @@ testatestAndtestb Result: testatestAndtestb SQL: --------------- -.param set @p1 'testatest' -.param set @p2 'testbtest' +.param set @__p_0 '["testatest","testbtest"]' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" IN (@p1, @p2) +WHERE "d"."Bar" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- testbtestAndNull @@ -67,9 +69,12 @@ testatest Result: testatest SQL: --------------- -.param set @p1 'testatest' +.param set @__p_0 '["testatest"]' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" = @p1 +WHERE "d"."Bar" IN ( + SELECT "p"."value" + FROM json_each(@__p_0) AS "p" +) --------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNoContains_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET9_0.snap deleted file mode 100644 index d9d444861dd..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEndsWith_Expression_NET9_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -atest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -atest SQL: ---------------- -.param set @__p_0_endswith '%atest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" NOT LIKE @__p_0_endswith ESCAPE '\' ---------------- - -btest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -btest SQL: ---------------- -.param set @__p_0_endswith '%btest' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" NOT LIKE @__p_0_endswith ESCAPE '\' ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `nendsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 35 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression.snap index c7eb9403233..546ed5e6b5f 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression.snap @@ -13,11 +13,11 @@ testatest Result: testatest SQL: --------------- -.param set @__p_0 'testatest' +.param set @p 'testatest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> @__p_0 +WHERE "d"."Bar" <> @p --------------- testbtest Result: @@ -35,11 +35,11 @@ testbtest Result: testbtest SQL: --------------- -.param set @__p_0 'testbtest' +.param set @p 'testbtest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> @__p_0 +WHERE "d"."Bar" <> @p --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression_NET8_0_NET9_0.snap similarity index 89% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression_NET8_0_NET9_0.snap index 546ed5e6b5f..c7eb9403233 100644 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotEqual_Expression_NET8_0_NET9_0.snap @@ -13,11 +13,11 @@ testatest Result: testatest SQL: --------------- -.param set @p 'testatest' +.param set @__p_0 'testatest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> @p +WHERE "d"."Bar" <> @__p_0 --------------- testbtest Result: @@ -35,11 +35,11 @@ testbtest Result: testbtest SQL: --------------- -.param set @p 'testbtest' +.param set @__p_0 'testbtest' SELECT "d"."Id", "d"."Bar" FROM "Data" AS "d" -WHERE "d"."Bar" <> @p +WHERE "d"."Bar" <> @__p_0 --------------- null diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET9_0.snap deleted file mode 100644 index 43523d406a8..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotIn_Expression_NET9_0.snap +++ /dev/null @@ -1,73 +0,0 @@ -testatestAndtestb Result: ---------------- -{ - "data": { - "root": [] - } -} ---------------- - -testatestAndtestb SQL: ---------------- -.param set @__p_0 '["testatest","testbtest"]' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) ---------------- - -testbtestAndNull ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `nin` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 29 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "[String!]", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- - -testatest Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -testatest SQL: ---------------- -.param set @__p_0 '["testatest"]' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" NOT IN ( - SELECT "p"."value" - FROM json_each(@__p_0) AS "p" -) ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET9_0.snap deleted file mode 100644 index 058fd6ff261..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringNotStartsWith_Expression_NET9_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -testa Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -testa SQL: ---------------- -.param set @__p_0_startswith 'testa%' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" NOT LIKE @__p_0_startswith ESCAPE '\' ---------------- - -testb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -testb SQL: ---------------- -.param set @__p_0_startswith 'testb%' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" NOT LIKE @__p_0_startswith ESCAPE '\' ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `nstartsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 37 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET10_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET8_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET8_0_NET9_0.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET8_0.snap rename to src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET8_0_NET9_0.snap diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET9_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET9_0.snap deleted file mode 100644 index 3a8dc9fdd38..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_StringStartsWith_Expression_NET9_0.snap +++ /dev/null @@ -1,71 +0,0 @@ -testa Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testatest" - } - ] - } -} ---------------- - -testa SQL: ---------------- -.param set @__p_0_startswith 'testa%' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" LIKE @__p_0_startswith ESCAPE '\' ---------------- - -testb Result: ---------------- -{ - "data": { - "root": [ - { - "bar": "testbtest" - } - ] - } -} ---------------- - -testb SQL: ---------------- -.param set @__p_0_startswith 'testb%' - -SELECT "d"."Id", "d"."Bar" -FROM "Data" AS "d" -WHERE "d"."Bar" LIKE @__p_0_startswith ESCAPE '\' ---------------- - -null ---------------- -{ - "errors": [ - { - "message": "The provided value for filter `startsWith` of type StringOperationFilterInput is invalid. Null values are not supported.", - "locations": [ - { - "line": 1, - "column": 36 - } - ], - "path": [ - "root" - ], - "extensions": { - "code": "HC0026", - "expectedType": "String!", - "filterType": "StringOperationFilterInput" - } - } - ], - "data": { - "root": null - } -} ---------------- diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/DataLoaderTests.cs b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/DataLoaderTests.cs index 310e3a6cf75..6d5d1f8af4d 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/DataLoaderTests.cs +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/DataLoaderTests.cs @@ -7,6 +7,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Squadron; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data; @@ -36,7 +37,7 @@ public async Task Include_On_List_Results() // assert Assert.Equal(10, products.Count); - interceptor.MatchSnapshot(); + interceptor.MatchSnapshot(Postfix([NET8_0, NET9_0])); } [Fact] @@ -62,7 +63,7 @@ public async Task Include_On_Array_Results() // assert Assert.Equal(10, products.Length); - interceptor.MatchSnapshot(); + interceptor.MatchSnapshot(Postfix([NET8_0, NET9_0])); } [Fact] @@ -89,7 +90,7 @@ public async Task Include_On_Page_Results() // assert Assert.Equal(5, products.Count); - interceptor.MatchSnapshot(); + interceptor.MatchSnapshot(Postfix([NET8_0], [NET9_0])); } private ServiceProvider CreateServer() @@ -125,9 +126,10 @@ private ServiceProvider CreateServer() file static class Extensions { public static void MatchSnapshot( - this TestQueryInterceptor queryInterceptor) + this TestQueryInterceptor queryInterceptor, + string? postfix) { - var snapshot = Snapshot.Create(postFix: TestEnvironment.TargetFramework); + var snapshot = Snapshot.Create(postfix); for (var i = 0; i < queryInterceptor.Queries.Count; i++) { diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/IgnoredObjectFieldIntegrationTests.cs b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/IgnoredObjectFieldIntegrationTests.cs index e3ec3f5e1bc..7e7fe5e390a 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/IgnoredObjectFieldIntegrationTests.cs +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/IgnoredObjectFieldIntegrationTests.cs @@ -10,6 +10,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Squadron; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data; @@ -66,7 +67,7 @@ public async Task Sort_Query_Should_Work_When_ObjectType_Ignores_Field() interceptor.Queries, query => query.Contains("\"Name\"", StringComparison.Ordinal)); - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0, NET9_0])); } [Fact] @@ -119,7 +120,7 @@ public async Task Filter_Query_Should_Work_When_ObjectType_Ignores_Field() interceptor.Queries, query => query.Contains("\"Name\"", StringComparison.Ordinal)); - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0, NET9_0], [NET10_0])); } private static ServiceProvider CreateServer(string connectionString) @@ -150,9 +151,10 @@ private static ServiceProvider CreateServer(string connectionString) private static void MatchSnapshot( IExecutionResult result, - TestQueryInterceptor queryInterceptor) + TestQueryInterceptor queryInterceptor, + string? postfix) { - var snapshot = Snapshot.Create(postFix: TestEnvironment.TargetFramework); + var snapshot = Snapshot.Create(postfix); snapshot.Add(result.ToJson(), "Result", MarkdownLanguages.Json); diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/IntegrationTests.cs b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/IntegrationTests.cs index 8da69527036..d3d3687f2a5 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/IntegrationTests.cs +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/IntegrationTests.cs @@ -15,6 +15,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Text.RegularExpressions; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data; @@ -53,7 +54,7 @@ public async Task Query_Brands() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0, NET9_0])); } [Fact] @@ -76,7 +77,7 @@ public async Task Query_Brands_First_2() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0, NET9_0])); } [Fact] @@ -105,7 +106,7 @@ public async Task Query_Brands_First_2_And_Products_First_2() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0], [NET9_0])); } [Fact] @@ -129,7 +130,7 @@ public async Task Query_Brands_With_BatchResolver_ProductCount() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0, NET9_0])); } [Fact] @@ -156,7 +157,7 @@ public async Task Query_Brands_With_BatchResolver_Supplier() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0, NET9_0])); } [Fact] @@ -185,7 +186,7 @@ public async Task Query_Brands_First_2_And_Products_First_2_Name_Desc() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0], [NET9_0])); } [Fact] @@ -216,7 +217,7 @@ public async Task Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0], [NET9_0])); } [Fact] @@ -239,7 +240,7 @@ ... on Product { """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0, NET9_0])); } [Fact] @@ -262,7 +263,7 @@ ... on Brand { """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0, NET9_0])); } [Fact] @@ -287,7 +288,7 @@ public async Task Query_Products_First_2_And_Brand() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0, NET9_0])); } [Fact] @@ -310,7 +311,7 @@ public async Task Project_Into_1to1_Relation() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0], [NET9_0])); } [Fact] @@ -337,7 +338,7 @@ public async Task Query_Products_First_2_With_4_EndCursors() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0], [NET9_0])); } [Fact] @@ -364,7 +365,7 @@ public async Task Query_Products_First_2_With_4_EndCursors_Skip_4() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0, NET9_0], [NET10_0])); } [Fact] @@ -394,7 +395,7 @@ public async Task Query_Brands_First_2_Products_First_2_ForwardCursors() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0], [NET9_0])); } [Fact] @@ -420,7 +421,7 @@ public async Task Verify_That_PageInfo_Flag_Is_Correctly_Inferred() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0, NET9_0])); } [Fact] @@ -444,7 +445,7 @@ public async Task Query_Products_Include_TotalCount() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0], [NET9_0])); } [Fact] @@ -467,7 +468,7 @@ public async Task Query_Products_Exclude_TotalCount() """); // assert - MatchSnapshot(result, interceptor); + MatchSnapshot(result, interceptor, Postfix([NET8_0, NET9_0])); } [Fact] @@ -786,9 +787,10 @@ private async Task ExecuteAsync(string sourceText) private static void MatchSnapshot( IExecutionResult result, - TestQueryInterceptor queryInterceptor) + TestQueryInterceptor queryInterceptor, + string? postfix = null) { - var snapshot = Snapshot.Create(postFix: TestEnvironment.TargetFramework); + var snapshot = Snapshot.Create(postfix); var queries = NormalizeBrandLookupBatching(queryInterceptor.Queries); snapshot.Add(result.ToJson(), "Result", MarkdownLanguages.Json); diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET9_0.md deleted file mode 100644 index 33964c97293..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Array_Results_NET9_0.md +++ /dev/null @@ -1,9 +0,0 @@ -# Include_On_Array_Results - -```sql --- @__brandIds_0={ '1' } (DbType = Object) -SELECT p."BrandId", p."Name", p."Price" -FROM "Products" AS p -WHERE p."BrandId" = ANY (@__brandIds_0) -ORDER BY p."BrandId" -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET9_0.md deleted file mode 100644 index fbdb8d3c7c6..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_List_Results_NET9_0.md +++ /dev/null @@ -1,9 +0,0 @@ -# Include_On_List_Results - -```sql --- @__brandIds_0={ '1' } (DbType = Object) -SELECT p."BrandId", p."Name", p."Price" -FROM "Products" AS p -WHERE p."BrandId" = ANY (@__brandIds_0) -ORDER BY p."BrandId" -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/DataLoaderTests.Include_On_Page_Results.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Filter_Query_Should_Work_When_ObjectType_Ignores_Field_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Filter_Query_Should_Work_When_ObjectType_Ignores_Field.md similarity index 81% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Filter_Query_Should_Work_When_ObjectType_Ignores_Field_NET9_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Filter_Query_Should_Work_When_ObjectType_Ignores_Field.md index 13e30f21485..5fbd9e2e6a6 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Filter_Query_Should_Work_When_ObjectType_Ignores_Field_NET9_0.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Filter_Query_Should_Work_When_ObjectType_Ignores_Field.md @@ -19,11 +19,11 @@ ## Query 1 ```sql --- @__p_0='1' --- @__p_1='11' +-- @p='1' +-- @p1='11' SELECT p."Id" FROM "ProductTypes" AS p -WHERE p."Id" = @__p_0 +WHERE p."Id" = @p ORDER BY p."Id" -LIMIT @__p_1 +LIMIT @p1 ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Filter_Query_Should_Work_When_ObjectType_Ignores_Field_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Filter_Query_Should_Work_When_ObjectType_Ignores_Field_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Filter_Query_Should_Work_When_ObjectType_Ignores_Field_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Filter_Query_Should_Work_When_ObjectType_Ignores_Field_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Sort_Query_Should_Work_When_ObjectType_Ignores_Field_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Sort_Query_Should_Work_When_ObjectType_Ignores_Field.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Sort_Query_Should_Work_When_ObjectType_Ignores_Field_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Sort_Query_Should_Work_When_ObjectType_Ignores_Field.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Sort_Query_Should_Work_When_ObjectType_Ignores_Field_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Sort_Query_Should_Work_When_ObjectType_Ignores_Field_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Sort_Query_Should_Work_When_ObjectType_Ignores_Field_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Sort_Query_Should_Work_When_ObjectType_Ignores_Field_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Sort_Query_Should_Work_When_ObjectType_Ignores_Field_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Sort_Query_Should_Work_When_ObjectType_Ignores_Field_NET9_0.md deleted file mode 100644 index 20e3d3ae6f7..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IgnoredObjectFieldIntegrationTests.Sort_Query_Should_Work_When_ObjectType_Ignores_Field_NET9_0.md +++ /dev/null @@ -1,48 +0,0 @@ -# Sort_Query_Should_Work_When_ObjectType_Ignores_Field - -## Result - -```json -{ - "data": { - "hiddenNameProductTypes": { - "nodes": [ - { - "id": 8 - }, - { - "id": 7 - }, - { - "id": 6 - }, - { - "id": 5 - }, - { - "id": 4 - }, - { - "id": 3 - }, - { - "id": 2 - }, - { - "id": 1 - } - ] - } - } -} -``` - -## Query 1 - -```sql --- @__p_0='11' -SELECT p."Id" -FROM "ProductTypes" AS p -ORDER BY p."Id" DESC -LIMIT @__p_0 -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET8_0.md deleted file mode 100644 index 3ff19837d04..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET8_0.md +++ /dev/null @@ -1,25 +0,0 @@ -# Ensure_That_Self_Requirement_Is_Honored - -## Result - -```json -{ - "data": { - "singleProperties": [ - { - "id": "0" - }, - { - "id": "1" - } - ] - } -} -``` - -## Query 1 - -```sql -SELECT s."Id" -FROM "SingleProperties" AS s -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET9_0.md deleted file mode 100644 index 3ff19837d04..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Ensure_That_Self_Requirement_Is_Honored_NET9_0.md +++ /dev/null @@ -1,25 +0,0 @@ -# Ensure_That_Self_Requirement_Is_Honored - -## Result - -```json -{ - "data": { - "singleProperties": [ - { - "id": "0" - }, - { - "id": "1" - } - ] - } -} -``` - -## Query 1 - -```sql -SELECT s."Id" -FROM "SingleProperties" AS s -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET8_0.md deleted file mode 100644 index 85428680828..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET8_0.md +++ /dev/null @@ -1,25 +0,0 @@ -# Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable - -## Result - -```json -{ - "data": { - "singleProperties": [ - { - "__typename": "SingleProperty" - }, - { - "__typename": "SingleProperty" - } - ] - } -} -``` - -## Query 1 - -```sql -SELECT s."Id" -FROM "SingleProperties" AS s -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET9_0.md deleted file mode 100644 index 85428680828..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable_NET9_0.md +++ /dev/null @@ -1,25 +0,0 @@ -# Fallback_To_Runtime_Properties_When_No_Field_Is_Bindable - -## Result - -```json -{ - "data": { - "singleProperties": [ - { - "__typename": "SingleProperty" - }, - { - "__typename": "SingleProperty" - } - ] - } -} -``` - -## Query 1 - -```sql -SELECT s."Id" -FROM "SingleProperties" AS s -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Project_Into_1to1_Relation_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Project_Into_1to1_Relation.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Project_Into_1to1_Relation_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Project_Into_1to1_Relation.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_And_Products_First_2_Name_Desc_Brand_Name.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET9_0.md deleted file mode 100644 index 44733b6d02d..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_NET9_0.md +++ /dev/null @@ -1,32 +0,0 @@ -# Query_Brands_First_2 - -## Result - -```json -{ - "data": { - "brands": { - "nodes": [ - { - "id": "QnJhbmQ6MTE=", - "name": "Zephyr" - }, - { - "id": "QnJhbmQ6MTM=", - "name": "XE" - } - ] - } - } -} -``` - -## Query 1 - -```sql --- @__p_0='3' -SELECT b."Id", b."Name" -FROM "Brands" AS b -ORDER BY b."Name" DESC, b."Id" -LIMIT @__p_0 -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_First_2_Products_First_2_ForwardCursors.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET9_0.md deleted file mode 100644 index f24407fb81c..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_NET9_0.md +++ /dev/null @@ -1,64 +0,0 @@ -# Query_Brands - -## Result - -```json -{ - "data": { - "brands": { - "nodes": [ - { - "id": "QnJhbmQ6MTE=", - "name": "Zephyr" - }, - { - "id": "QnJhbmQ6MTM=", - "name": "XE" - }, - { - "id": "QnJhbmQ6Mw==", - "name": "WildRunner" - }, - { - "id": "QnJhbmQ6Nw==", - "name": "Solstix" - }, - { - "id": "QnJhbmQ6Ng==", - "name": "Raptor Elite" - }, - { - "id": "QnJhbmQ6NA==", - "name": "Quester" - }, - { - "id": "QnJhbmQ6MTI=", - "name": "Legend" - }, - { - "id": "QnJhbmQ6OA==", - "name": "Grolltex" - }, - { - "id": "QnJhbmQ6MTA=", - "name": "Green Equipment" - }, - { - "id": "QnJhbmQ6Mg==", - "name": "Gravitator" - } - ] - } - } -} -``` - -## Query 1 - -```sql --- @__p_0='11' -SELECT b."Id", b."Name" -FROM "Brands" AS b -ORDER BY b."Name" DESC, b."Id" -LIMIT @__p_0 -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_ProductCount_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_ProductCount.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_ProductCount_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_ProductCount.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_ProductCount_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_ProductCount_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_ProductCount_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_ProductCount_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_ProductCount_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_ProductCount_NET9_0.md deleted file mode 100644 index 53d792e90cb..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_ProductCount_NET9_0.md +++ /dev/null @@ -1,49 +0,0 @@ -# Query_Brands_With_BatchResolver_ProductCount - -## Result - -```json -{ - "data": { - "brands": { - "nodes": [ - { - "id": "QnJhbmQ6MTE=", - "name": "Zephyr", - "productCount": 6 - }, - { - "id": "QnJhbmQ6MTM=", - "name": "XE", - "productCount": 3 - }, - { - "id": "QnJhbmQ6Mw==", - "name": "WildRunner", - "productCount": 11 - }, - { - "id": "QnJhbmQ6Nw==", - "name": "Solstix", - "productCount": 9 - }, - { - "id": "QnJhbmQ6Ng==", - "name": "Raptor Elite", - "productCount": 11 - } - ] - } - } -} -``` - -## Query 1 - -```sql --- @__p_0='6' -SELECT b."Id", b."Name" -FROM "Brands" AS b -ORDER BY b."Name" DESC, b."Id" -LIMIT @__p_0 -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_Supplier_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_Supplier.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_Supplier_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_Supplier.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_Supplier_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_Supplier_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_Supplier_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_Supplier_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_Supplier_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_Supplier_NET9_0.md deleted file mode 100644 index 4322c3e7471..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Brands_With_BatchResolver_Supplier_NET9_0.md +++ /dev/null @@ -1,73 +0,0 @@ -# Query_Brands_With_BatchResolver_Supplier - -## Result - -```json -{ - "data": { - "brands": { - "nodes": [ - { - "id": "QnJhbmQ6MTE=", - "name": "Zephyr", - "supplier": { - "name": "Prime Distribution", - "website": "https://primedist.example.com" - } - }, - { - "id": "QnJhbmQ6MTM=", - "name": "XE", - "supplier": { - "name": "Global Supply Co.", - "website": "https://globalsupply.example.com" - } - }, - { - "id": "QnJhbmQ6Mw==", - "name": "WildRunner", - "supplier": { - "name": "Atlas Logistics", - "website": "https://atlaslogistics.example.com" - } - }, - { - "id": "QnJhbmQ6Nw==", - "name": "Solstix", - "supplier": { - "name": "Global Supply Co.", - "website": "https://globalsupply.example.com" - } - }, - { - "id": "QnJhbmQ6Ng==", - "name": "Raptor Elite", - "supplier": { - "name": "Atlas Logistics", - "website": "https://atlaslogistics.example.com" - } - } - ] - } - } -} -``` - -## Query 1 - -```sql --- @__p_0='6' -SELECT b."Id", b."Name", b."SupplierId" -FROM "Brands" AS b -ORDER BY b."Name" DESC, b."Id" -LIMIT @__p_0 -``` - -## Query 2 - -```sql --- @__supplierIds_0={ '2', '1', '3' } (DbType = Object) -SELECT s."Name", s."Website", s."Id" -FROM "Suppliers" AS s -WHERE s."Id" = ANY (@__supplierIds_0) -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET9_0.md deleted file mode 100644 index 3c300eba1ee..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Brand_NET9_0.md +++ /dev/null @@ -1,23 +0,0 @@ -# Query_Node_Brand - -## Result - -```json -{ - "data": { - "brand": { - "id": "QnJhbmQ6MQ==", - "name": "Daybird" - } - } -} -``` - -## Query 1 - -```sql --- @__ids_0={ '1' } (DbType = Object) -SELECT b."Id", b."Name" -FROM "Brands" AS b -WHERE b."Id" = ANY (@__ids_0) -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET9_0.md deleted file mode 100644 index 5f94ffcf937..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Node_Product_NET9_0.md +++ /dev/null @@ -1,23 +0,0 @@ -# Query_Node_Product - -## Result - -```json -{ - "data": { - "product": { - "id": "UHJvZHVjdDox", - "name": "Wanderer Black Hiking Boots" - } - } -} -``` - -## Query 1 - -```sql --- @__ids_0={ '1' } (DbType = Object) -SELECT p."Id", p."Name" -FROM "Products" AS p -WHERE p."Id" = ANY (@__ids_0) -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET9_0.md deleted file mode 100644 index 76e5fc5da00..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Exclude_TotalCount_NET9_0.md +++ /dev/null @@ -1,30 +0,0 @@ -# Query_Products_Exclude_TotalCount - -## Result - -```json -{ - "data": { - "productsNonRelative": { - "nodes": [ - { - "name": "Zero Gravity Ski Goggles" - }, - { - "name": "Zenith Cycling Jersey" - } - ] - } - } -} -``` - -## Query 1 - -```sql --- @__p_0='3' -SELECT p."Name", p."Id" -FROM "Products" AS p -ORDER BY p."Name" DESC, p."Id" -LIMIT @__p_0 -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET9_0.md deleted file mode 100644 index dccfbcbc0b5..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_And_Brand_NET9_0.md +++ /dev/null @@ -1,45 +0,0 @@ -# Query_Products_First_2_And_Brand - -## Result - -```json -{ - "data": { - "products": { - "nodes": [ - { - "name": "Zero Gravity Ski Goggles", - "brand": { - "name": "Gravitator" - } - }, - { - "name": "Zenith Cycling Jersey", - "brand": { - "name": "B&R" - } - } - ] - } - } -} -``` - -## Query 1 - -```sql --- @__p_0='3' -SELECT p."BrandId", p."Name", p."Id" -FROM "Products" AS p -ORDER BY p."Name" DESC, p."Id" -LIMIT @__p_0 -``` - -## Query 2 - -```sql --- @__ids_0={ '2', '5' } (DbType = Object) -SELECT b."Name", b."Id" -FROM "Brands" AS b -WHERE b."Id" = ANY (@__ids_0) -``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4.md similarity index 76% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET9_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4.md index e3eccc3ae77..19a8dd74d70 100644 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET9_0.md +++ b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4.md @@ -34,22 +34,22 @@ ## Query 1 ```sql --- @__value_0='Zenith Cycling Jersey' --- @__value_1='46' --- @__p_3='3' --- @__p_2='6' +-- @value='Zenith Cycling Jersey' +-- @value2='46' +-- @p4='3' +-- @p='6' SELECT p."BrandId", p."Name", p."Id" FROM "Products" AS p -WHERE p."Name" < @__value_0 OR (p."Name" = @__value_0 AND p."Id" > @__value_1) +WHERE p."Name" < @value OR (p."Name" = @value AND p."Id" > @value2) ORDER BY p."Name" DESC, p."Id" -LIMIT @__p_3 OFFSET @__p_2 +LIMIT @p4 OFFSET @p ``` ## Query 2 ```sql --- @__ids_0={ '6' } (DbType = Object) +-- @ids={ '6' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__ids_0) +WHERE b."Id" = ANY (@ids) ``` diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_First_2_With_4_EndCursors_Skip_4_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Query_Products_Include_TotalCount.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET10_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET10_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET8_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET8_0_NET9_0.md similarity index 100% rename from src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET8_0.md rename to src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET8_0_NET9_0.md diff --git a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET9_0.md b/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET9_0.md deleted file mode 100644 index eb7778f6850..00000000000 --- a/src/HotChocolate/Data/test/Data.PostgreSQL.Tests/__snapshots__/IntegrationTests.Verify_That_PageInfo_Flag_Is_Correctly_Inferred_NET9_0.md +++ /dev/null @@ -1,31 +0,0 @@ -# Verify_That_PageInfo_Flag_Is_Correctly_Inferred - -## Result - -```json -{ - "data": { - "brands": { - "nodes": [ - { - "products": { - "pageInfo": { - "endCursor": null - } - } - } - ] - } - } -} -``` - -## Query 1 - -```sql --- @__p_0='2' -SELECT b."Id", b."Name" -FROM "Brands" AS b -ORDER BY b."Name" DESC, b."Id" -LIMIT @__p_0 -``` diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionFilterTests.cs b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionFilterTests.cs index dbde296f74d..e711aabb4d7 100644 --- a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionFilterTests.cs +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/QueryableProjectionFilterTests.cs @@ -1,5 +1,6 @@ using HotChocolate.Execution; using Microsoft.EntityFrameworkCore; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data.Projections; @@ -138,7 +139,7 @@ public async Task Create_DeepFilterObjectTwoProjections() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0], [NET10_0])) .AddResult(res1) .MatchAsync(TestContext.Current.CancellationToken); } @@ -181,7 +182,7 @@ public async Task Create_ListObjectDifferentLevelProjection() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0], [NET10_0])) .AddResult(res1) .MatchAsync(TestContext.Current.CancellationToken); } @@ -223,7 +224,7 @@ public async Task Create_DeepFilterObjectTwoProjections_Nullable() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0], [NET10_0])) .AddResult(res1) .MatchAsync(TestContext.Current.CancellationToken); } @@ -266,7 +267,7 @@ public async Task Create_ListObjectDifferentLevelProjection_Nullable() // assert await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0], [NET10_0])) .AddResult(res1) .MatchAsync(TestContext.Current.CancellationToken); } diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections.snap new file mode 100644 index 00000000000..d0bbcb33616 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections.snap @@ -0,0 +1,42 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectArray": [] + } + } + ] + } +} +--------------- + +SQL: +--------------- +.param set @p 'a' + +SELECT "d"."Id", "s"."BarString", "s"."BarShort", "s"."Id" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."BarString", "f0"."BarShort", "b"."Id", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" + WHERE "f0"."BarString" = @p +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable.snap new file mode 100644 index 00000000000..d19f734cfc6 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_DeepFilterObjectTwoProjections_Nullable.snap @@ -0,0 +1,45 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectArray": [] + } + }, + { + "foo": { + "objectArray": [] + } + }, + { + "foo": { + "objectArray": [] + } + }, + { + "foo": { + "objectArray": [] + } + } + ] + } +} +--------------- + +SQL: +--------------- +.param set @p 'a' + +SELECT "f"."Id" IS NOT NULL, "d"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id" +FROM "Data" AS "d" +LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."Id" IS NOT NULL AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "b"."FooNullableId" + FROM "BarNullableDeep" AS "b" + LEFT JOIN "FooDeep" AS "f0" ON "b"."FooId" = "f0"."Id" + WHERE "f0"."BarString" = @p +) AS "s" ON "f"."Id" = "s"."FooNullableId" +ORDER BY "d"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection.snap similarity index 76% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection.snap index 0dadf2ac078..d77110f70be 100644 --- a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection.snap @@ -31,14 +31,14 @@ SQL: --------------- .param set @p 'a' -SELECT "f"."BarString", "d"."Id", "f"."Id", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +SELECT "f"."BarString", "d"."Id", "s"."BarString", "s"."BarShort", "s"."Id" FROM "Data" AS "d" INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" LEFT JOIN ( - SELECT "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooId" + SELECT "f0"."BarString", "f0"."BarShort", "b"."Id", "b"."FooId" FROM "BarDeep" AS "b" INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" WHERE "f0"."BarString" = @p ) AS "s" ON "f"."Id" = "s"."FooId" -ORDER BY "d"."Id", "f"."Id", "s"."Id" +ORDER BY "d"."Id" --------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET10_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable.snap similarity index 79% rename from src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable.snap index fded5213df2..758359d86cc 100644 --- a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable_NET10_0.snap +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionFilterTests.Create_ListObjectDifferentLevelProjection_Nullable.snap @@ -36,14 +36,14 @@ SQL: --------------- .param set @p 'a' -SELECT "f"."Id" IS NOT NULL, "f"."BarString", "d"."Id", "f"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id", "s"."Id0" +SELECT "f"."Id" IS NOT NULL, "f"."BarString", "d"."Id", "s"."c", "s"."BarString", "s"."BarShort", "s"."Id" FROM "Data" AS "d" LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id" LEFT JOIN ( - SELECT "f0"."Id" IS NOT NULL AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "f0"."Id" AS "Id0", "b"."FooNullableId" + SELECT "f0"."Id" IS NOT NULL AS "c", "f0"."BarString", "f0"."BarShort", "b"."Id", "b"."FooNullableId" FROM "BarNullableDeep" AS "b" LEFT JOIN "FooDeep" AS "f0" ON "b"."FooId" = "f0"."Id" WHERE "f0"."BarString" = @p ) AS "s" ON "f"."Id" = "s"."FooNullableId" -ORDER BY "d"."Id", "f"."Id", "s"."Id" +ORDER BY "d"."Id" --------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET11_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET11_0.snap new file mode 100644 index 00000000000..7659d1fdc8f --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_DeepFilterObjectTwoProjections_NET11_0.snap @@ -0,0 +1,46 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT "d"."Id", "s"."BarString", "s"."BarShort", "s"."Id" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."BarString", "f0"."BarShort", "b"."Id", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET11_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET11_0.snap new file mode 100644 index 00000000000..25e555865b4 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionHashSetTests.Create_ListObjectDifferentLevelProjection_NET11_0.snap @@ -0,0 +1,48 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT "f"."BarString", "d"."Id", "s"."BarString", "s"."BarShort", "s"."Id" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."BarString", "f0"."BarShort", "b"."Id", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET11_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET11_0.snap new file mode 100644 index 00000000000..7659d1fdc8f --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_DeepFilterObjectTwoProjections_NET11_0.snap @@ -0,0 +1,46 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT "d"."Id", "s"."BarString", "s"."BarShort", "s"."Id" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."BarString", "f0"."BarShort", "b"."Id", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET11_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET11_0.snap new file mode 100644 index 00000000000..25e555865b4 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionISetTests.Create_ListObjectDifferentLevelProjection_NET11_0.snap @@ -0,0 +1,48 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT "f"."BarString", "d"."Id", "s"."BarString", "s"."BarShort", "s"."Id" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."BarString", "f0"."BarShort", "b"."Id", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET11_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET11_0.snap new file mode 100644 index 00000000000..7659d1fdc8f --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_DeepFilterObjectTwoProjections_NET11_0.snap @@ -0,0 +1,46 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT "d"."Id", "s"."BarString", "s"."BarShort", "s"."Id" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."BarString", "f0"."BarShort", "b"."Id", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET11_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET11_0.snap new file mode 100644 index 00000000000..25e555865b4 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortedSetTests.Create_ListObjectDifferentLevelProjection_NET11_0.snap @@ -0,0 +1,48 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectSet": [ + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectSet": [ + { + "foo": { + "barString": "d", + "barShort": 14 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT "f"."BarString", "d"."Id", "s"."BarString", "s"."BarShort", "s"."Id" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."BarString", "f0"."BarShort", "b"."Id", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET11_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET11_0.snap new file mode 100644 index 00000000000..fec9710db6c --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_DeepFilterObjectTwoProjections_NET11_0.snap @@ -0,0 +1,70 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT "d"."Id", "s"."BarString", "s"."BarShort", "s"."Id" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."BarString", "f0"."BarShort", "b"."Id", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "s"."BarShort" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET11_0.snap b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET11_0.snap new file mode 100644 index 00000000000..bcfd0705a4b --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/__snapshots__/QueryableProjectionSortingTests.Create_ListObjectDifferentLevelProjection_NET11_0.snap @@ -0,0 +1,72 @@ +Result: +--------------- +{ + "data": { + "root": [ + { + "foo": { + "barString": "testatest", + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + }, + { + "foo": { + "barString": "testbtest", + "objectArray": [ + { + "foo": { + "barString": "a", + "barShort": 1 + } + }, + { + "foo": { + "barString": "a", + "barShort": 3 + } + }, + { + "foo": { + "barString": "a", + "barShort": 12 + } + } + ] + } + } + ] + } +} +--------------- + +SQL: +--------------- +SELECT "f"."BarString", "d"."Id", "s"."BarString", "s"."BarShort", "s"."Id" +FROM "Data" AS "d" +INNER JOIN "Foo" AS "f" ON "d"."FooId" = "f"."Id" +LEFT JOIN ( + SELECT "f0"."BarString", "f0"."BarShort", "b"."Id", "b"."FooId" + FROM "BarDeep" AS "b" + INNER JOIN "FooDeep" AS "f0" ON "b"."FooId1" = "f0"."Id" +) AS "s" ON "f"."Id" = "s"."FooId" +ORDER BY "d"."Id", "s"."BarShort" +--------------- diff --git a/src/HotChocolate/Data/test/Data.Tests/ExecutableTests.cs b/src/HotChocolate/Data/test/Data.Tests/ExecutableTests.cs index b81f0e87dc5..8ed4b3c8c54 100644 --- a/src/HotChocolate/Data/test/Data.Tests/ExecutableTests.cs +++ b/src/HotChocolate/Data/test/Data.Tests/ExecutableTests.cs @@ -1,3 +1,5 @@ +using static CookieCrumble.TestEnvironment; + namespace HotChocolate.Data; public class ExecutableTests(AuthorFixture authorFixture) : IClassFixture @@ -55,7 +57,7 @@ public async Task ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault() // assert new { result, executable = executable.Print() } - .MatchSnapshot(postFix: TestEnvironment.TargetFramework); + .MatchSnapshot(Postfix([NET8_0])); } [Fact] diff --git a/src/HotChocolate/Data/test/Data.Tests/InterfaceIntegrationTests.cs b/src/HotChocolate/Data/test/Data.Tests/InterfaceIntegrationTests.cs index 607f3147558..fd7d31758dc 100644 --- a/src/HotChocolate/Data/test/Data.Tests/InterfaceIntegrationTests.cs +++ b/src/HotChocolate/Data/test/Data.Tests/InterfaceIntegrationTests.cs @@ -10,6 +10,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Squadron; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data; @@ -67,7 +68,7 @@ public async Task Query_Owner_Animals() operationResult.Extensions = []; await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddQueries(queries) .Add(operationResult) .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -121,7 +122,7 @@ public async Task Query_Owner_Animals_With_TotalCount() operationResult.Extensions = []; await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddQueries(queries) .Add(operationResult) .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -179,7 +180,7 @@ ... on Cat { operationResult.Extensions = []; await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddQueries(queries) .Add(operationResult) .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -224,10 +225,7 @@ public async Task Query_Pets() operationResult.Extensions = []; await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddQueries(queries) .Add(operationResult) .MatchMarkdownAsync(TestContext.Current.CancellationToken); diff --git a/src/HotChocolate/Data/test/Data.Tests/PagingHelperIntegrationTests.cs b/src/HotChocolate/Data/test/Data.Tests/PagingHelperIntegrationTests.cs index 101e8c62dae..dd9ba971fad 100644 --- a/src/HotChocolate/Data/test/Data.Tests/PagingHelperIntegrationTests.cs +++ b/src/HotChocolate/Data/test/Data.Tests/PagingHelperIntegrationTests.cs @@ -10,6 +10,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Squadron; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data; @@ -60,10 +61,7 @@ public async Task GetDefaultPage() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -108,10 +106,7 @@ public async Task GetDefaultPage2() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -156,10 +151,7 @@ public async Task GetSecondPage_With_2_Items() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0], [NET10_0])) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -213,10 +205,7 @@ public async Task GetDefaultPage_With_Nullable() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -271,10 +260,7 @@ public async Task GetDefaultPage_With_Nullable_SecondPage() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0], [NET10_0])) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -328,10 +314,7 @@ public async Task GetDefaultPage_With_Nullable_Fallback() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -386,10 +369,7 @@ public async Task GetDefaultPage_With_Nullable_Fallback_SecondPage() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0], [NET10_0])) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -443,10 +423,7 @@ public async Task GetDefaultPage_With_Deep() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -500,10 +477,7 @@ public async Task GetDefaultPage_With_Deep_SecondPage() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0], [NET10_0])) .AddQueries(queries) .Add(result, "Result") .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -559,7 +533,7 @@ public async Task Nested_Paging_First_2() operationResult.Extensions = []; await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddQueries(queries) .Add(operationResult) .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -615,7 +589,7 @@ public async Task Nested_Paging_First_2_With_Projections() var operationResult = result.ExpectOperationResult(); await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddQueries(queries) .Add(operationResult, "Result") .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -640,10 +614,7 @@ public async Task Paging_Empty_PagingArgs() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddQueries(queries) .Add( new @@ -678,10 +649,7 @@ public async Task Paging_First_5() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddQueries(queries) .Add( new @@ -720,10 +688,7 @@ public async Task Paging_First_5_After_Id_13() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0], [NET10_0])) .AddQueries(queries) .Add( new @@ -758,10 +723,7 @@ public async Task Paging_Last_5() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddQueries(queries) .Add( new @@ -800,10 +762,7 @@ public async Task Paging_First_5_Before_Id_96() // Assert await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0], [NET10_0])) .AddQueries(queries) .Add( new @@ -1011,10 +970,7 @@ public async Task Map_Page_To_Connection_With_Dto() var operationResult = result.ExpectOperationResult(); await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddQueries(queries) .Add(operationResult) .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -1061,10 +1017,7 @@ public async Task Map_Page_To_Connection_With_Dto_2() var operationResult = result.ExpectOperationResult(); await Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddQueries(queries) .Add(operationResult) .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -1119,7 +1072,7 @@ public async Task Ensure_Nullable_Connections_Dont_Throw() var operationResult = result.ExpectOperationResult(); await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddQueries(queries) .Add(operationResult, "Result") .MatchMarkdownAsync(TestContext.Current.CancellationToken); @@ -1176,7 +1129,7 @@ public async Task Ensure_Nullable_Connections_Dont_Throw_2() var operationResult = result.ExpectOperationResult(); await Snapshot - .Create(postFix: TestEnvironment.TargetFramework) + .Create(Postfix([NET8_0], [NET9_0])) .AddQueries(queries) .Add(operationResult, "Result") .MatchMarkdownAsync(TestContext.Current.CancellationToken); diff --git a/src/HotChocolate/Data/test/Data.Tests/ProjectableDataLoaderTests.cs b/src/HotChocolate/Data/test/Data.Tests/ProjectableDataLoaderTests.cs index ad58d4ccba0..ad5f50a2222 100644 --- a/src/HotChocolate/Data/test/Data.Tests/ProjectableDataLoaderTests.cs +++ b/src/HotChocolate/Data/test/Data.Tests/ProjectableDataLoaderTests.cs @@ -9,6 +9,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Squadron; +using static CookieCrumble.TestEnvironment; namespace HotChocolate.Data; @@ -47,10 +48,7 @@ public async Task Brand_With_Name() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -83,10 +81,7 @@ public async Task Brand_With_Name_Selector_is_Null() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -119,10 +114,7 @@ public async Task Manual_Include_Of_Brand() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -191,10 +183,7 @@ public async Task Do_Not_Project() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -230,10 +219,7 @@ public async Task Project_And_Do_Not_Project() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -269,10 +255,7 @@ public async Task Product_With_Name_And_Brand_With_Name() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -314,10 +297,7 @@ public async Task Force_A_Branch() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -359,10 +339,7 @@ public async Task Branches_Are_Merged() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -400,10 +377,7 @@ public async Task Brand_Details_Country_Name() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -442,10 +416,7 @@ public async Task Brand_Details_Country_Name_With_Details_As_Custom_Resolver() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -479,10 +450,7 @@ public async Task Brand_Details_Requires_Brand_Name() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -516,10 +484,7 @@ public async Task Brand_Details_Requires_Brand_Name_With_Proper_Type() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -553,10 +518,7 @@ public async Task Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explic cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -591,10 +553,7 @@ public async Task Brand_Details_Requires_Brand_Name_2() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -631,10 +590,7 @@ public async Task Brand_Products_TypeName() // Brand.Products is getter-only and cannot be assigned by AsSelector, // so products will be empty and the selector falls back to brand.Id. Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -668,10 +624,7 @@ public async Task Brand_Only_TypeName() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -708,10 +661,7 @@ ... on Brand { cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -747,10 +697,7 @@ ... on Brand { cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -784,10 +731,7 @@ public async Task Brand_With_Default_Field_Over_Node() cancellationToken: TestContext.Current.CancellationToken); Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .AddResult(result) .MatchMarkdownSnapshot(); @@ -819,10 +763,7 @@ public async Task Project_Key_To_Collection_Expression() // Assert Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .MatchMarkdownSnapshot(); } @@ -855,10 +796,7 @@ public async Task Project_Key_To_Collection_Expression_Integration() cancellationToken: TestContext.Current.CancellationToken); // Assert Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .Add(result, "Result") .MatchMarkdownSnapshot(); @@ -893,10 +831,7 @@ public async Task Product_With_Nullable_Reference_Property_Set_To_Null() // Assert Snapshot - .Create( - postFix: TestEnvironment.TargetFramework == "NET10_0" - ? TestEnvironment.TargetFramework - : null) + .Create(Postfix([NET8_0, NET9_0])) .AddSql(queries) .Add(result, "Result") .MatchMarkdownSnapshot(); diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET10_0.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault.snap similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET10_0.snap rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault.snap diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET9_0.snap b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET9_0.snap deleted file mode 100644 index be38bb5dff6..00000000000 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ExecutableTests.ExecuteAsync_Should_OnlyOneItem_When_SingleOrDefault_NET9_0.snap +++ /dev/null @@ -1,17 +0,0 @@ -{ - "result": { - "Id": 1, - "Name": "Foo", - "Books": [ - { - "Id": 1, - "AuthorId": 0, - "Title": "Foo1", - "Author": null, - "Publisher": null - } - ], - "Publishers": [] - }, - "executable": "System.Linq.Enumerable+IListSkipTakeIterator`1[HotChocolate.Data.Author]" -} diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_Fragments.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Owner_Animals_With_TotalCount.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets.md index a06c0f946d3..1a920c5800d 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @__p_0='11' +-- @p='11' SELECT p."AnimalType" = 'Dog', p."Id", p."Name", p."AnimalType" = 'Cat' FROM "Pets" AS p ORDER BY p."Name", p."Id" -LIMIT @__p_0 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets_NET8_0_NET9_0.md similarity index 97% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets_NET8_0_NET9_0.md index 1a920c5800d..a06c0f946d3 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/InterfaceIntegrationTests.Query_Pets_NET8_0_NET9_0.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @p='11' +-- @__p_0='11' SELECT p."AnimalType" = 'Dog', p."Id", p."Name", p."AnimalType" = 'Cat' FROM "Pets" AS p ORDER BY p."Name", p."Id" -LIMIT @p +LIMIT @__p_0 ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Ensure_Nullable_Connections_Dont_Throw_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Ensure_Nullable_Connections_Dont_Throw.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Ensure_Nullable_Connections_Dont_Throw_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Ensure_Nullable_Connections_Dont_Throw.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Ensure_Nullable_Connections_Dont_Throw_2_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Ensure_Nullable_Connections_Dont_Throw_2.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Ensure_Nullable_Connections_Dont_Throw_2_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Ensure_Nullable_Connections_Dont_Throw_2.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage.md index 4b983c226e5..1d6876a0213 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @__p_0='11' +-- @p='11' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name", b."Id" -LIMIT @__p_0 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage2.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage2.md index 1e93cb9ce7e..a01b7a90066 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage2.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage2.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @__p_0='11' +-- @p='11' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name", b."Id" -LIMIT @__p_0 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage2_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage2_NET8_0_NET9_0.md similarity index 97% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage2_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage2_NET8_0_NET9_0.md index a01b7a90066..1e93cb9ce7e 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage2_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage2_NET8_0_NET9_0.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @p='11' +-- @__p_0='11' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name", b."Id" -LIMIT @p +LIMIT @__p_0 ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_NET8_0_NET9_0.md similarity index 97% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_NET8_0_NET9_0.md index 1d6876a0213..4b983c226e5 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_NET8_0_NET9_0.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @p='11' +-- @__p_0='11' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name", b."Id" -LIMIT @p +LIMIT @__p_0 ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep.md index 8d95e586fe6..fd812bf165f 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @__p_0='11' +-- @p='11' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."BrandDetails_Country_Name", b."Id" -LIMIT @__p_0 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_NET8_0_NET9_0.md similarity index 99% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_NET8_0_NET9_0.md index fd812bf165f..8d95e586fe6 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_NET8_0_NET9_0.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @p='11' +-- @__p_0='11' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."BrandDetails_Country_Name", b."Id" -LIMIT @p +LIMIT @__p_0 ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_SecondPage.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_SecondPage.md index dbc8d91dc99..ad493e694e9 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_SecondPage.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_SecondPage.md @@ -3,14 +3,14 @@ ## SQL 0 ```sql --- @__value_0='Country1' --- @__value_1='2' --- @__p_2='3' +-- @value='Country1' +-- @value2='2' +-- @p='3' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b -WHERE b."BrandDetails_Country_Name" > @__value_0 OR (b."BrandDetails_Country_Name" = @__value_0 AND b."Id" > @__value_1) +WHERE b."BrandDetails_Country_Name" > @value OR (b."BrandDetails_Country_Name" = @value AND b."Id" > @value2) ORDER BY b."BrandDetails_Country_Name", b."Id" -LIMIT @__p_2 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_SecondPage_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_SecondPage_NET8_0_NET9_0.md new file mode 100644 index 00000000000..dbc8d91dc99 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Deep_SecondPage_NET8_0_NET9_0.md @@ -0,0 +1,67 @@ +# GetDefaultPage_With_Deep_SecondPage + +## SQL 0 + +```sql +-- @__value_0='Country1' +-- @__value_1='2' +-- @__p_2='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."BrandDetails_Country_Name" > @__value_0 OR (b."BrandDetails_Country_Name" = @__value_0 AND b."Id" > @__value_1) +ORDER BY b."BrandDetails_Country_Name", b."Id" +LIMIT @__p_2 +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(x => x.BrandDetails.Country.Name).ThenBy(t => t.Id).Where(t => ((t.BrandDetails.Country.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) > 0) OrElse ((t.BrandDetails.Country.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.Int32]).value) > 0)))).Take(3) +``` + +## Result + +```json +{ + "data": { + "brandsDeep": { + "edges": [ + { + "cursor": "e31Db3VudHJ5MTA6MTE=" + }, + { + "cursor": "e31Db3VudHJ5MTE6MTI=" + } + ], + "nodes": [ + { + "id": 11, + "name": "Brand:10", + "displayName": "BrandDisplay10", + "brandDetails": { + "country": { + "name": "Country10" + } + } + }, + { + "id": 12, + "name": "Brand:11", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country11" + } + } + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": true, + "startCursor": "e31Db3VudHJ5MTA6MTE=", + "endCursor": "e31Db3VudHJ5MTE6MTI=" + } + } + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable.md index fba164327b3..6bf59e96e87 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @__p_0='11' +-- @p='11' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name", b."AlwaysNull", b."Id" -LIMIT @__p_0 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback.md index 71c5d317dd3..88d5e271a23 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @__p_0='11' +-- @p='11' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY COALESCE(b."DisplayName", b."Name"), b."Id" -LIMIT @__p_0 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_NET8_0_NET9_0.md similarity index 99% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_NET8_0_NET9_0.md index 88d5e271a23..71c5d317dd3 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_NET8_0_NET9_0.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @p='11' +-- @__p_0='11' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY COALESCE(b."DisplayName", b."Name"), b."Id" -LIMIT @p +LIMIT @__p_0 ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_SecondPage.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_SecondPage.md index 8b67613feef..d7caab46842 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_SecondPage.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_SecondPage.md @@ -3,14 +3,14 @@ ## SQL 0 ```sql --- @__value_0='Brand:11' --- @__value_1='12' --- @__p_2='3' +-- @value='Brand:11' +-- @value2='12' +-- @p='3' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b -WHERE COALESCE(b."DisplayName", b."Name") > @__value_0 OR (COALESCE(b."DisplayName", b."Name") = @__value_0 AND b."Id" > @__value_1) +WHERE COALESCE(b."DisplayName", b."Name") > @value OR (COALESCE(b."DisplayName", b."Name") = @value AND b."Id" > @value2) ORDER BY COALESCE(b."DisplayName", b."Name"), b."Id" -LIMIT @__p_2 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_SecondPage_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_SecondPage_NET8_0_NET9_0.md new file mode 100644 index 00000000000..8b67613feef --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_Fallback_SecondPage_NET8_0_NET9_0.md @@ -0,0 +1,67 @@ +# GetDefaultPage_With_Nullable_Fallback_SecondPage + +## SQL 0 + +```sql +-- @__value_0='Brand:11' +-- @__value_1='12' +-- @__p_2='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE COALESCE(b."DisplayName", b."Name") > @__value_0 OR (COALESCE(b."DisplayName", b."Name") = @__value_0 AND b."Id" > @__value_1) +ORDER BY COALESCE(b."DisplayName", b."Name"), b."Id" +LIMIT @__p_2 +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => (t.DisplayName ?? t.Name)).ThenBy(t => t.Id).Where(t => (((t.DisplayName ?? t.Name).CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) > 0) OrElse (((t.DisplayName ?? t.Name).CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.Int32]).value) > 0)))).Take(3) +``` + +## Result + +```json +{ + "data": { + "brandsNullableFallback": { + "edges": [ + { + "cursor": "e31CcmFuZFw6MTM6MTQ=" + }, + { + "cursor": "e31CcmFuZFw6MTU6MTY=" + } + ], + "nodes": [ + { + "id": 14, + "name": "Brand:13", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country13" + } + } + }, + { + "id": 16, + "name": "Brand:15", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country15" + } + } + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": true, + "startCursor": "e31CcmFuZFw6MTM6MTQ=", + "endCursor": "e31CcmFuZFw6MTU6MTY=" + } + } + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_NET8_0_NET9_0.md similarity index 99% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_NET8_0_NET9_0.md index 6bf59e96e87..fba164327b3 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_NET8_0_NET9_0.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @p='11' +-- @__p_0='11' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name", b."AlwaysNull", b."Id" -LIMIT @p +LIMIT @__p_0 ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_SecondPage.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_SecondPage.md index 6eee21c65e6..a8be528ad8b 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_SecondPage.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_SecondPage.md @@ -3,14 +3,14 @@ ## SQL 0 ```sql --- @__value_0='Brand10' --- @__value_1='11' --- @__p_2='3' +-- @value='Brand10' +-- @value3='11' +-- @p='3' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b -WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."AlwaysNull" IS NULL AND b."Id" > @__value_1) +WHERE b."Name" > @value OR (b."Name" = @value AND b."AlwaysNull" IS NULL AND b."Id" > @value3) ORDER BY b."Name", b."AlwaysNull", b."Id" -LIMIT @__p_2 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_SecondPage_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_SecondPage_NET8_0_NET9_0.md new file mode 100644 index 00000000000..6eee21c65e6 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetDefaultPage_With_Nullable_SecondPage_NET8_0_NET9_0.md @@ -0,0 +1,67 @@ +# GetDefaultPage_With_Nullable_SecondPage + +## SQL 0 + +```sql +-- @__value_0='Brand10' +-- @__value_1='11' +-- @__p_2='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."AlwaysNull" IS NULL AND b."Id" > @__value_1) +ORDER BY b."Name", b."AlwaysNull", b."Id" +LIMIT @__p_2 +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(x => x.AlwaysNull).ThenBy(t => t.Id).Where(t => (((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) > 0) OrElse ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) == 0) AndAlso False)) OrElse (((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) == 0) AndAlso (t.AlwaysNull == null)) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.Int32]).value) > 0)))).Take(3) +``` + +## Result + +```json +{ + "data": { + "brandsNullable": { + "edges": [ + { + "cursor": "e31CcmFuZFw6MTE6XG51bGw6MTI=" + }, + { + "cursor": "e31CcmFuZFw6MTI6XG51bGw6MTM=" + } + ], + "nodes": [ + { + "id": 12, + "name": "Brand:11", + "displayName": null, + "brandDetails": { + "country": { + "name": "Country11" + } + } + }, + { + "id": 13, + "name": "Brand:12", + "displayName": "BrandDisplay12", + "brandDetails": { + "country": { + "name": "Country12" + } + } + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": true, + "startCursor": "e31CcmFuZFw6MTE6XG51bGw6MTI=", + "endCursor": "e31CcmFuZFw6MTI6XG51bGw6MTM=" + } + } + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetSecondPage_With_2_Items.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetSecondPage_With_2_Items.md index de79aaa6e9d..b698b34e2ec 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetSecondPage_With_2_Items.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetSecondPage_With_2_Items.md @@ -3,14 +3,14 @@ ## SQL 0 ```sql --- @__value_0='Brand17' --- @__value_1='18' --- @__p_2='3' +-- @value='Brand17' +-- @value2='18' +-- @p='3' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b -WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."Id" > @__value_1) +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value2) ORDER BY b."Name", b."Id" -LIMIT @__p_2 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetSecondPage_With_2_Items_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetSecondPage_With_2_Items_NET8_0_NET9_0.md new file mode 100644 index 00000000000..de79aaa6e9d --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.GetSecondPage_With_2_Items_NET8_0_NET9_0.md @@ -0,0 +1,47 @@ +# GetSecondPage_With_2_Items + +## SQL 0 + +```sql +-- @__value_0='Brand17' +-- @__value_1='18' +-- @__p_2='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."Id" > @__value_1) +ORDER BY b."Name", b."Id" +LIMIT @__p_2 +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Where(t => ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) > 0) OrElse ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.Int32]).value) > 0)))).Take(3) +``` + +## Result + +```json +{ + "data": { + "brands": { + "nodes": [ + { + "id": 19, + "name": "Brand:18" + }, + { + "id": 20, + "name": "Brand:19" + } + ], + "pageInfo": { + "hasNextPage": true, + "hasPreviousPage": true, + "startCursor": "e31CcmFuZFw6MTg6MTk=", + "endCursor": "e31CcmFuZFw6MTk6MjA=" + } + } + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto.md index a9721d091b3..6ee57f482e3 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @__p_0='3' +-- @p='3' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name", b."Id" -LIMIT @__p_0 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_2.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_2.md index faee62c0e17..1c559881590 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_2.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_2.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @__p_0='3' +-- @p='3' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name", b."Id" -LIMIT @__p_0 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_2_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_2_NET8_0_NET9_0.md similarity index 96% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_2_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_2_NET8_0_NET9_0.md index 1c559881590..faee62c0e17 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_2_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_2_NET8_0_NET9_0.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @p='3' +-- @__p_0='3' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name", b."Id" -LIMIT @p +LIMIT @__p_0 ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_NET8_0_NET9_0.md new file mode 100644 index 00000000000..a9721d091b3 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Map_Page_To_Connection_With_Dto_NET8_0_NET9_0.md @@ -0,0 +1,46 @@ +# Map_Page_To_Connection_With_Dto + +## SQL 0 + +```sql +-- @__p_0='3' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @__p_0 +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(3) +``` + +## Result 3 + +```json +{ + "data": { + "brands": { + "edges": [ + { + "cursor": "e31CcmFuZFw6MDox", + "displayName": "BrandDisplay0", + "node": { + "id": 1, + "name": "Brand:0" + } + }, + { + "cursor": "e31CcmFuZFw6MToy", + "displayName": null, + "node": { + "id": 2, + "name": "Brand:1" + } + } + ] + } + } +} +``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Nested_Paging_First_2_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Nested_Paging_First_2.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Nested_Paging_First_2_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Nested_Paging_First_2.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Nested_Paging_First_2_With_Projections_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Nested_Paging_First_2_With_Projections.md similarity index 100% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Nested_Paging_First_2_With_Projections_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Nested_Paging_First_2_With_Projections.md diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Empty_PagingArgs.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Empty_PagingArgs.md index 80b46e13fb5..9e6906bccd4 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Empty_PagingArgs.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Empty_PagingArgs.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @__p_0='11' +-- @p='11' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name", b."Id" -LIMIT @__p_0 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Empty_PagingArgs_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Empty_PagingArgs_NET8_0_NET9_0.md new file mode 100644 index 00000000000..80b46e13fb5 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Empty_PagingArgs_NET8_0_NET9_0.md @@ -0,0 +1,157 @@ +# Paging_Empty_PagingArgs + +## SQL 0 + +```sql +-- @__p_0='11' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @__p_0 +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(11) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": false, + "First": 1, + "FirstCursor": "e31CcmFuZFw6MDox", + "Last": 18, + "LastCursor": "e31CcmFuZFw6MTc6MTg=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 1, + "Name": "Brand:0", + "DisplayName": "BrandDisplay0", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country0" + } + } + }, + { + "Id": 2, + "Name": "Brand:1", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country1" + } + } + }, + { + "Id": 11, + "Name": "Brand:10", + "DisplayName": "BrandDisplay10", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country10" + } + } + }, + { + "Id": 12, + "Name": "Brand:11", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country11" + } + } + }, + { + "Id": 13, + "Name": "Brand:12", + "DisplayName": "BrandDisplay12", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country12" + } + } + }, + { + "Id": 14, + "Name": "Brand:13", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country13" + } + } + }, + { + "Id": 15, + "Name": "Brand:14", + "DisplayName": "BrandDisplay14", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country14" + } + } + }, + { + "Id": 16, + "Name": "Brand:15", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country15" + } + } + }, + { + "Id": 17, + "Name": "Brand:16", + "DisplayName": "BrandDisplay16", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country16" + } + } + }, + { + "Id": 18, + "Name": "Brand:17", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country17" + } + } + } +] +``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5.md index e6b8a3260ea..b2a15f59bab 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @__p_0='6' +-- @p='6' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name", b."Id" -LIMIT @__p_0 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_After_Id_13.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_After_Id_13.md index 8ebd25adcb9..523d62543d2 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_After_Id_13.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_After_Id_13.md @@ -3,14 +3,14 @@ ## SQL 0 ```sql --- @__value_0='Brand12' --- @__value_1='13' --- @__p_2='6' +-- @value='Brand12' +-- @value2='13' +-- @p='6' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b -WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."Id" > @__value_1) +WHERE b."Name" > @value OR (b."Name" = @value AND b."Id" > @value2) ORDER BY b."Name", b."Id" -LIMIT @__p_2 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_After_Id_13_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_After_Id_13_NET8_0_NET9_0.md new file mode 100644 index 00000000000..8ebd25adcb9 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_After_Id_13_NET8_0_NET9_0.md @@ -0,0 +1,100 @@ +# Paging_First_5_After_Id_13 + +## SQL 0 + +```sql +-- @__value_0='Brand12' +-- @__value_1='13' +-- @__p_2='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."Name" > @__value_0 OR (b."Name" = @__value_0 AND b."Id" > @__value_1) +ORDER BY b."Name", b."Id" +LIMIT @__p_2 +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Where(t => ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) > 0) OrElse ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.Int32]).value) > 0)))).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": true, + "First": 14, + "FirstCursor": "e31CcmFuZFw6MTM6MTQ=", + "Last": 18, + "LastCursor": "e31CcmFuZFw6MTc6MTg=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 14, + "Name": "Brand:13", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country13" + } + } + }, + { + "Id": 15, + "Name": "Brand:14", + "DisplayName": "BrandDisplay14", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country14" + } + } + }, + { + "Id": 16, + "Name": "Brand:15", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country15" + } + } + }, + { + "Id": 17, + "Name": "Brand:16", + "DisplayName": "BrandDisplay16", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country16" + } + } + }, + { + "Id": 18, + "Name": "Brand:17", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country17" + } + } + } +] +``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_Before_Id_96.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_Before_Id_96.md index 396d78db6c5..54541548bc0 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_Before_Id_96.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_Before_Id_96.md @@ -3,14 +3,14 @@ ## SQL 0 ```sql --- @__value_0='Brand95' --- @__value_1='96' --- @__p_2='6' +-- @value='Brand95' +-- @value2='96' +-- @p='6' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b -WHERE b."Name" < @__value_0 OR (b."Name" = @__value_0 AND b."Id" < @__value_1) +WHERE b."Name" < @value OR (b."Name" = @value AND b."Id" < @value2) ORDER BY b."Name" DESC, b."Id" DESC -LIMIT @__p_2 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_Before_Id_96_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_Before_Id_96_NET8_0_NET9_0.md new file mode 100644 index 00000000000..396d78db6c5 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_Before_Id_96_NET8_0_NET9_0.md @@ -0,0 +1,100 @@ +# Paging_First_5_Before_Id_96 + +## SQL 0 + +```sql +-- @__value_0='Brand95' +-- @__value_1='96' +-- @__p_2='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +WHERE b."Name" < @__value_0 OR (b."Name" = @__value_0 AND b."Id" < @__value_1) +ORDER BY b."Name" DESC, b."Id" DESC +LIMIT @__p_2 +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderByDescending(t => t.Name).ThenByDescending(t => t.Id).Where(t => ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) < 0) OrElse ((t.Name.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.String]).value) == 0) AndAlso (t.Id.CompareTo(value(GreenDonut.Data.Expressions.ExpressionHelpers+<>c__DisplayClass16_0`1[System.Int32]).value) < 0)))).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": true, + "First": 92, + "FirstCursor": "e31CcmFuZFw6OTE6OTI=", + "Last": 96, + "LastCursor": "e31CcmFuZFw6OTU6OTY=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 92, + "Name": "Brand:91", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country91" + } + } + }, + { + "Id": 93, + "Name": "Brand:92", + "DisplayName": "BrandDisplay92", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country92" + } + } + }, + { + "Id": 94, + "Name": "Brand:93", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country93" + } + } + }, + { + "Id": 95, + "Name": "Brand:94", + "DisplayName": "BrandDisplay94", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country94" + } + } + }, + { + "Id": 96, + "Name": "Brand:95", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country95" + } + } + } +] +``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_NET8_0_NET9_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_NET8_0_NET9_0.md new file mode 100644 index 00000000000..e6b8a3260ea --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_First_5_NET8_0_NET9_0.md @@ -0,0 +1,97 @@ +# Paging_First_5 + +## SQL 0 + +```sql +-- @__p_0='6' +SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" +FROM "Brands" AS b +ORDER BY b."Name", b."Id" +LIMIT @__p_0 +``` + +## Expression 0 + +```text +[Microsoft.EntityFrameworkCore.Query.EntityQueryRootExpression].OrderBy(t => t.Name).ThenBy(t => t.Id).Take(6) +``` + +## Result 3 + +```json +{ + "HasNextPage": true, + "HasPreviousPage": false, + "First": 1, + "FirstCursor": "e31CcmFuZFw6MDox", + "Last": 13, + "LastCursor": "e31CcmFuZFw6MTI6MTM=" +} +``` + +## Result 4 + +```json +[ + { + "Id": 1, + "Name": "Brand:0", + "DisplayName": "BrandDisplay0", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country0" + } + } + }, + { + "Id": 2, + "Name": "Brand:1", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country1" + } + } + }, + { + "Id": 11, + "Name": "Brand:10", + "DisplayName": "BrandDisplay10", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country10" + } + } + }, + { + "Id": 12, + "Name": "Brand:11", + "DisplayName": null, + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country11" + } + } + }, + { + "Id": 13, + "Name": "Brand:12", + "DisplayName": "BrandDisplay12", + "AlwaysNull": null, + "Products": [], + "BrandDetails": { + "Country": { + "Name": "Country12" + } + } + } +] +``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5.md index 4e213fec7ab..2a0121d131a 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @__p_0='6' +-- @p='6' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name" DESC, b."Id" DESC -LIMIT @__p_0 +LIMIT @p ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5_NET8_0_NET9_0.md similarity index 98% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5_NET8_0_NET9_0.md index 2a0121d131a..4e213fec7ab 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/PagingHelperIntegrationTests.Paging_Last_5_NET8_0_NET9_0.md @@ -3,11 +3,11 @@ ## SQL 0 ```sql --- @p='6' +-- @__p_0='6' SELECT b."Id", b."AlwaysNull", b."DisplayName", b."Name", b."BrandDetails_Country_Name" FROM "Brands" AS b ORDER BY b."Name" DESC, b."Id" DESC -LIMIT @p +LIMIT @__p_0 ``` ## Expression 0 diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged.md index 4cfe46313c4..3c76e31c02d 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged.md @@ -3,11 +3,11 @@ ## SQL ```text --- @__keys_0={ '1', '2' } (DbType = Object) +-- @keys={ '1', '2' } (DbType = Object) SELECT FALSE, b."Name", p."Name", p."Id" FROM "Products" AS p INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = ANY (@__keys_0) +WHERE p."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET8_0_NET9_0.md similarity index 83% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET8_0_NET9_0.md index 3c76e31c02d..4cfe46313c4 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Branches_Are_Merged_NET8_0_NET9_0.md @@ -3,11 +3,11 @@ ## SQL ```text --- @keys={ '1', '2' } (DbType = Object) +-- @__keys_0={ '1', '2' } (DbType = Object) SELECT FALSE, b."Name", p."Name", p."Id" FROM "Products" AS p INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = ANY (@keys) +WHERE p."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name.md index f83d3d95dc5..4425bb1f30e 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Details_Country_Name" AS "Name", b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET8_0_NET9_0.md similarity index 81% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET8_0_NET9_0.md index 4425bb1f30e..f83d3d95dc5 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Details_Country_Name" AS "Name", b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver.md index b3497e762fa..28924240d6d 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET8_0_NET9_0.md similarity index 81% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET8_0_NET9_0.md index 28924240d6d..b3497e762fa 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Country_Name_With_Details_As_Custom_Resolver_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name.md index 32373de62b0..c5cec0ae46c 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2.md index 34bf052f977..f76d32c4922 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2_NET8_0_NET9_0.md similarity index 76% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2_NET8_0_NET9_0.md index f76d32c4922..34bf052f977 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_2_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET8_0_NET9_0.md similarity index 74% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET8_0_NET9_0.md index c5cec0ae46c..32373de62b0 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type.md index 4b7c02c4c13..6b0f30934d4 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_NET8_0_NET9_0.md similarity index 76% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_NET8_0_NET9_0.md index 6b0f30934d4..4b7c02c4c13 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic.md index 8b8ff98474e..15ce404a231 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic_NET8_0_NET9_0.md similarity index 77% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic_NET8_0_NET9_0.md index 15ce404a231..8b8ff98474e 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Details_Requires_Brand_Name_With_Proper_Type_With_Explicit_Generic_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName.md index c850b854fe1..c5071ce88ab 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET8_0_NET9_0.md similarity index 71% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET8_0_NET9_0.md index c5071ce88ab..c850b854fe1 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Only_TypeName_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName.md index 09888a85acb..f0fe247617f 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET8_0_NET9_0.md similarity index 70% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET8_0_NET9_0.md index f0fe247617f..09888a85acb 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_Products_TypeName_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node.md index 572e5ea4264..e963bfdfa37 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node_NET8_0_NET9_0.md similarity index 72% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node_NET8_0_NET9_0.md index e963bfdfa37..572e5ea4264 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Default_Field_Over_Node_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node.md index 90e65268ff6..3db4dbe81d1 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Id", b."Name" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node_NET8_0_NET9_0.md similarity index 75% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node_NET8_0_NET9_0.md index 3db4dbe81d1..90e65268ff6 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Id_And_Name_Over_Node_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Id", b."Name" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name.md index 8cf5e20c8c0..fa008bad0e6 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET8_0_NET9_0.md similarity index 71% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET8_0_NET9_0.md index fa008bad0e6..8cf5e20c8c0 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node.md index 58096c0df46..743084f1877 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node_NET8_0_NET9_0.md similarity index 71% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node_NET8_0_NET9_0.md index 743084f1877..58096c0df46 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Over_Node_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null.md index 731323f34bf..8a29f4882d5 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Id", b."DisplayName", b."Name", b."Details_Country_Name" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null_NET8_0_NET9_0.md similarity index 77% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null_NET8_0_NET9_0.md index 8a29f4882d5..731323f34bf 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Brand_With_Name_Selector_is_Null_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Id", b."DisplayName", b."Name", b."Details_Country_Name" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project.md index f8fb6311aaa..9c88a699ae5 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Id", b."DisplayName", b."Name", b."Details_Country_Name" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET8_0_NET9_0.md similarity index 76% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET8_0_NET9_0.md index 9c88a699ae5..f8fb6311aaa 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Do_Not_Project_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Id", b."DisplayName", b."Name", b."Details_Country_Name" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch.md index 73ef66e8b69..c5720d539a0 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch.md @@ -3,16 +3,16 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT FALSE, b."Name", p."Name", p."Id" FROM "Products" AS p INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = ANY (@__keys_0) --- @__keys_0={ '1' } (DbType = Object) +WHERE p."Id" = ANY (@keys) +-- @keys={ '1' } (DbType = Object) SELECT FALSE, b."Id", p."Id" FROM "Products" AS p INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = ANY (@__keys_0) +WHERE p."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET8_0_NET9_0.md similarity index 76% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET8_0_NET9_0.md index c5720d539a0..73ef66e8b69 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Force_A_Branch_NET8_0_NET9_0.md @@ -3,16 +3,16 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT FALSE, b."Name", p."Name", p."Id" FROM "Products" AS p INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = ANY (@keys) --- @keys={ '1' } (DbType = Object) +WHERE p."Id" = ANY (@__keys_0) +-- @__keys_0={ '1' } (DbType = Object) SELECT FALSE, b."Id", p."Id" FROM "Products" AS p INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = ANY (@keys) +WHERE p."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_And_Observe_Brand.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_And_Observe_Brand.md deleted file mode 100644 index 0bbedf2e3b6..00000000000 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_And_Observe_Brand.md +++ /dev/null @@ -1,23 +0,0 @@ -# Manual_Include_And_Observe_Brand - -## SQL - -```text --- @__keys_0={ '1' } (DbType = Object) -SELECT p."Id", p."AvailableStock", p."BrandId", p."Description", p."ImageFileName", p."MaxStockThreshold", p."Name", p."OnReorder", p."Price", p."RestockThreshold", p."TypeId" -FROM "Products" AS p -WHERE p."Id" = ANY (@__keys_0) -``` - -## Result - -```json -{ - "data": { - "productByIdWithBrandNoSelection": { - "name": "Product 0-0" - } - } -} -``` - diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand.md index d8aae7c89ac..03193d9ea18 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand.md @@ -3,11 +3,11 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT p."Name", b."Id", b."DisplayName", b."Name", b."Details_Country_Name", p."Id" FROM "Products" AS p INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = ANY (@__keys_0) +WHERE p."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET8_0_NET9_0.md similarity index 81% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET8_0_NET9_0.md index 03193d9ea18..d8aae7c89ac 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Manual_Include_Of_Brand_NET8_0_NET9_0.md @@ -3,11 +3,11 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT p."Name", b."Id", b."DisplayName", b."Name", b."Details_Country_Name", p."Id" FROM "Products" AS p INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = ANY (@keys) +WHERE p."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name.md index f1cd4bf80b5..e019f618581 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name.md @@ -3,11 +3,11 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT FALSE, b."Name", p."Name", p."Id" FROM "Products" AS p INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = ANY (@__keys_0) +WHERE p."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET8_0_NET9_0.md similarity index 82% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET8_0_NET9_0.md index e019f618581..f1cd4bf80b5 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Name_And_Brand_With_Name_NET8_0_NET9_0.md @@ -3,11 +3,11 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT FALSE, b."Name", p."Name", p."Id" FROM "Products" AS p INNER JOIN "Brands" AS b ON p."BrandId" = b."Id" -WHERE p."Id" = ANY (@keys) +WHERE p."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null.md index ef0092d04f6..3abb41d1149 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null.md @@ -3,10 +3,10 @@ ## SQL ```text --- @__id_0='1' +-- @id='1' SELECT p."Name" FROM "Products" AS p -WHERE p."Id" = @__id_0 +WHERE p."Id" = @id ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null_NET8_0_NET9_0.md similarity index 85% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null_NET8_0_NET9_0.md index 3abb41d1149..ef0092d04f6 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Product_With_Nullable_Reference_Property_Set_To_Null_NET8_0_NET9_0.md @@ -3,10 +3,10 @@ ## SQL ```text --- @id='1' +-- @__id_0='1' SELECT p."Name" FROM "Products" AS p -WHERE p."Id" = @id +WHERE p."Id" = @__id_0 ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project.md index 97c95835a02..a32d4164d5a 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project.md @@ -3,14 +3,14 @@ ## SQL ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Id", b."DisplayName", b."Name", b."Details_Country_Name" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) --- @__keys_0={ '1' } (DbType = Object) +WHERE b."Id" = ANY (@keys) +-- @keys={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET8_0_NET9_0.md similarity index 70% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET8_0_NET9_0.md index a32d4164d5a..97c95835a02 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_And_Do_Not_Project_NET8_0_NET9_0.md @@ -3,14 +3,14 @@ ## SQL ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Id", b."DisplayName", b."Name", b."Details_Country_Name" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) --- @keys={ '1' } (DbType = Object) +WHERE b."Id" = ANY (@__keys_0) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Name", b."Id" FROM "Brands" AS b -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ``` ## Result diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression.md index 6cf1c5c4768..8ebf3d941ea 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression.md @@ -1,10 +1,10 @@ # Project_Key_To_Collection_Expression ```text --- @__keys_0={ '1' } (DbType = Object) +-- @keys={ '1' } (DbType = Object) SELECT b."Id", p."Name", p."Id" FROM "Brands" AS b LEFT JOIN "Products" AS p ON b."Id" = p."BrandId" -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ORDER BY b."Id" ``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration.md index a47c5da7c7b..1eac099ff0c 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration.md @@ -3,11 +3,11 @@ ## SQL ```text --- @__keys_0={ '1', '2' } (DbType = Object) +-- @keys={ '1', '2' } (DbType = Object) SELECT b."Id", p."Name", p."Id" FROM "Brands" AS b LEFT JOIN "Products" AS p ON b."Id" = p."BrandId" -WHERE b."Id" = ANY (@__keys_0) +WHERE b."Id" = ANY (@keys) ORDER BY b."Id" ``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration_NET8_0_NET9_0.md similarity index 99% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration_NET8_0_NET9_0.md index 1eac099ff0c..a47c5da7c7b 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_Integration_NET8_0_NET9_0.md @@ -3,11 +3,11 @@ ## SQL ```text --- @keys={ '1', '2' } (DbType = Object) +-- @__keys_0={ '1', '2' } (DbType = Object) SELECT b."Id", p."Name", p."Id" FROM "Brands" AS b LEFT JOIN "Products" AS p ON b."Id" = p."BrandId" -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ORDER BY b."Id" ``` diff --git a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_NET10_0.md b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_NET8_0_NET9_0.md similarity index 70% rename from src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_NET10_0.md rename to src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_NET8_0_NET9_0.md index 8ebf3d941ea..6cf1c5c4768 100644 --- a/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_NET10_0.md +++ b/src/HotChocolate/Data/test/Data.Tests/__snapshots__/ProjectableDataLoaderTests.Project_Key_To_Collection_Expression_NET8_0_NET9_0.md @@ -1,10 +1,10 @@ # Project_Key_To_Collection_Expression ```text --- @keys={ '1' } (DbType = Object) +-- @__keys_0={ '1' } (DbType = Object) SELECT b."Id", p."Name", p."Id" FROM "Brands" AS b LEFT JOIN "Products" AS p ON b."Id" = p."BrandId" -WHERE b."Id" = ANY (@keys) +WHERE b."Id" = ANY (@__keys_0) ORDER BY b."Id" ``` diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityExecutionDiagnosticListenerTests.cs b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityExecutionDiagnosticListenerTests.cs index 2dd8523b862..b7a469b6571 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityExecutionDiagnosticListenerTests.cs +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityExecutionDiagnosticListenerTests.cs @@ -7,6 +7,7 @@ using HotChocolate.Resolvers; using HotChocolate.Subscriptions; using HotChocolate.Types; +using static CookieCrumble.TestEnvironment; using static HotChocolate.Diagnostics.ActivityTestHelper; namespace HotChocolate.Diagnostics; @@ -482,7 +483,7 @@ public async Task ResolverException_OnNullableField_SetsErrorTypeToExceptionType cancellationToken: TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -567,7 +568,7 @@ public async Task VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan() cancellationToken: TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -710,7 +711,7 @@ public async Task SubscriptionEventError_Records_Subscription_Event_Error() } // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityServerDiagnosticListenerTests.cs b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityServerDiagnosticListenerTests.cs index dc1fd8dce67..09153454051 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityServerDiagnosticListenerTests.cs +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityServerDiagnosticListenerTests.cs @@ -2,6 +2,7 @@ using Microsoft.Extensions.DependencyInjection; using HotChocolate.AspNetCore.Tests.Utilities; using HotChocolate.Transport.Http; +using static CookieCrumble.TestEnvironment; using static HotChocolate.Diagnostics.ActivityTestHelper; using OperationRequest = HotChocolate.Transport.OperationRequest; @@ -33,7 +34,7 @@ public async Task Http_Post_SingleRequest_GetHeroName_Default() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -59,7 +60,7 @@ public async Task Http_Post_SingleRequest_GetHeroName() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -85,7 +86,7 @@ public async Task Http_Get_SingleRequest_GetHeroName() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -112,7 +113,7 @@ public async Task Http_Post_Variables_Are_Not_Automatically_Added_To_Activities( await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -143,7 +144,7 @@ public async Task Http_Post_Add_Variables_To_Http_Activity() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -171,7 +172,7 @@ public async Task Http_Post_With_Extensions_Map() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -192,7 +193,7 @@ public async Task Http_Get_SDL_Download() await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -221,7 +222,7 @@ ... on Droid @defer(label: "my_id") { }); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -256,7 +257,7 @@ await server.PostRawAsync(new ClientQueryRequest }); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -292,7 +293,7 @@ await server.PostRawAsync(new ClientQueryRequest }); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -324,7 +325,7 @@ query GetHero($episode: Episode!) { await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -356,7 +357,7 @@ query GetHero($episode: Episode!) { await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -386,7 +387,7 @@ public async Task RequestDetails_DocumentOnly_IncludesDocumentTag() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -413,7 +414,7 @@ query GetHero { await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityTestHelper.cs b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityTestHelper.cs index 5e342d1175d..8c8fd26f1cb 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityTestHelper.cs +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ActivityTestHelper.cs @@ -12,6 +12,11 @@ public static partial class ActivityTestHelper private static partial Regex StackTracePathRegex(); [GeneratedRegex(@"lambda_method\d+", RegexOptions.CultureInvariant)] private static partial Regex LambdaMethodRegex(); + // Async resumption markers depend on whether an await completes synchronously, which the + // JIT decides differently under coverage instrumentation. Removing them keeps the snapshot + // stable regardless of those JIT/coverage differences. + [GeneratedRegex(@"\n--- End of stack trace from previous location ---", RegexOptions.CultureInvariant)] + private static partial Regex StackTraceResumptionMarkerRegex(); public static IDisposable CaptureActivities(out Capture activities) { @@ -83,6 +88,8 @@ public static IDisposable CaptureActivities(out Capture activities) return $" in {fileName}"; }); + scrubbedStackTrace = StackTraceResumptionMarkerRegex().Replace(scrubbedStackTrace, ""); + yield return new KeyValuePair( tag.Key, LambdaMethodRegex().Replace(scrubbedStackTrace, "lambda_method")); diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/McpAdapterActivityTests.cs b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/McpAdapterActivityTests.cs index 663eccc39fa..17d78a31f87 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/McpAdapterActivityTests.cs +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/McpAdapterActivityTests.cs @@ -10,6 +10,7 @@ using ModelContextProtocol.Client; using Newtonsoft.Json; using Newtonsoft.Json.Converters; +using static CookieCrumble.TestEnvironment; using static HotChocolate.Diagnostics.ActivityTestHelper; namespace HotChocolate.Diagnostics; @@ -120,7 +121,7 @@ private static void MatchActivitySnapshot(object activities) Formatting.Indented, new StringEnumConverter()); json = SessionIdRegex().Replace(json, "$1$2"); - json.MatchSnapshot(); + json.MatchSnapshot(Postfix([NET11_0])); } private static PromptDefinition CreateGreetingPrompt() diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/OpenApiAdapterActivityTests.cs b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/OpenApiAdapterActivityTests.cs index 14c639c577c..3aac96089d0 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/OpenApiAdapterActivityTests.cs +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/OpenApiAdapterActivityTests.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; +using static CookieCrumble.TestEnvironment; using static HotChocolate.Diagnostics.ActivityTestHelper; namespace HotChocolate.Diagnostics; @@ -35,7 +36,7 @@ query GetBook @http(method: GET, route: "/book") { await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -58,7 +59,7 @@ query GetMissing @http(method: GET, route: "/invalid-graphql-query") { await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -84,7 +85,7 @@ query GetBook @http(method: GET, route: "/book") { // assert Assert.Equal(System.Net.HttpStatusCode.NotFound, response.StatusCode); - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -109,7 +110,7 @@ query GetFaultyBook @http(method: GET, route: "/faulty-book") { await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName.snap index 2d88efaec71..b143dcd5f17 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName.snap @@ -68,7 +68,7 @@ }, { "Key": "exception.stacktrace", - "Value": "System.InvalidOperationException: custom resolver failure\n at HotChocolate.Diagnostics.ActivityExecutionDiagnosticListenerTests.SimpleQuery.ThrowInvalidOperation() in ActivityExecutionDiagnosticListenerTests.cs\n at lambda_method(Closure, IResolverContext)\n at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.<b__0>d.MoveNext() in FieldMiddlewareCompiler.cs\n--- End of stack trace from previous location ---\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken) in ResolverTask.Execute.cs\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken) in ResolverTask.Execute.cs" + "Value": "System.InvalidOperationException: custom resolver failure\n at HotChocolate.Diagnostics.ActivityExecutionDiagnosticListenerTests.SimpleQuery.ThrowInvalidOperation() in ActivityExecutionDiagnosticListenerTests.cs\n at lambda_method(Closure, IResolverContext)\n at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.<b__0>d.MoveNext() in FieldMiddlewareCompiler.cs\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken) in ResolverTask.Execute.cs\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken) in ResolverTask.Execute.cs" } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName_NET11_0.snap new file mode 100644 index 00000000000..871b0944b6d --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.ResolverException_OnNullableField_SetsErrorTypeToExceptionTypeName_NET11_0.snap @@ -0,0 +1,195 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:8e782a6a10f01f9f72ecb3f1ae638606" + }, + { + "Key": "graphql.error.count", + "Value": 1 + }, + { + "Key": "error.type", + "Value": "System.InvalidOperationException" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + }, + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Unexpected Execution Error" + }, + { + "Key": "graphql.field.path", + "Value": "throwInvalidOperation" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:8e782a6a10f01f9f72ecb3f1ae638606" + }, + { + "Key": "exception.type", + "Value": "System.InvalidOperationException" + }, + { + "Key": "exception.message", + "Value": "custom resolver failure" + }, + { + "Key": "exception.stacktrace", + "Value": "System.InvalidOperationException: custom resolver failure\n at HotChocolate.Diagnostics.ActivityExecutionDiagnosticListenerTests.SimpleQuery.ThrowInvalidOperation() in ActivityExecutionDiagnosticListenerTests.cs\n at lambda_method(Closure, IResolverContext)\n at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.b__0(IMiddlewareContext ctx) in FieldMiddlewareCompiler.cs\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken) in ResolverTask.Execute.cs\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken) in ResolverTask.Execute.cs" + } + ] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:8e782a6a10f01f9f72ecb3f1ae638606" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:8e782a6a10f01f9f72ecb3f1ae638606" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:8e782a6a10f01f9f72ecb3f1ae638606" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:8e782a6a10f01f9f72ecb3f1ae638606" + }, + { + "Key": "error.type", + "Value": "System.InvalidOperationException" + } + ], + "event": [], + "activities": [ + { + "OperationName": "SimpleQuery.throwInvalidOperation", + "DisplayName": "SimpleQuery.throwInvalidOperation", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "throwInvalidOperation" + }, + { + "Key": "graphql.field.path", + "Value": "throwInvalidOperation" + }, + { + "Key": "graphql.field.name", + "Value": "throwInvalidOperation" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "SimpleQuery.throwInvalidOperation" + }, + { + "Key": "graphql.field.parent_type", + "Value": "SimpleQuery" + }, + { + "Key": "error.type", + "Value": "System.InvalidOperationException" + } + ], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error.snap index 0ae8d386e70..5cc1b89c2f9 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error.snap @@ -186,7 +186,7 @@ }, { "Key": "exception.stacktrace", - "Value": "System.InvalidOperationException: Subscription event failed.\n at HotChocolate.Diagnostics.ActivityExecutionDiagnosticListenerTests.SimpleSubscription.OnFailingMessage(String message) in ActivityExecutionDiagnosticListenerTests.cs\n at lambda_method(Closure, IResolverContext)\n at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.<b__0>d.MoveNext() in FieldMiddlewareCompiler.cs\n--- End of stack trace from previous location ---\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken) in ResolverTask.Execute.cs\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken) in ResolverTask.Execute.cs" + "Value": "System.InvalidOperationException: Subscription event failed.\n at HotChocolate.Diagnostics.ActivityExecutionDiagnosticListenerTests.SimpleSubscription.OnFailingMessage(String message) in ActivityExecutionDiagnosticListenerTests.cs\n at lambda_method(Closure, IResolverContext)\n at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.<b__0>d.MoveNext() in FieldMiddlewareCompiler.cs\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken) in ResolverTask.Execute.cs\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken) in ResolverTask.Execute.cs" } ] } diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error_NET11_0.snap new file mode 100644 index 00000000000..bc465188c26 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.SubscriptionEventError_Records_Subscription_Event_Error_NET11_0.snap @@ -0,0 +1,239 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "subscription", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "graphql.operation.type", + "Value": "subscription" + }, + { + "Key": "graphql.operation.name", + "Value": "OnFailingMessageSubscription" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:1f38a1bfe720ad0cb6083bf8b309d3aa" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:1f38a1bfe720ad0cb6083bf8b309d3aa" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:1f38a1bfe720ad0cb6083bf8b309d3aa" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:1f38a1bfe720ad0cb6083bf8b309d3aa" + }, + { + "Key": "graphql.operation.type", + "Value": "subscription" + }, + { + "Key": "graphql.operation.name", + "Value": "OnFailingMessageSubscription" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "subscription" + }, + { + "Key": "graphql.operation.name", + "Value": "OnFailingMessageSubscription" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:1f38a1bfe720ad0cb6083bf8b309d3aa" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Subscription Event", + "DisplayName": "GraphQL Subscription Event", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "subscription_event" + }, + { + "Key": "graphql.operation.type", + "Value": "subscription" + }, + { + "Key": "graphql.operation.name", + "Value": "OnFailingMessageSubscription" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:1f38a1bfe720ad0cb6083bf8b309d3aa" + }, + { + "Key": "graphql.subscription.id", + "Value": "1" + }, + { + "Key": "error.type", + "Value": "System.InvalidOperationException" + } + ], + "event": [ + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Unexpected Execution Error" + }, + { + "Key": "graphql.field.path", + "Value": "onFailingMessage" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "SimpleSubscription.onFailingMessage" + }, + { + "Key": "graphql.operation.type", + "Value": "subscription" + }, + { + "Key": "graphql.operation.name", + "Value": "OnFailingMessageSubscription" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:1f38a1bfe720ad0cb6083bf8b309d3aa" + }, + { + "Key": "exception.type", + "Value": "System.InvalidOperationException" + }, + { + "Key": "exception.message", + "Value": "Subscription event failed." + }, + { + "Key": "exception.stacktrace", + "Value": "System.InvalidOperationException: Subscription event failed.\n at HotChocolate.Diagnostics.ActivityExecutionDiagnosticListenerTests.SimpleSubscription.OnFailingMessage(String message) in ActivityExecutionDiagnosticListenerTests.cs\n at lambda_method(Closure, IResolverContext)\n at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.b__0(IMiddlewareContext ctx) in FieldMiddlewareCompiler.cs\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken) in ResolverTask.Execute.cs\n at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken) in ResolverTask.Execute.cs" + } + ] + } + ], + "activities": [ + { + "OperationName": "SimpleSubscription.onFailingMessage", + "DisplayName": "SimpleSubscription.onFailingMessage", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "onFailingMessage" + }, + { + "Key": "graphql.field.path", + "Value": "onFailingMessage" + }, + { + "Key": "graphql.field.name", + "Value": "onFailingMessage" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "SimpleSubscription.onFailingMessage" + }, + { + "Key": "graphql.field.parent_type", + "Value": "SimpleSubscription" + }, + { + "Key": "error.type", + "Value": "System.InvalidOperationException" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan_NET11_0.snap new file mode 100644 index 00000000000..52af1eb5156 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan_NET11_0.snap @@ -0,0 +1,169 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "error.type", + "Value": "HotChocolate.Types.LeafCoercionException" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "graphql.error.count", + "Value": 1 + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "exception", + "Tags": [ + { + "Key": "exception.message", + "Value": "Mood cannot coerce the given value JSON element of type `String` to a runtime value." + }, + { + "Key": "exception.stacktrace", + "Value": "HotChocolate.Types.LeafCoercionException: Mood cannot coerce the given value JSON element of type `String` to a runtime value.\n at HotChocolate.Types.InputParser.DeserializeLeaf(JsonElement inputValue, ILeafType type, Path path, InputField field, IFeatureProvider context) in InputParser.cs\n at HotChocolate.Types.InputParser.Deserialize(JsonElement inputValue, IType type, Path path, InputField field, IFeatureProvider context) in InputParser.cs\n at HotChocolate.Types.InputParser.ParseInputValue(JsonElement inputValue, IType type, IFeatureProvider context, Path path) in InputParser.cs\n at HotChocolate.Execution.Processing.VariableCoercionHelper.CoerceVariableValue(VariableDefinitionNode variableDefinition, IInputType variableType, JsonElement inputValue, IFeatureProvider context) in VariableCoercionHelper.cs\n at HotChocolate.Execution.Processing.VariableCoercionHelper.CoerceVariableValuesInternal(ISchemaDefinition schema, IReadOnlyList`1 variableDefinitions, JsonElement variableValues, Dictionary`2 coercedValues, IFeatureProvider context) in VariableCoercionHelper.cs\n at HotChocolate.Execution.Processing.VariableCoercionHelper.CoerceVariableValues(ISchemaDefinition schema, IReadOnlyList`1 variableDefinitions, JsonElement variableValues, Dictionary`2 coercedValues, IFeatureProvider context) in VariableCoercionHelper.cs\n at HotChocolate.Execution.Pipeline.PipelineTools.CoerceVariables(RequestContext context, VariableCoercionHelper coercionHelper, IReadOnlyList`1 variableDefinitions, IExecutionDiagnosticEvents diagnosticEvents) in PipelineTools.cs\n at HotChocolate.Execution.Pipeline.OperationVariableCoercionMiddleware.InvokeAsync(RequestContext context) in OperationVariableCoercionMiddleware.cs\n at HotChocolate.Execution.Pipeline.SkipWarmupExecutionMiddleware.InvokeAsync(RequestContext context) in SkipWarmupExecutionMiddleware.cs\n at HotChocolate.Execution.Pipeline.OperationResolverMiddleware.InvokeAsync(RequestContext context) in OperationResolverMiddleware.cs\n at HotChocolate.Execution.Pipeline.OperationCacheMiddleware.InvokeAsync(RequestContext context) in OperationCacheMiddleware.cs\n at HotChocolate.Execution.Pipeline.DocumentValidationMiddleware.InvokeAsync(RequestContext context) in DocumentValidationMiddleware.cs\n at HotChocolate.Execution.Pipeline.DocumentParserMiddleware.InvokeAsync(RequestContext context) in DocumentParserMiddleware.cs\n at HotChocolate.Execution.Pipeline.DocumentCacheMiddleware.InvokeAsync(RequestContext context) in DocumentCacheMiddleware.cs\n at HotChocolate.Execution.Pipeline.TimeoutMiddleware.InvokeAsync(RequestContext context) in TimeoutMiddleware.cs\n at HotChocolate.Execution.Pipeline.ExceptionMiddleware.InvokeAsync(RequestContext context) in ExceptionMiddleware.cs" + }, + { + "Key": "exception.type", + "Value": "HotChocolate.Types.LeafCoercionException" + } + ] + }, + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Mood cannot coerce the given value JSON element of type `String` to a runtime value." + }, + { + "Key": "graphql.field.path", + "Value": "mood" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "exception.type", + "Value": "System.FormatException" + }, + { + "Key": "exception.message", + "Value": "'happy' is not a recognized mood." + }, + { + "Key": "exception.stacktrace", + "Value": "System.FormatException: 'happy' is not a recognized mood.\n at HotChocolate.Diagnostics.ActivityExecutionDiagnosticListenerTests.MoodScalarType.OnCoerceInputValue(JsonElement inputValue, IFeatureProvider context) in ActivityExecutionDiagnosticListenerTests.cs\n at HotChocolate.Types.ScalarType`2.CoerceInputValue(JsonElement inputValue, IFeatureProvider context) in ScalarType~2.cs" + } + ] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "error.type", + "Value": "EXECUTION_ERROR" + } + ], + "event": [] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Get_SDL_Download_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Get_SDL_Download_NET11_0.snap new file mode 100644 index 00000000000..91745d8716d --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Get_SDL_Download_NET11_0.snap @@ -0,0 +1,71 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "GET /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "GET" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "url.query", + "Value": "?sdl" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP GET SDL", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpGetSchema" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + } + ], + "event": [] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Get_SingleRequest_GetHeroName_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Get_SingleRequest_GetHeroName_NET11_0.snap new file mode 100644 index 00000000000..26c08692057 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Get_SingleRequest_GetHeroName_NET11_0.snap @@ -0,0 +1,252 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "GET /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "GET" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "url.query", + "Value": "?query=Redacted" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP GET", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpGet" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "a570a6bff748b5916eadf153261d9c6d" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Complexity Analysis", + "DisplayName": "GraphQL Complexity Analysis", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + }, + { + "Key": "graphql.operation.fieldCost", + "Value": 1.0 + }, + { + "Key": "graphql.operation.typeCost", + "Value": 2.0 + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Query.hero", + "DisplayName": "Query.hero", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "hero" + }, + { + "Key": "graphql.field.path", + "Value": "hero" + }, + { + "Key": "graphql.field.name", + "Value": "hero" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.hero" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity_NET11_0.snap new file mode 100644 index 00000000000..9d15c96efdb --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity_NET11_0.snap @@ -0,0 +1,277 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "1d4bca4d0dff630390ddf48e9085589d" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "1d4bca4d0dff630390ddf48e9085589d" + }, + { + "Key": "graphql.http.request.variables", + "Value": "{\"episode\":\"NEW_HOPE\"}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Complexity Analysis", + "DisplayName": "GraphQL Complexity Analysis", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + }, + { + "Key": "graphql.operation.fieldCost", + "Value": 1.0 + }, + { + "Key": "graphql.operation.typeCost", + "Value": 2.0 + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Query.hero", + "DisplayName": "Query.hero", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "hero" + }, + { + "Key": "graphql.field.path", + "Value": "hero" + }, + { + "Key": "graphql.field.name", + "Value": "hero" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.hero" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Capture_Deferred_Response_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Capture_Deferred_Response_NET11_0.snap new file mode 100644 index 00000000000..bc4b0a95b57 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Capture_Deferred_Response_NET11_0.snap @@ -0,0 +1,277 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "dd31323224a6428d4dc301134352aeab" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "dd31323224a6428d4dc301134352aeab" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:3beaca4ee1714ac9c9dfec8e445529df" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:3beaca4ee1714ac9c9dfec8e445529df" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Complexity Analysis", + "DisplayName": "GraphQL Complexity Analysis", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:3beaca4ee1714ac9c9dfec8e445529df" + }, + { + "Key": "graphql.operation.fieldCost", + "Value": 1.0 + }, + { + "Key": "graphql.operation.typeCost", + "Value": 2.0 + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:3beaca4ee1714ac9c9dfec8e445529df" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:3beaca4ee1714ac9c9dfec8e445529df" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Query.hero", + "DisplayName": "Query.hero", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "hero" + }, + { + "Key": "graphql.field.path", + "Value": "hero" + }, + { + "Key": "graphql.field.name", + "Value": "hero" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.hero" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + }, + { + "OperationName": "Droid.id", + "DisplayName": "Droid.id", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "id" + }, + { + "Key": "graphql.field.path", + "Value": "hero.id" + }, + { + "Key": "graphql.field.name", + "Value": "id" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Droid.id" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Droid" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Ensure_List_Path_Is_Correctly_Built_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Ensure_List_Path_Is_Correctly_Built_NET11_0.snap new file mode 100644 index 00000000000..175e43b9c8f --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Ensure_List_Path_Is_Correctly_Built_NET11_0.snap @@ -0,0 +1,384 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "c0513b4b6f0cf7430f64de4aa3dcd7c6" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "c0513b4b6f0cf7430f64de4aa3dcd7c6" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:668e9631148921208d08dbb69513fa8e" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:668e9631148921208d08dbb69513fa8e" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Complexity Analysis", + "DisplayName": "GraphQL Complexity Analysis", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:668e9631148921208d08dbb69513fa8e" + }, + { + "Key": "graphql.operation.fieldCost", + "Value": 23.0 + }, + { + "Key": "graphql.operation.typeCost", + "Value": 6.0 + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:668e9631148921208d08dbb69513fa8e" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:668e9631148921208d08dbb69513fa8e" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Query.hero", + "DisplayName": "Query.hero", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "hero" + }, + { + "Key": "graphql.field.path", + "Value": "hero" + }, + { + "Key": "graphql.field.name", + "Value": "hero" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.hero" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + }, + { + "OperationName": "Droid.friends", + "DisplayName": "Droid.friends", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "friends" + }, + { + "Key": "graphql.field.path", + "Value": "hero.friends" + }, + { + "Key": "graphql.field.name", + "Value": "friends" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Droid.friends" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Droid" + } + ], + "event": [] + }, + { + "OperationName": "Human.friends", + "DisplayName": "Human.friends", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "friends" + }, + { + "Key": "graphql.field.path", + "Value": "hero.friends.nodes[0].friends" + }, + { + "Key": "graphql.field.name", + "Value": "friends" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Human.friends" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Human" + } + ], + "event": [] + }, + { + "OperationName": "Human.friends", + "DisplayName": "Human.friends", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "friends" + }, + { + "Key": "graphql.field.path", + "Value": "hero.friends.nodes[1].friends" + }, + { + "Key": "graphql.field.name", + "Value": "friends" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Human.friends" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Human" + } + ], + "event": [] + }, + { + "OperationName": "Human.friends", + "DisplayName": "Human.friends", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "friends" + }, + { + "Key": "graphql.field.path", + "Value": "hero.friends.nodes[2].friends" + }, + { + "Key": "graphql.field.name", + "Value": "friends" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Human.friends" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Human" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Parser_Error_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Parser_Error_NET11_0.snap new file mode 100644 index 00000000000..78f78df7cc5 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Parser_Error_NET11_0.snap @@ -0,0 +1,113 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 400 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "error.type", + "Value": "HC0011" + } + ], + "event": [ + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Found a NameStart character `n` (110) following a number, which is disallowed." + }, + { + "Key": "graphql.error.code", + "Value": "HC0011" + }, + { + "Key": "graphql.document.locations", + "Value": [ + { + "line": 10, + "column": 37 + } + ] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_Default_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_Default_NET11_0.snap new file mode 100644 index 00000000000..e98b4779847 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_Default_NET11_0.snap @@ -0,0 +1,197 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "a570a6bff748b5916eadf153261d9c6d" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "a570a6bff748b5916eadf153261d9c6d" + }, + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "Query.hero", + "DisplayName": "Query.hero", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "hero" + }, + { + "Key": "graphql.field.path", + "Value": "hero" + }, + { + "Key": "graphql.field.name", + "Value": "hero" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.hero" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_NET11_0.snap new file mode 100644 index 00000000000..dba37509e06 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_SingleRequest_GetHeroName_NET11_0.snap @@ -0,0 +1,252 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "a570a6bff748b5916eadf153261d9c6d" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "a570a6bff748b5916eadf153261d9c6d" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Complexity Analysis", + "DisplayName": "GraphQL Complexity Analysis", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + }, + { + "Key": "graphql.operation.fieldCost", + "Value": 1.0 + }, + { + "Key": "graphql.operation.typeCost", + "Value": 2.0 + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Query.hero", + "DisplayName": "Query.hero", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "hero" + }, + { + "Key": "graphql.field.path", + "Value": "hero" + }, + { + "Key": "graphql.field.name", + "Value": "hero" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.hero" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities_NET11_0.snap new file mode 100644 index 00000000000..353cfc03d2a --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities_NET11_0.snap @@ -0,0 +1,273 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "1d4bca4d0dff630390ddf48e9085589d" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "1d4bca4d0dff630390ddf48e9085589d" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Complexity Analysis", + "DisplayName": "GraphQL Complexity Analysis", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + }, + { + "Key": "graphql.operation.fieldCost", + "Value": 1.0 + }, + { + "Key": "graphql.operation.typeCost", + "Value": 2.0 + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Query.hero", + "DisplayName": "Query.hero", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "hero" + }, + { + "Key": "graphql.field.path", + "Value": "hero" + }, + { + "Key": "graphql.field.name", + "Value": "hero" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.hero" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map_NET11_0.snap new file mode 100644 index 00000000000..cb2b4e311d4 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map_NET11_0.snap @@ -0,0 +1,277 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "1d4bca4d0dff630390ddf48e9085589d" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "1d4bca4d0dff630390ddf48e9085589d" + }, + { + "Key": "graphql.http.request.extensions", + "Value": "{\"test\":\"abc\"}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Complexity Analysis", + "DisplayName": "GraphQL Complexity Analysis", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + }, + { + "Key": "graphql.operation.fieldCost", + "Value": 1.0 + }, + { + "Key": "graphql.operation.typeCost", + "Value": 2.0 + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cc68dfd8c0c54a586a03c35296c5d1f9" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Query.hero", + "DisplayName": "Query.hero", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "hero" + }, + { + "Key": "graphql.field.path", + "Value": "hero" + }, + { + "Key": "graphql.field.name", + "Value": "hero" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.hero" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails_NET11_0.snap new file mode 100644 index 00000000000..859c3fd4e07 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails_NET11_0.snap @@ -0,0 +1,301 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "b45805c675e9fff20b0367e5ff31735f" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "b45805c675e9fff20b0367e5ff31735f" + }, + { + "Key": "graphql.http.request.query.body", + "Value": "query GetHero($episode: Episode!) {\n hero(episode: $episode) {\n name\n }\n}" + }, + { + "Key": "graphql.http.request.variables", + "Value": "{\"episode\":\"NEW_HOPE\"}" + }, + { + "Key": "graphql.http.request.extensions", + "Value": "{\"test\":\"abc\"}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetHero" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:9335388c19fd2e230b6294a596d13a93" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:9335388c19fd2e230b6294a596d13a93" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Complexity Analysis", + "DisplayName": "GraphQL Complexity Analysis", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:9335388c19fd2e230b6294a596d13a93" + }, + { + "Key": "graphql.operation.fieldCost", + "Value": 1.0 + }, + { + "Key": "graphql.operation.typeCost", + "Value": 2.0 + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:9335388c19fd2e230b6294a596d13a93" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetHero" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetHero" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:9335388c19fd2e230b6294a596d13a93" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetHero" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:9335388c19fd2e230b6294a596d13a93" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Query.hero", + "DisplayName": "Query.hero", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "hero" + }, + { + "Key": "graphql.field.path", + "Value": "hero" + }, + { + "Key": "graphql.field.name", + "Value": "hero" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.hero" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions_NET11_0.snap new file mode 100644 index 00000000000..81a757e0b76 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions_NET11_0.snap @@ -0,0 +1,268 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "029e67e1b2d8493b3dd23fdaf6545b03" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "029e67e1b2d8493b3dd23fdaf6545b03" + }, + { + "Key": "graphql.http.request.extensions", + "Value": "{\"test\":\"abc\"}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetHero" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:06731ff10fea3ec8e9b2aabceee6ddd9" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:06731ff10fea3ec8e9b2aabceee6ddd9" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Complexity Analysis", + "DisplayName": "GraphQL Complexity Analysis", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:06731ff10fea3ec8e9b2aabceee6ddd9" + }, + { + "Key": "graphql.operation.fieldCost", + "Value": 1.0 + }, + { + "Key": "graphql.operation.typeCost", + "Value": 2.0 + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:06731ff10fea3ec8e9b2aabceee6ddd9" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetHero" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetHero" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:06731ff10fea3ec8e9b2aabceee6ddd9" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Query.hero", + "DisplayName": "Query.hero", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "hero" + }, + { + "Key": "graphql.field.path", + "Value": "hero" + }, + { + "Key": "graphql.field.name", + "Value": "hero" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.hero" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag_NET11_0.snap new file mode 100644 index 00000000000..ac1ddd46c3b --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag_NET11_0.snap @@ -0,0 +1,248 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.body", + "Value": "{\n hero {\n name\n }\n}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Complexity Analysis", + "DisplayName": "GraphQL Complexity Analysis", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + }, + { + "Key": "graphql.operation.fieldCost", + "Value": 1.0 + }, + { + "Key": "graphql.operation.typeCost", + "Value": 2.0 + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:acb8d5d513c260b3cef3e3a12b0e29af" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Query.hero", + "DisplayName": "Query.hero", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "hero" + }, + { + "Key": "graphql.field.path", + "Value": "hero" + }, + { + "Key": "graphql.field.name", + "Value": "hero" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.hero" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails_NET11_0.snap new file mode 100644 index 00000000000..dc9b8ca767e --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails_NET11_0.snap @@ -0,0 +1,277 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetHero" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:9335388c19fd2e230b6294a596d13a93" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:9335388c19fd2e230b6294a596d13a93" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Complexity Analysis", + "DisplayName": "GraphQL Complexity Analysis", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:9335388c19fd2e230b6294a596d13a93" + }, + { + "Key": "graphql.operation.fieldCost", + "Value": 1.0 + }, + { + "Key": "graphql.operation.typeCost", + "Value": 2.0 + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:9335388c19fd2e230b6294a596d13a93" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetHero" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetHero" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:9335388c19fd2e230b6294a596d13a93" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetHero" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:9335388c19fd2e230b6294a596d13a93" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Query.hero", + "DisplayName": "Query.hero", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "hero" + }, + { + "Key": "graphql.field.path", + "Value": "hero" + }, + { + "Key": "graphql.field.name", + "Value": "hero" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.hero" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_CallTool_Field_Does_Not_Exist_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_CallTool_Field_Does_Not_Exist_NET11_0.snap new file mode 100644 index 00000000000..bd117c31a73 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_CallTool_Field_Does_Not_Exist_NET11_0.snap @@ -0,0 +1,136 @@ +{ + "source": { + "name": "Experimental.ModelContextProtocol" + }, + "activities": [ + { + "OperationName": "tools/call invalid_graphql_query", + "DisplayName": "tools/call invalid_graphql_query", + "Kind": "Client", + "Status": "Error", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "tools/call" + }, + { + "Key": "network.transport", + "Value": "unknown" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.tool.name", + "Value": "invalid_graphql_query" + }, + { + "Key": "gen_ai.operation.name", + "Value": "execute_tool" + }, + { + "Key": "error.type", + "Value": "tool_error" + } + ], + "event": [], + "activities": [ + { + "OperationName": "tools/call invalid_graphql_query", + "DisplayName": "tools/call invalid_graphql_query", + "Kind": "Server", + "Status": "Error", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "tools/call" + }, + { + "Key": "network.transport", + "Value": "tcp" + }, + { + "Key": "network.protocol.name", + "Value": "http" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.tool.name", + "Value": "invalid_graphql_query" + }, + { + "Key": "gen_ai.operation.name", + "Value": "execute_tool" + }, + { + "Key": "error.type", + "Value": "tool_error" + } + ], + "event": [] + } + ] + }, + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/mcp/", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql/mcp" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/mcp/" + } + ], + "event": [] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_CallTool_GraphQL_Field_Error_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_CallTool_GraphQL_Field_Error_NET11_0.snap new file mode 100644 index 00000000000..e8ba0fd6757 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_CallTool_GraphQL_Field_Error_NET11_0.snap @@ -0,0 +1,298 @@ +{ + "source": { + "name": "Experimental.ModelContextProtocol" + }, + "activities": [ + { + "OperationName": "tools/call get_faulty_book", + "DisplayName": "tools/call get_faulty_book", + "Kind": "Client", + "Status": "Error", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "tools/call" + }, + { + "Key": "network.transport", + "Value": "unknown" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.tool.name", + "Value": "get_faulty_book" + }, + { + "Key": "gen_ai.operation.name", + "Value": "execute_tool" + }, + { + "Key": "error.type", + "Value": "tool_error" + } + ], + "event": [], + "activities": [ + { + "OperationName": "tools/call get_faulty_book", + "DisplayName": "tools/call get_faulty_book", + "Kind": "Server", + "Status": "Error", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "tools/call" + }, + { + "Key": "network.transport", + "Value": "tcp" + }, + { + "Key": "network.protocol.name", + "Value": "http" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.tool.name", + "Value": "get_faulty_book" + }, + { + "Key": "gen_ai.operation.name", + "Value": "execute_tool" + }, + { + "Key": "error.type", + "Value": "tool_error" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + }, + { + "Key": "graphql.error.count", + "Value": 1 + }, + { + "Key": "error.type", + "Value": "EXECUTION_ERROR" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + }, + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Something went wrong" + }, + { + "Key": "graphql.field.path", + "Value": "faultyBook" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + } + ] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + } + ], + "event": [] + }, + { + "OperationName": "Query.faultyBook", + "DisplayName": "Query.faultyBook", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "faultyBook" + }, + { + "Key": "graphql.field.path", + "Value": "faultyBook" + }, + { + "Key": "graphql.field.name", + "Value": "faultyBook" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.faultyBook" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + }, + { + "Key": "error.type", + "Value": "EXECUTION_ERROR" + } + ], + "event": [] + } + ] + } + ] + } + ] + }, + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/mcp/", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql/mcp" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/mcp/" + } + ], + "event": [] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_CallTool_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_CallTool_NET11_0.snap new file mode 100644 index 00000000000..798d4e34b08 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_CallTool_NET11_0.snap @@ -0,0 +1,253 @@ +{ + "source": { + "name": "Experimental.ModelContextProtocol" + }, + "activities": [ + { + "OperationName": "tools/call get_book", + "DisplayName": "tools/call get_book", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "tools/call" + }, + { + "Key": "network.transport", + "Value": "unknown" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.tool.name", + "Value": "get_book" + }, + { + "Key": "gen_ai.operation.name", + "Value": "execute_tool" + } + ], + "event": [], + "activities": [ + { + "OperationName": "tools/call get_book", + "DisplayName": "tools/call get_book", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "tools/call" + }, + { + "Key": "network.transport", + "Value": "tcp" + }, + { + "Key": "network.protocol.name", + "Value": "http" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.tool.name", + "Value": "get_book" + }, + { + "Key": "gen_ai.operation.name", + "Value": "execute_tool" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetBook" + } + ], + "event": [] + }, + { + "OperationName": "Query.book", + "DisplayName": "Query.book", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "book" + }, + { + "Key": "graphql.field.path", + "Value": "book" + }, + { + "Key": "graphql.field.name", + "Value": "book" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.book" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + } + ] + } + ] + } + ] + }, + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/mcp/", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql/mcp" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/mcp/" + } + ], + "event": [] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_CallTool_Tool_Does_Not_Exist_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_CallTool_Tool_Does_Not_Exist_NET11_0.snap new file mode 100644 index 00000000000..4a92227ceab --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_CallTool_Tool_Does_Not_Exist_NET11_0.snap @@ -0,0 +1,136 @@ +{ + "source": { + "name": "Experimental.ModelContextProtocol" + }, + "activities": [ + { + "OperationName": "tools/call does_not_exist", + "DisplayName": "tools/call does_not_exist", + "Kind": "Client", + "Status": "Error", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "tools/call" + }, + { + "Key": "network.transport", + "Value": "unknown" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.tool.name", + "Value": "does_not_exist" + }, + { + "Key": "gen_ai.operation.name", + "Value": "execute_tool" + }, + { + "Key": "error.type", + "Value": "tool_error" + } + ], + "event": [], + "activities": [ + { + "OperationName": "tools/call does_not_exist", + "DisplayName": "tools/call does_not_exist", + "Kind": "Server", + "Status": "Error", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "tools/call" + }, + { + "Key": "network.transport", + "Value": "tcp" + }, + { + "Key": "network.protocol.name", + "Value": "http" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.tool.name", + "Value": "does_not_exist" + }, + { + "Key": "gen_ai.operation.name", + "Value": "execute_tool" + }, + { + "Key": "error.type", + "Value": "tool_error" + } + ], + "event": [] + } + ] + }, + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/mcp/", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql/mcp" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/mcp/" + } + ], + "event": [] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_GetPrompt_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_GetPrompt_NET11_0.snap new file mode 100644 index 00000000000..85a7dca7f16 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/McpAdapterActivityTests.Mcp_GetPrompt_NET11_0.snap @@ -0,0 +1,120 @@ +{ + "source": { + "name": "Experimental.ModelContextProtocol" + }, + "activities": [ + { + "OperationName": "prompts/get greeting", + "DisplayName": "prompts/get greeting", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "prompts/get" + }, + { + "Key": "network.transport", + "Value": "unknown" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.prompt.name", + "Value": "greeting" + } + ], + "event": [], + "activities": [ + { + "OperationName": "prompts/get greeting", + "DisplayName": "prompts/get greeting", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "prompts/get" + }, + { + "Key": "network.transport", + "Value": "tcp" + }, + { + "Key": "network.protocol.name", + "Value": "http" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.prompt.name", + "Value": "greeting" + } + ], + "event": [] + } + ] + }, + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/mcp/", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql/mcp" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/mcp/" + } + ], + "event": [] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/OpenApiAdapterActivityTests.Http_Get_OpenApi_Endpoint_Does_Not_Exist_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/OpenApiAdapterActivityTests.Http_Get_OpenApi_Endpoint_Does_Not_Exist_NET11_0.snap new file mode 100644 index 00000000000..e4174f05fc8 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/OpenApiAdapterActivityTests.Http_Get_OpenApi_Endpoint_Does_Not_Exist_NET11_0.snap @@ -0,0 +1,44 @@ +{ + "source": { + "name": "Microsoft.AspNetCore" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "GET", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "GET" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/does-not-exist" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 404 + } + ], + "event": [] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/OpenApiAdapterActivityTests.Http_Get_OpenApi_Field_Does_Not_Exist_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/OpenApiAdapterActivityTests.Http_Get_OpenApi_Field_Does_Not_Exist_NET11_0.snap new file mode 100644 index 00000000000..846a1ecdde8 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/OpenApiAdapterActivityTests.Http_Get_OpenApi_Field_Does_Not_Exist_NET11_0.snap @@ -0,0 +1,52 @@ +{ + "source": { + "name": "Microsoft.AspNetCore" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "GET /invalid-graphql-query", + "Kind": "Server", + "Status": "Error", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "GET" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/invalid-graphql-query" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 500 + }, + { + "Key": "http.route", + "Value": "/invalid-graphql-query" + }, + { + "Key": "error.type", + "Value": "500" + } + ], + "event": [] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/OpenApiAdapterActivityTests.Http_Get_OpenApi_GraphQL_Field_Error_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/OpenApiAdapterActivityTests.Http_Get_OpenApi_GraphQL_Field_Error_NET11_0.snap new file mode 100644 index 00000000000..67b567d43d4 --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/OpenApiAdapterActivityTests.Http_Get_OpenApi_GraphQL_Field_Error_NET11_0.snap @@ -0,0 +1,214 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "GET /faulty-book", + "Kind": "Server", + "Status": "Error", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "GET" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/faulty-book" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 500 + }, + { + "Key": "http.route", + "Value": "/faulty-book" + }, + { + "Key": "error.type", + "Value": "500" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpGet" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + }, + { + "Key": "graphql.error.count", + "Value": 1 + }, + { + "Key": "error.type", + "Value": "EXECUTION_ERROR" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + }, + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Something went wrong" + }, + { + "Key": "graphql.field.path", + "Value": "faultyBook" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + } + ] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + } + ], + "event": [] + }, + { + "OperationName": "Query.faultyBook", + "DisplayName": "Query.faultyBook", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "faultyBook" + }, + { + "Key": "graphql.field.path", + "Value": "faultyBook" + }, + { + "Key": "graphql.field.name", + "Value": "faultyBook" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.faultyBook" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + }, + { + "Key": "error.type", + "Value": "EXECUTION_ERROR" + } + ], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/OpenApiAdapterActivityTests.Http_Get_OpenApi_NET11_0.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/OpenApiAdapterActivityTests.Http_Get_OpenApi_NET11_0.snap new file mode 100644 index 00000000000..356f426d6fc --- /dev/null +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/OpenApiAdapterActivityTests.Http_Get_OpenApi_NET11_0.snap @@ -0,0 +1,173 @@ +{ + "source": { + "name": "HotChocolate.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "GET /book", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "GET" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/book" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/book" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpGet" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + } + ], + "event": [ + { + "Name": "AddedOperationToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetBook" + } + ], + "event": [] + }, + { + "OperationName": "Query.book", + "DisplayName": "Query.book", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "resolve" + }, + { + "Key": "graphql.field.alias", + "Value": "book" + }, + { + "Key": "graphql.field.path", + "Value": "book" + }, + { + "Key": "graphql.field.name", + "Value": "book" + }, + { + "Key": "graphql.field.schema_coordinate", + "Value": "Query.book" + }, + { + "Key": "graphql.field.parent_type", + "Value": "Query" + } + ], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/benchmarks/Fusion.Execution.Benchmarks/HotChocolate.Fusion.Execution.Benchmarks.csproj b/src/HotChocolate/Fusion/benchmarks/Fusion.Execution.Benchmarks/HotChocolate.Fusion.Execution.Benchmarks.csproj index 28fd26ca919..993a472aba7 100644 --- a/src/HotChocolate/Fusion/benchmarks/Fusion.Execution.Benchmarks/HotChocolate.Fusion.Execution.Benchmarks.csproj +++ b/src/HotChocolate/Fusion/benchmarks/Fusion.Execution.Benchmarks/HotChocolate.Fusion.Execution.Benchmarks.csproj @@ -2,8 +2,8 @@ Exe - net10.0 - net10.0 + net11.0 + net11.0 true Preview HotChocolate.Fusion.Execution.Benchmarks diff --git a/src/HotChocolate/Fusion/benchmarks/k6/Directory.Build.props b/src/HotChocolate/Fusion/benchmarks/k6/Directory.Build.props index 404a1ca9f4d..5a34c7ed431 100644 --- a/src/HotChocolate/Fusion/benchmarks/k6/Directory.Build.props +++ b/src/HotChocolate/Fusion/benchmarks/k6/Directory.Build.props @@ -2,8 +2,8 @@ - net10.0 - net10.0 + net11.0 + net11.0 enable enable diff --git a/src/HotChocolate/Fusion/src/Fusion.Aspire/HotChocolate.Fusion.Aspire.csproj b/src/HotChocolate/Fusion/src/Fusion.Aspire/HotChocolate.Fusion.Aspire.csproj index 24cbbe0baaa..661335db124 100644 --- a/src/HotChocolate/Fusion/src/Fusion.Aspire/HotChocolate.Fusion.Aspire.csproj +++ b/src/HotChocolate/Fusion/src/Fusion.Aspire/HotChocolate.Fusion.Aspire.csproj @@ -3,7 +3,7 @@ HotChocolate.Fusion.Aspire HotChocolate.Fusion.Aspire - net10.0; net9.0 + net11.0; net10.0; net9.0 false diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/ActivityTestHelper.cs b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/ActivityTestHelper.cs index decfa658f58..41227663721 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/ActivityTestHelper.cs +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/ActivityTestHelper.cs @@ -12,6 +12,11 @@ public static partial class ActivityTestHelper private static partial Regex StackTracePathRegex(); [GeneratedRegex(@"lambda_method\d+", RegexOptions.CultureInvariant)] private static partial Regex LambdaMethodRegex(); + // Async resumption markers depend on whether an await completes synchronously, which the + // JIT decides differently under coverage instrumentation. Removing them keeps the snapshot + // stable regardless of those JIT/coverage differences. + [GeneratedRegex(@"\n--- End of stack trace from previous location ---", RegexOptions.CultureInvariant)] + private static partial Regex StackTraceResumptionMarkerRegex(); public static IDisposable CaptureActivities(out Capture activities) { @@ -83,6 +88,8 @@ public static IDisposable CaptureActivities(out Capture activities) return $" in {fileName}"; }); + scrubbedStackTrace = StackTraceResumptionMarkerRegex().Replace(scrubbedStackTrace, ""); + yield return new KeyValuePair( tag.Key, LambdaMethodRegex().Replace(scrubbedStackTrace, "lambda_method")); diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityExecutionDiagnosticListenerTests.cs b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityExecutionDiagnosticListenerTests.cs index c9705a5f6a3..f2fb5ff22ba 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityExecutionDiagnosticListenerTests.cs +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityExecutionDiagnosticListenerTests.cs @@ -6,6 +6,7 @@ using HotChocolate.Resolvers; using HotChocolate.Types; using Microsoft.Extensions.DependencyInjection; +using static CookieCrumble.TestEnvironment; using static HotChocolate.Fusion.Diagnostics.ActivityTestHelper; namespace HotChocolate.Fusion.Diagnostics; @@ -41,7 +42,7 @@ public async Task Track_Events_Of_A_Simple_Query_Default() await executor.ExecuteAsync(request, TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -76,7 +77,7 @@ public async Task Allow_Document_To_Be_Captured() await executor.ExecuteAsync(request, TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -146,7 +147,7 @@ public async Task Cause_A_Resolver_Error_That_Deletes_The_Whole_Result() await executor.ExecuteAsync(request, TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -182,7 +183,7 @@ public async Task Source_Schema_Transport_Error() await executor.ExecuteAsync(request, TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -219,7 +220,7 @@ public async Task Track_Events_Of_A_Query_With_Multiple_Sources() await executor.ExecuteAsync(request, TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -255,7 +256,7 @@ await executor.ExecuteAsync( TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -421,7 +422,7 @@ public async Task DefaultScopes_ExcludesExecuteRequestAndParseDocumentSpans() await executor.ExecuteAsync(request, TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -457,7 +458,7 @@ public async Task VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan() await executor.ExecuteAsync(request, TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -489,7 +490,7 @@ public async Task AllScopes_IncludesAllSpans() await executor.ExecuteAsync(request, TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -630,7 +631,7 @@ public async Task CustomScopes_OnlyValidateAndPlan_LimitsSpans() await executor.ExecuteAsync(request, TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -721,7 +722,7 @@ public async Task MultipleSources_SourceSchemaResolverError_RecordsDeeplyNestedE await executor.ExecuteAsync(request, TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -756,7 +757,7 @@ public async Task DocumentCache_SecondExecution_RecordsCacheHitEvent() await executor.ExecuteAsync(request, TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -801,7 +802,7 @@ public async Task SubscriptionEvent_Records_Subscription_Event_Span() } // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityServerDiagnosticListenerTests.cs b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityServerDiagnosticListenerTests.cs index bc2ccf84c87..73e55545046 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityServerDiagnosticListenerTests.cs +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionActivityServerDiagnosticListenerTests.cs @@ -2,6 +2,7 @@ using HotChocolate.Resolvers; using HotChocolate.Transport.Http; using Microsoft.Extensions.DependencyInjection; +using static CookieCrumble.TestEnvironment; using static HotChocolate.Fusion.Diagnostics.ActivityTestHelper; using OperationRequest = HotChocolate.Transport.OperationRequest; @@ -35,7 +36,7 @@ public async Task Http_Post_Single_Request_Default() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -63,7 +64,7 @@ public async Task Http_Post_Single_Request() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -91,7 +92,7 @@ public async Task Http_Get_Single_Request() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -125,7 +126,7 @@ public async Task Http_Post_Variables_Are_Not_Automatically_Added_To_Activities( await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -163,7 +164,7 @@ public async Task Http_Post_Add_Variables_To_Http_Activity() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -198,7 +199,7 @@ public async Task Http_Post_With_Extensions_Map() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -225,7 +226,7 @@ public async Task Http_Get_SDL_Download() // assert await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken); - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -265,7 +266,7 @@ public async Task Http_Post_Parser_Error() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -304,7 +305,7 @@ query GetGreeting($name: String!) { await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -343,7 +344,7 @@ query GetGreeting($name: String!) { await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -375,7 +376,7 @@ public async Task RequestDetails_DocumentOnly_IncludesDocumentTag() await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -409,7 +410,7 @@ query GetGreeting { await result.ReadAsResultAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionMcpAdapterActivityTests.cs b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionMcpAdapterActivityTests.cs index f0df4397d73..b52a3706e0e 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionMcpAdapterActivityTests.cs +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionMcpAdapterActivityTests.cs @@ -10,6 +10,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; +using static CookieCrumble.TestEnvironment; using static HotChocolate.Fusion.Diagnostics.ActivityTestHelper; namespace HotChocolate.Fusion.Diagnostics; @@ -31,7 +32,7 @@ public async Task Mcp_CallTool() await mcpClient.CallToolAsync("get_book", cancellationToken: TestContext.Current.CancellationToken); // assert - MatchActivitySnapshot(activities); + MatchActivitySnapshot(activities, Postfix([NET11_0])); } } @@ -87,7 +88,7 @@ public async Task Mcp_CallTool_GraphQL_Field_Error() await mcpClient.CallToolAsync("get_faulty_book", cancellationToken: TestContext.Current.CancellationToken); // assert - MatchActivitySnapshot(activities); + MatchActivitySnapshot(activities, Postfix([NET11_0])); } } @@ -112,7 +113,7 @@ public async Task Mcp_GetPrompt() [GeneratedRegex("""("Key": "mcp\.session\.id",\s*"Value": ")[^"]*(")""")] private static partial Regex SessionIdRegex(); - private static void MatchActivitySnapshot(object activities) + private static void MatchActivitySnapshot(object activities, string? postfix = null) { var serializer = JsonSerializer.Create( new JsonSerializerSettings { Converters = { new StringEnumConverter() } }); @@ -138,7 +139,7 @@ private static void MatchActivitySnapshot(object activities) // The MCP session id is randomly generated per run, scrub it so the snapshot is stable. json = SessionIdRegex().Replace(json, "$1$2"); - json.MatchSnapshot(); + json.MatchSnapshot(postfix); } private static PromptDefinition CreateGreetingPrompt() diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionOpenApiAdapterActivityTests.cs b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionOpenApiAdapterActivityTests.cs index 80c7e5c7992..62505f7eafc 100644 --- a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionOpenApiAdapterActivityTests.cs +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/FusionOpenApiAdapterActivityTests.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; +using static CookieCrumble.TestEnvironment; using static HotChocolate.Fusion.Diagnostics.ActivityTestHelper; namespace HotChocolate.Fusion.Diagnostics; @@ -37,7 +38,7 @@ query GetBook @http(method: GET, route: "/book") { await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -63,7 +64,7 @@ query GetMissing @http(method: GET, route: "/invalid-graphql-query") { await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -91,7 +92,7 @@ query GetBook @http(method: GET, route: "/book") { await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } @@ -119,7 +120,7 @@ query GetFaultyBook @http(method: GET, route: "/faulty-book") { await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken); // assert - activities.MatchSnapshot(); + activities.MatchSnapshot(Postfix([NET11_0])); } } diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.AllScopes_IncludesAllSpans_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.AllScopes_IncludesAllSpans_NET11_0.snap new file mode 100644 index 00000000000..040c3378c81 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.AllScopes_IncludesAllSpans_NET11_0.snap @@ -0,0 +1,232 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "f6d09983b9640d3dc20ac4774cc4e3cc75407a02d5135467b9ba3ec3d0fa7fbb" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_f7e9989f_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:35c1feb1208268226c7d5d5d0ae122e4d38cb79621e862b1e252d37fc83c530a" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Allow_Document_To_Be_Captured_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Allow_Document_To_Be_Captured_NET11_0.snap new file mode 100644 index 00000000000..b21a2e4b5a2 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Allow_Document_To_Be_Captured_NET11_0.snap @@ -0,0 +1,252 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloOperation" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6af18618ae20c266f6ffc352b78cb69b" + }, + { + "Key": "graphql.document.body", + "Value": "query SayHelloOperation {\n sayHello\n}" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:6af18618ae20c266f6ffc352b78cb69b" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6af18618ae20c266f6ffc352b78cb69b" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6af18618ae20c266f6ffc352b78cb69b" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloOperation" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloOperation" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6af18618ae20c266f6ffc352b78cb69b" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloOperation" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6af18618ae20c266f6ffc352b78cb69b" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "350468e4cc5182c2db3af1558b7e18d325546f77603413233fbe3940fa53cc86" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "SayHelloOperation_6af18618_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:80b0d05aefd2459dcda18d0e26977b91c512e4ef58ab3e4e8a82c1ec98249b58" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result_NET11_0.snap new file mode 100644 index 00000000000..1bde2edf751 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Cause_A_Resolver_Error_That_Deletes_The_Whole_Result_NET11_0.snap @@ -0,0 +1,293 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloOperation" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:851fb754d9ba6b5cc5a55ebcbea2621d" + }, + { + "Key": "graphql.document.body", + "Value": "query SayHelloOperation {\n causeFatalError\n}" + }, + { + "Key": "graphql.error.count", + "Value": 1 + }, + { + "Key": "error.type", + "Value": "CUSTOM_ERROR_CODE" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + }, + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "fail" + }, + { + "Key": "graphql.field.path", + "Value": "causeFatalError" + }, + { + "Key": "graphql.error.code", + "Value": "CUSTOM_ERROR_CODE" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloOperation" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:851fb754d9ba6b5cc5a55ebcbea2621d" + } + ] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:851fb754d9ba6b5cc5a55ebcbea2621d" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:851fb754d9ba6b5cc5a55ebcbea2621d" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:851fb754d9ba6b5cc5a55ebcbea2621d" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloOperation" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloOperation" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:851fb754d9ba6b5cc5a55ebcbea2621d" + }, + { + "Key": "error.type", + "Value": "CUSTOM_ERROR_CODE" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloOperation" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:851fb754d9ba6b5cc5a55ebcbea2621d" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "0603facae28091144394d7f12fe4398f22cd6f9d94884b9dd24086829a446e39" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "SayHelloOperation_851fb754_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:1b35e9142c2e8235f31d2b3ae0de3d2ba54692a7aa6481803c3841fd135f4c4c" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.CustomScopes_OnlyValidateAndPlan_LimitsSpans_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.CustomScopes_OnlyValidateAndPlan_LimitsSpans_NET11_0.snap new file mode 100644 index 00000000000..5a3300d7085 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.CustomScopes_OnlyValidateAndPlan_LimitsSpans_NET11_0.snap @@ -0,0 +1,117 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.DefaultScopes_ExcludesExecuteRequestAndParseDocumentSpans_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.DefaultScopes_ExcludesExecuteRequestAndParseDocumentSpans_NET11_0.snap new file mode 100644 index 00000000000..825461c4056 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.DefaultScopes_ExcludesExecuteRequestAndParseDocumentSpans_NET11_0.snap @@ -0,0 +1,164 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "f6d09983b9640d3dc20ac4774cc4e3cc75407a02d5135467b9ba3ec3d0fa7fbb" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_f7e9989f_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:35c1feb1208268226c7d5d5d0ae122e4d38cb79621e862b1e252d37fc83c530a" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.DocumentCache_SecondExecution_RecordsCacheHitEvent_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.DocumentCache_SecondExecution_RecordsCacheHitEvent_NET11_0.snap new file mode 100644 index 00000000000..56ed6f4599c --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.DocumentCache_SecondExecution_RecordsCacheHitEvent_NET11_0.snap @@ -0,0 +1,177 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [ + { + "Name": "RetrievedDocumentFromCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "f6d09983b9640d3dc20ac4774cc4e3cc75407a02d5135467b9ba3ec3d0fa7fbb" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_f7e9989f_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:35c1feb1208268226c7d5d5d0ae122e4d38cb79621e862b1e252d37fc83c530a" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.MultipleSources_SourceSchemaResolverError_RecordsDeeplyNestedError_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.MultipleSources_SourceSchemaResolverError_RecordsDeeplyNestedError_NET11_0.snap new file mode 100644 index 00000000000..d27c0665b3e --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.MultipleSources_SourceSchemaResolverError_RecordsDeeplyNestedError_NET11_0.snap @@ -0,0 +1,392 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:241c617bf9ec34fef187d8b149fd8498" + }, + { + "Key": "graphql.document.body", + "Value": "{\n sayHello\n deepB {\n deeperB {\n causeFatalError\n }\n }\n}" + }, + { + "Key": "graphql.error.count", + "Value": 1 + }, + { + "Key": "error.type", + "Value": "CUSTOM_ERROR_CODE" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + }, + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "deep fail" + }, + { + "Key": "graphql.field.path", + "Value": "deepB" + }, + { + "Key": "graphql.error.code", + "Value": "CUSTOM_ERROR_CODE" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:241c617bf9ec34fef187d8b149fd8498" + } + ] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:241c617bf9ec34fef187d8b149fd8498" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:241c617bf9ec34fef187d8b149fd8498" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:241c617bf9ec34fef187d8b149fd8498" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:241c617bf9ec34fef187d8b149fd8498" + }, + { + "Key": "error.type", + "Value": "CUSTOM_ERROR_CODE" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:241c617bf9ec34fef187d8b149fd8498" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "7e050d004b624ec0c905bfba84445a17dd0cc54657187f55d6c3b5ee61931c69" + }, + { + "Key": "graphql.source_schema.name", + "Value": "b" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_241c617b_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:7dfcb1cc48aa6c4d4750dc471f2f71b0c1acf70356383ea909d2c5994dc65d6f" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:241c617bf9ec34fef187d8b149fd8498" + }, + { + "Key": "graphql.operation.step.id", + "Value": "2" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "7e050d004b624ec0c905bfba84445a17dd0cc54657187f55d6c3b5ee61931c69" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_241c617b_2" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:23e6ec3292fdaf4949c838051e42d74bee6c27bed8b0720637c4b77d961f3ef3" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.PersistedOperation_LoadsFromStorage_DefaultScopes_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.PersistedOperation_LoadsFromStorage_DefaultScopes_NET11_0.snap new file mode 100644 index 00000000000..3c40f050ee6 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.PersistedOperation_LoadsFromStorage_DefaultScopes_NET11_0.snap @@ -0,0 +1,176 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.document.id", + "Value": "say-hello-persisted-id" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.document.id", + "Value": "say-hello-persisted-id" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.document.id", + "Value": "say-hello-persisted-id" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "f6d09983b9640d3dc20ac4774cc4e3cc75407a02d5135467b9ba3ec3d0fa7fbb" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_f7e9989f_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:35c1feb1208268226c7d5d5d0ae122e4d38cb79621e862b1e252d37fc83c530a" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Source_Schema_Transport_Error_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Source_Schema_Transport_Error_NET11_0.snap new file mode 100644 index 00000000000..fa77b8d4b31 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Source_Schema_Transport_Error_NET11_0.snap @@ -0,0 +1,265 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloQuery" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:b3cf9afa2200bfa14e2a67e36d17e933" + }, + { + "Key": "graphql.document.body", + "Value": "query SayHelloQuery {\n sayHello\n}" + }, + { + "Key": "graphql.error.count", + "Value": 1 + }, + { + "Key": "error.type", + "Value": "System.Net.Http.HttpRequestException" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + }, + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Unexpected Execution Error" + }, + { + "Key": "graphql.field.path", + "Value": "sayHello" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloQuery" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:b3cf9afa2200bfa14e2a67e36d17e933" + }, + { + "Key": "exception.type", + "Value": "System.Net.Http.HttpRequestException" + }, + { + "Key": "exception.message", + "Value": "Response status code does not indicate success: 500 (Internal Server Error)." + }, + { + "Key": "exception.stacktrace", + "Value": "System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).\n at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()\n at HotChocolate.Fusion.Transport.Http.GraphQLHttpResponse.ReadAsResultAsync(IMemoryArena arena, CancellationToken cancellationToken) in GraphQLHttpResponse.cs\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.ReadAsResultStreamAsync(OperationPlanContext context, ImmutableArray`1 variables, GraphQLHttpResponse response, CancellationToken cancellationToken)+MoveNext() in HttpSourceSchemaClient.cs\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.ReadAsResultStreamAsync(OperationPlanContext context, ImmutableArray`1 variables, GraphQLHttpResponse response, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.WithResultCallback(IAsyncEnumerable`1 results, OperationPlanContext context, ExecutionNode node, Action`3 onSourceSchemaResult, CancellationToken cancellationToken)+MoveNext() in HttpSourceSchemaClient.cs\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.WithResultCallback(IAsyncEnumerable`1 results, OperationPlanContext context, ExecutionNode node, Action`3 onSourceSchemaResult, CancellationToken cancellationToken)+MoveNext() in HttpSourceSchemaClient.cs\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.WithResultCallback(IAsyncEnumerable`1 results, OperationPlanContext context, ExecutionNode node, Action`3 onSourceSchemaResult, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.ExecuteAsync(OperationPlanContext context, SourceSchemaClientRequest request, CancellationToken cancellationToken)+MoveNext() in HttpSourceSchemaClient.cs\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.ExecuteAsync(OperationPlanContext context, SourceSchemaClientRequest request, CancellationToken cancellationToken)+MoveNext() in HttpSourceSchemaClient.cs\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.ExecuteAsync(OperationPlanContext context, SourceSchemaClientRequest request, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()\n at HotChocolate.Fusion.Execution.Nodes.OperationExecutionNode.OnExecuteAsync(OperationPlanContext context, CancellationToken cancellationToken) in OperationExecutionNode.cs\n at HotChocolate.Fusion.Execution.Nodes.OperationExecutionNode.OnExecuteAsync(OperationPlanContext context, CancellationToken cancellationToken) in OperationExecutionNode.cs" + } + ] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:b3cf9afa2200bfa14e2a67e36d17e933" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:b3cf9afa2200bfa14e2a67e36d17e933" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:b3cf9afa2200bfa14e2a67e36d17e933" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloQuery" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloQuery" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:b3cf9afa2200bfa14e2a67e36d17e933" + }, + { + "Key": "error.type", + "Value": "System.Net.Http.HttpRequestException" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloQuery" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:b3cf9afa2200bfa14e2a67e36d17e933" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "28c3e8f816706daf288091936d3937e2b3e7e7eb19b3cb8dc3b506c202b5aa67" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "SayHelloQuery_b3cf9afa_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:4ccd60434973fb8605a668347b5f8707d89fd9caeb1ff20d8f3e4f21476e8d81" + }, + { + "Key": "error.type", + "Value": "System.Net.Http.HttpRequestException" + } + ], + "event": [ + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Response status code does not indicate success: 500 (Internal Server Error)." + }, + { + "Key": "exception.type", + "Value": "System.Net.Http.HttpRequestException" + }, + { + "Key": "exception.message", + "Value": "Response status code does not indicate success: 500 (Internal Server Error)." + }, + { + "Key": "exception.stacktrace", + "Value": "System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).\n at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()\n at HotChocolate.Fusion.Transport.Http.GraphQLHttpResponse.ReadAsResultAsync(IMemoryArena arena, CancellationToken cancellationToken) in GraphQLHttpResponse.cs\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.ReadAsResultStreamAsync(OperationPlanContext context, ImmutableArray`1 variables, GraphQLHttpResponse response, CancellationToken cancellationToken)+MoveNext() in HttpSourceSchemaClient.cs\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.ReadAsResultStreamAsync(OperationPlanContext context, ImmutableArray`1 variables, GraphQLHttpResponse response, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.WithResultCallback(IAsyncEnumerable`1 results, OperationPlanContext context, ExecutionNode node, Action`3 onSourceSchemaResult, CancellationToken cancellationToken)+MoveNext() in HttpSourceSchemaClient.cs\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.WithResultCallback(IAsyncEnumerable`1 results, OperationPlanContext context, ExecutionNode node, Action`3 onSourceSchemaResult, CancellationToken cancellationToken)+MoveNext() in HttpSourceSchemaClient.cs\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.WithResultCallback(IAsyncEnumerable`1 results, OperationPlanContext context, ExecutionNode node, Action`3 onSourceSchemaResult, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.ExecuteAsync(OperationPlanContext context, SourceSchemaClientRequest request, CancellationToken cancellationToken)+MoveNext() in HttpSourceSchemaClient.cs\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.ExecuteAsync(OperationPlanContext context, SourceSchemaClientRequest request, CancellationToken cancellationToken)+MoveNext() in HttpSourceSchemaClient.cs\n at HotChocolate.Fusion.Execution.Clients.HttpSourceSchemaClient.ExecuteAsync(OperationPlanContext context, SourceSchemaClientRequest request, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()\n at HotChocolate.Fusion.Execution.Nodes.OperationExecutionNode.OnExecuteAsync(OperationPlanContext context, CancellationToken cancellationToken) in OperationExecutionNode.cs\n at HotChocolate.Fusion.Execution.Nodes.OperationExecutionNode.OnExecuteAsync(OperationPlanContext context, CancellationToken cancellationToken) in OperationExecutionNode.cs" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "SayHelloQuery" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:b3cf9afa2200bfa14e2a67e36d17e933" + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span_NET11_0.snap new file mode 100644 index 00000000000..c24fc98e2c5 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.SubscriptionEvent_Records_Subscription_Event_Span_NET11_0.snap @@ -0,0 +1,275 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "subscription", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "graphql.operation.type", + "Value": "subscription" + }, + { + "Key": "graphql.operation.name", + "Value": "OnMessageSubscription" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:ef859b98c9d8c17038c8fd9aeecdb1e2" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:ef859b98c9d8c17038c8fd9aeecdb1e2" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:ef859b98c9d8c17038c8fd9aeecdb1e2" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:ef859b98c9d8c17038c8fd9aeecdb1e2" + }, + { + "Key": "graphql.operation.type", + "Value": "subscription" + }, + { + "Key": "graphql.operation.name", + "Value": "OnMessageSubscription" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "subscription" + }, + { + "Key": "graphql.operation.name", + "Value": "OnMessageSubscription" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:ef859b98c9d8c17038c8fd9aeecdb1e2" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "subscription" + }, + { + "Key": "graphql.operation.name", + "Value": "OnMessageSubscription" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:ef859b98c9d8c17038c8fd9aeecdb1e2" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "99ac66222461a285be3d03f60e60dd5cb63990ed42e28cc8e7f1dacc35ed429a" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "OnMessageSubscription_ef859b98_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:f9abddbb651ad8e118793eb7c4a7c8db7fe43cae95faba710a0ff35b26b17136" + } + ], + "event": [] + } + ] + }, + { + "OperationName": "GraphQL Subscription Event", + "DisplayName": "GraphQL Subscription Event", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "subscription_event" + }, + { + "Key": "graphql.operation.type", + "Value": "subscription" + }, + { + "Key": "graphql.operation.name", + "Value": "OnMessageSubscription" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:ef859b98c9d8c17038c8fd9aeecdb1e2" + }, + { + "Key": "graphql.subscription.id", + "Value": "1" + } + ], + "event": [] + } + ] + }, + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Track_Events_Of_A_Query_With_Multiple_Sources_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Track_Events_Of_A_Query_With_Multiple_Sources_NET11_0.snap new file mode 100644 index 00000000000..fb63620df39 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Track_Events_Of_A_Query_With_Multiple_Sources_NET11_0.snap @@ -0,0 +1,351 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:073bf7696c078e52587c88890ef21bbe" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:073bf7696c078e52587c88890ef21bbe" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:073bf7696c078e52587c88890ef21bbe" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:073bf7696c078e52587c88890ef21bbe" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:073bf7696c078e52587c88890ef21bbe" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:073bf7696c078e52587c88890ef21bbe" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "705a22da1ff57dc3647c63b657d8c9a64922ea6bd90d3009ea51765837161df8" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_073bf769_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:b6db85f78e867baa06bf8b4f45ed381a2b6bc9f7abd15948f0bfff0967fbc308" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:073bf7696c078e52587c88890ef21bbe" + }, + { + "Key": "graphql.operation.step.id", + "Value": "2" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "705a22da1ff57dc3647c63b657d8c9a64922ea6bd90d3009ea51765837161df8" + }, + { + "Key": "graphql.source_schema.name", + "Value": "b" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_073bf769_2" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:1fa50769ad5084334414d5ceb8029c7787ded48ac5cc01dac775b0b814348e88" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Track_Events_Of_A_Simple_Query_Default_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Track_Events_Of_A_Simple_Query_Default_NET11_0.snap new file mode 100644 index 00000000000..825461c4056 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.Track_Events_Of_A_Simple_Query_Default_NET11_0.snap @@ -0,0 +1,164 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "f6d09983b9640d3dc20ac4774cc4e3cc75407a02d5135467b9ba3ec3d0fa7fbb" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_f7e9989f_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:35c1feb1208268226c7d5d5d0ae122e4d38cb79621e862b1e252d37fc83c530a" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan_NET11_0.snap new file mode 100644 index 00000000000..46c2d0fb610 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityExecutionDiagnosticListenerTests.VariableCoercion_FailingScalar_RecordsErrorOnCoercionSpan_NET11_0.snap @@ -0,0 +1,286 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "graphql.error.count", + "Value": 1 + }, + { + "Key": "error.type", + "Value": "EXECUTION_ERROR" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + }, + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Mood cannot coerce the given value JSON element of type `String` to a runtime value." + }, + { + "Key": "graphql.field.path", + "Value": "greetMood" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + } + ] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Parsing", + "DisplayName": "GraphQL Document Parsing", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "error.type", + "Value": "EXECUTION_ERROR" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:6e78386576e454e4780875a7606e0d16" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "2e1b1885ffe6f212546fa4bd4f1343545db562aa93c24e02c85024bb1e4bbae0" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_6e783865_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:0dfa0a2d24c8e4422563d556aea9ab42b677dda1a9d54f60176f8fe0b5ffb527" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Error", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 400 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 400 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Get_SDL_Download_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Get_SDL_Download_NET11_0.snap new file mode 100644 index 00000000000..b9b3471ba23 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Get_SDL_Download_NET11_0.snap @@ -0,0 +1,71 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "GET /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "GET" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "url.query", + "Value": "?sdl" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP GET SDL", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpGetSchema" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + } + ], + "event": [] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Get_Single_Request_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Get_Single_Request_NET11_0.snap new file mode 100644 index 00000000000..e01b7ebd6c9 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Get_Single_Request_NET11_0.snap @@ -0,0 +1,317 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "GET /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "GET" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "url.query", + "Value": "?query=Redacted" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP GET", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpGet" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "f6d09983b9640d3dc20ac4774cc4e3cc75407a02d5135467b9ba3ec3d0fa7fbb" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_f7e9989f_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:35c1feb1208268226c7d5d5d0ae122e4d38cb79621e862b1e252d37fc83c530a" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity_NET11_0.snap new file mode 100644 index 00000000000..826c4403ea4 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Add_Variables_To_Http_Activity_NET11_0.snap @@ -0,0 +1,342 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "bfa5986a5299f46421057dd3eb27ec5c" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "bfa5986a5299f46421057dd3eb27ec5c" + }, + { + "Key": "graphql.http.request.variables", + "Value": "{\"name\":\"World\"}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "b4bacbde0607aabd0bf40fc3e0be23f911f12863ecdf92b2af32c5f869b8d371" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_c46cf8c9_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:e9428697b2cd34a844a7960438916fa3792769cf1baba824c5af0e8cd2b7e6d6" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Parser_Error_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Parser_Error_NET11_0.snap new file mode 100644 index 00000000000..7d65286c83e --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Parser_Error_NET11_0.snap @@ -0,0 +1,113 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 400 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "error.type", + "Value": "HC0011" + } + ], + "event": [ + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Found a NameStart character `d` (100) following a number, which is disallowed." + }, + { + "Key": "graphql.error.code", + "Value": "HC0011" + }, + { + "Key": "graphql.document.locations", + "Value": [ + { + "line": 4, + "column": 13 + } + ] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_Default_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_Default_NET11_0.snap new file mode 100644 index 00000000000..0d70687e83f --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_Default_NET11_0.snap @@ -0,0 +1,283 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "f6d09983b9640d3dc20ac4774cc4e3cc75407a02d5135467b9ba3ec3d0fa7fbb" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_f7e9989f_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:35c1feb1208268226c7d5d5d0ae122e4d38cb79621e862b1e252d37fc83c530a" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_NET11_0.snap new file mode 100644 index 00000000000..a025d197dd3 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Single_Request_NET11_0.snap @@ -0,0 +1,317 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "f6d09983b9640d3dc20ac4774cc4e3cc75407a02d5135467b9ba3ec3d0fa7fbb" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_f7e9989f_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:35c1feb1208268226c7d5d5d0ae122e4d38cb79621e862b1e252d37fc83c530a" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities_NET11_0.snap new file mode 100644 index 00000000000..ee91fbad0da --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_Variables_Are_Not_Automatically_Added_To_Activities_NET11_0.snap @@ -0,0 +1,338 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "bfa5986a5299f46421057dd3eb27ec5c" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "bfa5986a5299f46421057dd3eb27ec5c" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "b4bacbde0607aabd0bf40fc3e0be23f911f12863ecdf92b2af32c5f869b8d371" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_c46cf8c9_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:e9428697b2cd34a844a7960438916fa3792769cf1baba824c5af0e8cd2b7e6d6" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map_NET11_0.snap new file mode 100644 index 00000000000..c32cb529f52 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.Http_Post_With_Extensions_Map_NET11_0.snap @@ -0,0 +1,342 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "bfa5986a5299f46421057dd3eb27ec5c" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "bfa5986a5299f46421057dd3eb27ec5c" + }, + { + "Key": "graphql.http.request.extensions", + "Value": "{\"test\":\"abc\"}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c46cf8c9811934ddea095f10ee722dc4" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "b4bacbde0607aabd0bf40fc3e0be23f911f12863ecdf92b2af32c5f869b8d371" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_c46cf8c9_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:e9428697b2cd34a844a7960438916fa3792769cf1baba824c5af0e8cd2b7e6d6" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails_NET11_0.snap new file mode 100644 index 00000000000..24033409306 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_All_IncludesAllDetails_NET11_0.snap @@ -0,0 +1,370 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "08c6969c8d553f85d6541aa54ef01acb" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "08c6969c8d553f85d6541aa54ef01acb" + }, + { + "Key": "graphql.http.request.query.body", + "Value": "query GetGreeting($name: String!) {\n greeting(name: $name)\n}" + }, + { + "Key": "graphql.http.request.variables", + "Value": "{\"name\":\"World\"}" + }, + { + "Key": "graphql.http.request.extensions", + "Value": "{\"test\":\"abc\"}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:111e40f921c6c6a35bc7eb0e3873630e" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:111e40f921c6c6a35bc7eb0e3873630e" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:111e40f921c6c6a35bc7eb0e3873630e" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:111e40f921c6c6a35bc7eb0e3873630e" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:111e40f921c6c6a35bc7eb0e3873630e" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:111e40f921c6c6a35bc7eb0e3873630e" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "927ffd44733df2159203b1a097608f124eddb72cc45496f3c97e01a5ea40f2b3" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "GetGreeting_111e40f9_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:107e4091ec962487f26df0844464aa76452bc9039d604d80523fc66325c088bc" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions_NET11_0.snap new file mode 100644 index 00000000000..24904e2b203 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_Default_IncludesIdHashOperationNameExtensions_NET11_0.snap @@ -0,0 +1,337 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.id", + "Value": "82d594dc9843e825769c127e8ae2db6f" + }, + { + "Key": "graphql.http.request.query.hash", + "Value": "82d594dc9843e825769c127e8ae2db6f" + }, + { + "Key": "graphql.http.request.extensions", + "Value": "{\"test\":\"abc\"}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cf203f646caf64f424638bd2f09e490a" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cf203f646caf64f424638bd2f09e490a" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cf203f646caf64f424638bd2f09e490a" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cf203f646caf64f424638bd2f09e490a" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:cf203f646caf64f424638bd2f09e490a" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "38b496e1881ca158155c453e43c3fff8115ca61f1aaed0c170ef0ae5a5539379" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "GetGreeting_cf203f64_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:579285518f37f039b04a0268fd6058a3903e369efccd77c48e7c045c35f25428" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag_NET11_0.snap new file mode 100644 index 00000000000..4967540d498 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_DocumentOnly_IncludesDocumentTag_NET11_0.snap @@ -0,0 +1,313 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.http.request.type", + "Value": "single" + }, + { + "Key": "graphql.http.request.query.body", + "Value": "{\n sayHello\n}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:f7e9989fbb67af7fa747a9983313c9e5" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "f6d09983b9640d3dc20ac4774cc4e3cc75407a02d5135467b9ba3ec3d0fa7fbb" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "Op_f7e9989f_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:35c1feb1208268226c7d5d5d0ae122e4d38cb79621e862b1e252d37fc83c530a" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails_NET11_0.snap new file mode 100644 index 00000000000..db7e87476f4 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionActivityServerDiagnosticListenerTests.RequestDetails_None_ExcludesAllDetails_NET11_0.snap @@ -0,0 +1,346 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "GraphQL HTTP POST", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + } + ], + "event": [], + "activities": [ + { + "OperationName": "Parse HTTP Request", + "DisplayName": "Parse HTTP Request", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + }, + { + "OperationName": "GraphQL Operation", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:111e40f921c6c6a35bc7eb0e3873630e" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:111e40f921c6c6a35bc7eb0e3873630e" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:111e40f921c6c6a35bc7eb0e3873630e" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Variable Coercion", + "DisplayName": "GraphQL Variable Coercion", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "variable_coercion" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:111e40f921c6c6a35bc7eb0e3873630e" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Execution", + "DisplayName": "GraphQL Operation Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:111e40f921c6c6a35bc7eb0e3873630e" + } + ], + "event": [], + "activities": [ + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetGreeting" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:111e40f921c6c6a35bc7eb0e3873630e" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "927ffd44733df2159203b1a097608f124eddb72cc45496f3c97e01a5ea40f2b3" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "GetGreeting_111e40f9_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:107e4091ec962487f26df0844464aa76452bc9039d604d80523fc66325c088bc" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + }, + { + "OperationName": "Format HTTP Response", + "DisplayName": "Format HTTP Response", + "Kind": "Internal", + "Status": "Ok", + "tags": [], + "event": [] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionMcpAdapterActivityTests.Mcp_CallTool_GraphQL_Field_Error_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionMcpAdapterActivityTests.Mcp_CallTool_GraphQL_Field_Error_NET11_0.snap new file mode 100644 index 00000000000..c1cebbc290c --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionMcpAdapterActivityTests.Mcp_CallTool_GraphQL_Field_Error_NET11_0.snap @@ -0,0 +1,343 @@ +{ + "source": { + "name": "Experimental.ModelContextProtocol" + }, + "activities": [ + { + "OperationName": "tools/call get_faulty_book", + "DisplayName": "tools/call get_faulty_book", + "Kind": "Client", + "Status": "Error", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "tools/call" + }, + { + "Key": "network.transport", + "Value": "unknown" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.tool.name", + "Value": "get_faulty_book" + }, + { + "Key": "gen_ai.operation.name", + "Value": "execute_tool" + }, + { + "Key": "error.type", + "Value": "tool_error" + } + ], + "event": [], + "activities": [ + { + "OperationName": "tools/call get_faulty_book", + "DisplayName": "tools/call get_faulty_book", + "Kind": "Server", + "Status": "Error", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "tools/call" + }, + { + "Key": "network.transport", + "Value": "tcp" + }, + { + "Key": "network.protocol.name", + "Value": "http" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.tool.name", + "Value": "get_faulty_book" + }, + { + "Key": "gen_ai.operation.name", + "Value": "execute_tool" + }, + { + "Key": "error.type", + "Value": "tool_error" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + }, + { + "Key": "graphql.error.count", + "Value": 1 + }, + { + "Key": "error.type", + "Value": "EXECUTION_ERROR" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + }, + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Something went wrong" + }, + { + "Key": "graphql.field.path", + "Value": "faultyBook" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + } + ] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "655e2f8d494b58bb16ed61d1478f225c8006e7bfb96c067718222bed7c3a8432" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "GetFaultyBook_e3dcf9a6_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:291a6e1ef435849fcb727b8e53c489fbd15f3caae54ecbb13185c7dc2a2e7f95" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionMcpAdapterActivityTests.Mcp_CallTool_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionMcpAdapterActivityTests.Mcp_CallTool_NET11_0.snap new file mode 100644 index 00000000000..372fd554a75 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionMcpAdapterActivityTests.Mcp_CallTool_NET11_0.snap @@ -0,0 +1,302 @@ +{ + "source": { + "name": "Experimental.ModelContextProtocol" + }, + "activities": [ + { + "OperationName": "tools/call get_book", + "DisplayName": "tools/call get_book", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "tools/call" + }, + { + "Key": "network.transport", + "Value": "unknown" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.tool.name", + "Value": "get_book" + }, + { + "Key": "gen_ai.operation.name", + "Value": "execute_tool" + } + ], + "event": [], + "activities": [ + { + "OperationName": "tools/call get_book", + "DisplayName": "tools/call get_book", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "mcp.session.id", + "Value": "" + }, + { + "Key": "jsonrpc.request.id", + "Value": "3" + }, + { + "Key": "mcp.method.name", + "Value": "tools/call" + }, + { + "Key": "network.transport", + "Value": "tcp" + }, + { + "Key": "network.protocol.name", + "Value": "http" + }, + { + "Key": "mcp.protocol.version", + "Value": "2025-11-25" + }, + { + "Key": "gen_ai.tool.name", + "Value": "get_book" + }, + { + "Key": "gen_ai.operation.name", + "Value": "execute_tool" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpPost" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetBook" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "224bcc8f4412141ac322594743d4b8d3467983499544b2ffcf56a4ef57cbf051" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "GetBook_c52af876_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:75c354376b232c4960538b127a15f6239655c10210c36fb8ad7c9d58fb415a3c" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionOpenApiAdapterActivityTests.Http_Get_OpenApi_Endpoint_Does_Not_Exist_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionOpenApiAdapterActivityTests.Http_Get_OpenApi_Endpoint_Does_Not_Exist_NET11_0.snap new file mode 100644 index 00000000000..e4174f05fc8 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionOpenApiAdapterActivityTests.Http_Get_OpenApi_Endpoint_Does_Not_Exist_NET11_0.snap @@ -0,0 +1,44 @@ +{ + "source": { + "name": "Microsoft.AspNetCore" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "GET", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "GET" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/does-not-exist" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 404 + } + ], + "event": [] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionOpenApiAdapterActivityTests.Http_Get_OpenApi_Field_Does_Not_Exist_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionOpenApiAdapterActivityTests.Http_Get_OpenApi_Field_Does_Not_Exist_NET11_0.snap new file mode 100644 index 00000000000..846a1ecdde8 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionOpenApiAdapterActivityTests.Http_Get_OpenApi_Field_Does_Not_Exist_NET11_0.snap @@ -0,0 +1,52 @@ +{ + "source": { + "name": "Microsoft.AspNetCore" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "GET /invalid-graphql-query", + "Kind": "Server", + "Status": "Error", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "GET" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/invalid-graphql-query" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 500 + }, + { + "Key": "http.route", + "Value": "/invalid-graphql-query" + }, + { + "Key": "error.type", + "Value": "500" + } + ], + "event": [] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionOpenApiAdapterActivityTests.Http_Get_OpenApi_GraphQL_Field_Error_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionOpenApiAdapterActivityTests.Http_Get_OpenApi_GraphQL_Field_Error_NET11_0.snap new file mode 100644 index 00000000000..2182d513d6d --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionOpenApiAdapterActivityTests.Http_Get_OpenApi_GraphQL_Field_Error_NET11_0.snap @@ -0,0 +1,300 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "GET /faulty-book", + "Kind": "Server", + "Status": "Error", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "GET" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/faulty-book" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 500 + }, + { + "Key": "http.route", + "Value": "/faulty-book" + }, + { + "Key": "error.type", + "Value": "500" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Error", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpGet" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + }, + { + "Key": "graphql.error.count", + "Value": 1 + }, + { + "Key": "error.type", + "Value": "EXECUTION_ERROR" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + }, + { + "Name": "graphql.error", + "Tags": [ + { + "Key": "graphql.error.message", + "Value": "Something went wrong" + }, + { + "Key": "graphql.field.path", + "Value": "faultyBook" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + } + ] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetFaultyBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:e3dcf9a653465feb05e37160cfc4b6a5" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "655e2f8d494b58bb16ed61d1478f225c8006e7bfb96c067718222bed7c3a8432" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "GetFaultyBook_e3dcf9a6_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:291a6e1ef435849fcb727b8e53c489fbd15f3caae54ecbb13185c7dc2a2e7f95" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionOpenApiAdapterActivityTests.Http_Get_OpenApi_NET11_0.snap b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionOpenApiAdapterActivityTests.Http_Get_OpenApi_NET11_0.snap new file mode 100644 index 00000000000..b2feb7b2ae6 --- /dev/null +++ b/src/HotChocolate/Fusion/test/Fusion.Diagnostics.Tests/__snapshots__/FusionOpenApiAdapterActivityTests.Http_Get_OpenApi_NET11_0.snap @@ -0,0 +1,263 @@ +{ + "source": { + "name": "HotChocolate.Fusion.Diagnostics" + }, + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "GET /book", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 80 + }, + { + "Key": "http.request.method", + "Value": "GET" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/book" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/book" + } + ], + "event": [], + "activities": [ + { + "OperationName": "ExecuteHttpRequest", + "DisplayName": "query", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.http.kind", + "Value": "HttpGet" + }, + { + "Key": "graphql.schema.name", + "Value": "_Default" + }, + { + "Key": "graphql.processing.type", + "Value": "request" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + } + ], + "event": [ + { + "Name": "AddedOperationPlanToCache", + "Tags": [] + }, + { + "Name": "AddedDocumentToCache", + "Tags": [] + } + ], + "activities": [ + { + "OperationName": "GraphQL Document Validation", + "DisplayName": "GraphQL Document Validation", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "validate" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Operation Planning", + "DisplayName": "GraphQL Operation Planning", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "plan" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetBook" + } + ], + "event": [] + }, + { + "OperationName": "GraphQL Step Execution", + "DisplayName": "GraphQL Step Execution", + "Kind": "Internal", + "Status": "Ok", + "tags": [ + { + "Key": "graphql.processing.type", + "Value": "step_execute" + }, + { + "Key": "graphql.operation.type", + "Value": "query" + }, + { + "Key": "graphql.operation.name", + "Value": "GetBook" + }, + { + "Key": "graphql.document.hash", + "Value": "md5:c52af8760a01da3bb53071ab959ab7de" + }, + { + "Key": "graphql.operation.step.id", + "Value": "1" + }, + { + "Key": "graphql.operation.step.kind", + "Value": "operation" + }, + { + "Key": "graphql.operation.step.plan.id", + "Value": "224bcc8f4412141ac322594743d4b8d3467983499544b2ffcf56a4ef57cbf051" + }, + { + "Key": "graphql.source_schema.name", + "Value": "a" + }, + { + "Key": "graphql.source_schema.operation.name", + "Value": "GetBook_c52af876_1" + }, + { + "Key": "graphql.source_schema.operation.hash", + "Value": "sha256:75c354376b232c4960538b127a15f6239655c10210c36fb8ad7c9d58fb415a3c" + } + ], + "event": [], + "activities": [ + { + "OperationName": "System.Net.Http.HttpRequestOut", + "DisplayName": "System.Net.Http.HttpRequestOut", + "Kind": "Client", + "Status": "Unset", + "tags": [ + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "url.full", + "Value": "http://localhost:5000/graphql" + }, + { + "Key": "http.response.status_code", + "Value": 200 + } + ], + "event": [], + "activities": [ + { + "OperationName": "Microsoft.AspNetCore.Hosting.HttpRequestIn", + "DisplayName": "POST /graphql/{**slug}", + "Kind": "Server", + "Status": "Unset", + "tags": [ + { + "Key": "server.address", + "Value": "localhost" + }, + { + "Key": "server.port", + "Value": 5000 + }, + { + "Key": "http.request.method", + "Value": "POST" + }, + { + "Key": "url.scheme", + "Value": "http" + }, + { + "Key": "url.path", + "Value": "/graphql" + }, + { + "Key": "network.protocol.version", + "Value": "1.1" + }, + { + "Key": "http.response.status_code", + "Value": 200 + }, + { + "Key": "http.route", + "Value": "/graphql/{**slug}" + } + ], + "event": [] + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/src/HotChocolate/Language/benchmarks/Language.Benchmarks/HotChocolate.Language.Benchmarks.csproj b/src/HotChocolate/Language/benchmarks/Language.Benchmarks/HotChocolate.Language.Benchmarks.csproj index e3fae0b7f2a..a90b8d30251 100644 --- a/src/HotChocolate/Language/benchmarks/Language.Benchmarks/HotChocolate.Language.Benchmarks.csproj +++ b/src/HotChocolate/Language/benchmarks/Language.Benchmarks/HotChocolate.Language.Benchmarks.csproj @@ -2,7 +2,7 @@ Exe - net10.0 + net11.0 true Preview HotChocolate.Language.Benchmarks diff --git a/src/HotChocolate/Language/src/Directory.Build.props b/src/HotChocolate/Language/src/Directory.Build.props index 86473157e7d..5a8bf22bcc3 100644 --- a/src/HotChocolate/Language/src/Directory.Build.props +++ b/src/HotChocolate/Language/src/Directory.Build.props @@ -6,7 +6,7 @@ $(ExtendedTargetFrameworks) - + true diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_Contains_Expression.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_Contains_Expression.snap index ba60d608631..088f25c5c97 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_Contains_Expression.snap +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_Contains_Expression.snap @@ -13,10 +13,10 @@ 1 SQL: --------------- --- @__p_0='POINT (1 1)' (DbType = Object) +-- @p='POINT (1 1)' (DbType = Object) SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE ST_Contains(d."Bar", @__p_0) +WHERE ST_Contains(d."Bar", @p) --------------- 2 Result: @@ -34,8 +34,8 @@ WHERE ST_Contains(d."Bar", @__p_0) 2 SQL: --------------- --- @__p_0='POINT (-1 -1)' (DbType = Object) +-- @p='POINT (-1 -1)' (DbType = Object) SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE ST_Contains(d."Bar", @__p_0) +WHERE ST_Contains(d."Bar", @p) --------------- diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_NotContains_Expression.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_NotContains_Expression.snap index e9f641d13ca..1eafdbe7f68 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_NotContains_Expression.snap +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorContainsTests.Create_NotContains_Expression.snap @@ -13,10 +13,10 @@ 2 SQL: --------------- --- @__p_0='POINT (1 1)' (DbType = Object) +-- @p='POINT (1 1)' (DbType = Object) SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE NOT (ST_Contains(d."Bar", @__p_0)) +WHERE NOT (ST_Contains(d."Bar", @p)) --------------- 1 Result: @@ -34,8 +34,8 @@ WHERE NOT (ST_Contains(d."Bar", @__p_0)) 1 SQL: --------------- --- @__p_0='POINT (-1 -1)' (DbType = Object) +-- @p='POINT (-1 -1)' (DbType = Object) SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE NOT (ST_Contains(d."Bar", @__p_0)) +WHERE NOT (ST_Contains(d."Bar", @p)) --------------- diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorDistanceTests.Create_Distance_Expression.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorDistanceTests.Create_Distance_Expression.snap index 2d24bc480c4..7af3837f3f3 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorDistanceTests.Create_Distance_Expression.snap +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorDistanceTests.Create_Distance_Expression.snap @@ -13,11 +13,11 @@ 2 SQL: --------------- --- @__p_0='POINT (1 1)' (DbType = Object) --- @__p_1='1' +-- @p='POINT (1 1)' (DbType = Object) +-- @p1='1' SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE ST_Distance(d."Bar", @__p_0) > @__p_1 +WHERE ST_Distance(d."Bar", @p) > @p1 --------------- 1 Result: @@ -35,9 +35,9 @@ WHERE ST_Distance(d."Bar", @__p_0) > @__p_1 1 SQL: --------------- --- @__p_0='POINT (-1 -1)' (DbType = Object) --- @__p_1='1' +-- @p='POINT (-1 -1)' (DbType = Object) +-- @p1='1' SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE ST_Distance(d."Bar", @__p_0) > @__p_1 +WHERE ST_Distance(d."Bar", @p) > @p1 --------------- diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorIntersectsTests.Create_Intersects_Query.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorIntersectsTests.Create_Intersects_Query.snap index 5efb1d37d5c..76c3ff6c623 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorIntersectsTests.Create_Intersects_Query.snap +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorIntersectsTests.Create_Intersects_Query.snap @@ -13,10 +13,10 @@ true Result: true SQL: --------------- --- @__p_0='POLYGON ((10 10, 10 90, 90 90, 90 10, 10 10))' (DbType = Object) +-- @p='POLYGON ((10 10, 10 90, 90 90, 90 10, 10 10))' (DbType = Object) SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE ST_Intersects(d."Bar", @__p_0) +WHERE ST_Intersects(d."Bar", @p) --------------- false Result: @@ -34,8 +34,8 @@ false Result: false SQL: --------------- --- @__p_0='POLYGON ((10 10, 10 90, 90 90, 90 10, 10 10))' (DbType = Object) +-- @p='POLYGON ((10 10, 10 90, 90 90, 90 10, 10 10))' (DbType = Object) SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE NOT (ST_Intersects(d."Bar", @__p_0)) +WHERE NOT (ST_Intersects(d."Bar", @p)) --------------- diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorOverlapsTests.Create_Overlaps_Query.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorOverlapsTests.Create_Overlaps_Query.snap index 0b1d152475b..a9728871964 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorOverlapsTests.Create_Overlaps_Query.snap +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorOverlapsTests.Create_Overlaps_Query.snap @@ -13,10 +13,10 @@ true Result: true SQL: --------------- --- @__p_0='POLYGON ((150 150, 270 150, 330 150, 250 70, 190 70, 70 70, 150 150))' (DbType = Object) +-- @p='POLYGON ((150 150, 270 150, 330 150, 250 70, 190 70, 70 70, 150 150))' (DbType = Object) SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE ST_Overlaps(d."Bar", @__p_0) +WHERE ST_Overlaps(d."Bar", @p) --------------- false Result: @@ -34,8 +34,8 @@ false Result: false SQL: --------------- --- @__p_0='POLYGON ((150 150, 270 150, 330 150, 250 70, 190 70, 70 70, 150 150))' (DbType = Object) +-- @p='POLYGON ((150 150, 270 150, 330 150, 250 70, 190 70, 70 70, 150 150))' (DbType = Object) SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE NOT (ST_Overlaps(d."Bar", @__p_0)) +WHERE NOT (ST_Overlaps(d."Bar", @p)) --------------- diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorTouchesTests.Create_Touches_Query.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorTouchesTests.Create_Touches_Query.snap index d6a7bada83c..00e46a7c3ac 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorTouchesTests.Create_Touches_Query.snap +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorTouchesTests.Create_Touches_Query.snap @@ -13,10 +13,10 @@ true Result: true SQL: --------------- --- @__p_0='POLYGON ((240 80, 140 120, 180 240, 280 200, 240 80))' (DbType = Object) +-- @p='POLYGON ((240 80, 140 120, 180 240, 280 200, 240 80))' (DbType = Object) SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE ST_Touches(d."Bar", @__p_0) +WHERE ST_Touches(d."Bar", @p) --------------- false Result: @@ -34,8 +34,8 @@ false Result: false SQL: --------------- --- @__p_0='POLYGON ((240 80, 140 120, 180 240, 280 200, 240 80))' (DbType = Object) +-- @p='POLYGON ((240 80, 140 120, 180 240, 280 200, 240 80))' (DbType = Object) SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE NOT (ST_Touches(d."Bar", @__p_0)) +WHERE NOT (ST_Touches(d."Bar", @p)) --------------- diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorWithinTests.Create_Within_Query.snap b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorWithinTests.Create_Within_Query.snap index 1ac4d9c73c6..019b3a55e73 100644 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorWithinTests.Create_Within_Query.snap +++ b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorWithinTests.Create_Within_Query.snap @@ -13,10 +13,10 @@ true Result: true SQL: --------------- --- @__p_0='POLYGON ((20 20, 140 20, 120 100, 20 100, 20 20))' (DbType = Object) +-- @p='POLYGON ((20 20, 140 20, 120 100, 20 100, 20 20))' (DbType = Object) SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE ST_Within(d."Bar", @__p_0) +WHERE ST_Within(d."Bar", @p) --------------- false Result: @@ -34,8 +34,8 @@ false Result: false SQL: --------------- --- @__p_0='POLYGON ((20 20, 140 20, 120 100, 20 100, 20 20))' (DbType = Object) +-- @p='POLYGON ((20 20, 140 20, 120 100, 20 100, 20 20))' (DbType = Object) SELECT d."Id", d."Bar" FROM "Data" AS d -WHERE NOT (ST_Within(d."Bar", @__p_0)) +WHERE NOT (ST_Within(d."Bar", @p)) --------------- diff --git a/src/Mocha/benchmarks/Directory.Build.props b/src/Mocha/benchmarks/Directory.Build.props index ac7170928de..c040b6c2777 100644 --- a/src/Mocha/benchmarks/Directory.Build.props +++ b/src/Mocha/benchmarks/Directory.Build.props @@ -1,7 +1,7 @@ - net10.0 - net10.0 + net11.0 + net11.0 diff --git a/src/Mocha/benchmarks/Mocha.Mediator.Benchmarks/Mocha.Mediator.Benchmarks.csproj b/src/Mocha/benchmarks/Mocha.Mediator.Benchmarks/Mocha.Mediator.Benchmarks.csproj index dcdeb19350b..4b998227f44 100644 --- a/src/Mocha/benchmarks/Mocha.Mediator.Benchmarks/Mocha.Mediator.Benchmarks.csproj +++ b/src/Mocha/benchmarks/Mocha.Mediator.Benchmarks/Mocha.Mediator.Benchmarks.csproj @@ -1,7 +1,7 @@ Exe - net8.0;net9.0;net10.0 + net8.0;net9.0;net10.0;net11.0 latest enable enable diff --git a/src/Mocha/benchmarks/Mocha.Mediator.Benchmarks/Program.cs b/src/Mocha/benchmarks/Mocha.Mediator.Benchmarks/Program.cs index 0ba0e169aec..682d42a5b6e 100644 --- a/src/Mocha/benchmarks/Mocha.Mediator.Benchmarks/Program.cs +++ b/src/Mocha/benchmarks/Mocha.Mediator.Benchmarks/Program.cs @@ -7,6 +7,6 @@ var config = DefaultConfig.Instance .AddJob(Job.Default.WithToolchain( CsProjCoreToolchain.From( - new NetCoreAppSettings("net10.0", null, ".NET 10.0")))); + new NetCoreAppSettings("net11.0", null, ".NET 11.0")))); BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config); diff --git a/src/Mocha/examples/Demo/Demo.Billing/Demo.Billing.csproj b/src/Mocha/examples/Demo/Demo.Billing/Demo.Billing.csproj index 7cc05db4918..f4e917223e0 100644 --- a/src/Mocha/examples/Demo/Demo.Billing/Demo.Billing.csproj +++ b/src/Mocha/examples/Demo/Demo.Billing/Demo.Billing.csproj @@ -2,7 +2,7 @@ HotChocolate.Demo.Billing HotChocolate.Demo.Billing - net10.0 + net11.0 diff --git a/src/Mocha/examples/Demo/Demo.Catalog/Demo.Catalog.csproj b/src/Mocha/examples/Demo/Demo.Catalog/Demo.Catalog.csproj index 1f63e1ed941..a904ac9b044 100644 --- a/src/Mocha/examples/Demo/Demo.Catalog/Demo.Catalog.csproj +++ b/src/Mocha/examples/Demo/Demo.Catalog/Demo.Catalog.csproj @@ -2,7 +2,7 @@ HotChocolate.Demo.Catalog HotChocolate.Demo.Catalog - net10.0 + net11.0 diff --git a/src/Mocha/examples/Demo/Demo.Shipping/Demo.Shipping.csproj b/src/Mocha/examples/Demo/Demo.Shipping/Demo.Shipping.csproj index ac9de49c2b7..406bd66c221 100644 --- a/src/Mocha/examples/Demo/Demo.Shipping/Demo.Shipping.csproj +++ b/src/Mocha/examples/Demo/Demo.Shipping/Demo.Shipping.csproj @@ -2,7 +2,7 @@ HotChocolate.Demo.Shipping HotChocolate.Demo.Shipping - net10.0 + net11.0 diff --git a/src/Mocha/examples/Demo/Directory.Packages.props b/src/Mocha/examples/Demo/Directory.Packages.props index 3c2cd0a4766..9b24c329303 100644 --- a/src/Mocha/examples/Demo/Directory.Packages.props +++ b/src/Mocha/examples/Demo/Directory.Packages.props @@ -16,6 +16,9 @@ + + + diff --git a/src/Mocha/examples/PostgresTransport/Directory.Build.props b/src/Mocha/examples/PostgresTransport/Directory.Build.props index e2ecaf9af06..88c4878ea8f 100644 --- a/src/Mocha/examples/PostgresTransport/Directory.Build.props +++ b/src/Mocha/examples/PostgresTransport/Directory.Build.props @@ -1,8 +1,8 @@ - net10.0 - net10.0 + net11.0 + net11.0 enable enable diff --git a/src/Mocha/test/Demo.Catalog.Tests/Demo.Catalog.Tests.csproj b/src/Mocha/test/Demo.Catalog.Tests/Demo.Catalog.Tests.csproj index 72f7ce53c15..5dcc245b121 100644 --- a/src/Mocha/test/Demo.Catalog.Tests/Demo.Catalog.Tests.csproj +++ b/src/Mocha/test/Demo.Catalog.Tests/Demo.Catalog.Tests.csproj @@ -2,7 +2,7 @@ - net10.0 + net11.0 HotChocolate.Demo.Catalog.Tests HotChocolate.Demo.Catalog.Tests diff --git a/src/Mocha/test/Mocha.Tests/Conventions/DefaultNamingConventionsTests.cs b/src/Mocha/test/Mocha.Tests/Conventions/DefaultNamingConventionsTests.cs index 5f3c0b9bf4e..b91032533d1 100644 --- a/src/Mocha/test/Mocha.Tests/Conventions/DefaultNamingConventionsTests.cs +++ b/src/Mocha/test/Mocha.Tests/Conventions/DefaultNamingConventionsTests.cs @@ -12,7 +12,7 @@ public class DefaultNamingConventionsTests AssemblyName = "TestAssembly", AssemblyVersion = "1.0.0", PackageVersion = "1.0.0", - FrameworkVersion = ".NET 10.0", + FrameworkVersion = ".NET 11.0", OperatingSystemVersion = "Linux", EnvironmentName = "Test", ServiceName = "TestService", @@ -29,7 +29,7 @@ public class DefaultNamingConventionsTests AssemblyName = "TestAssembly", AssemblyVersion = "1.0.0", PackageVersion = "1.0.0", - FrameworkVersion = ".NET 10.0", + FrameworkVersion = ".NET 11.0", OperatingSystemVersion = "Linux", EnvironmentName = "Test", ServiceName = null, diff --git a/src/Mocha/test/Mocha.Tests/Telemetry/OpenTelemetryTests.cs b/src/Mocha/test/Mocha.Tests/Telemetry/OpenTelemetryTests.cs index 17b796db0de..bc8ccb6cdbf 100644 --- a/src/Mocha/test/Mocha.Tests/Telemetry/OpenTelemetryTests.cs +++ b/src/Mocha/test/Mocha.Tests/Telemetry/OpenTelemetryTests.cs @@ -171,7 +171,11 @@ public void WithActivity_Sets_Traceparent_Header_From_Current_Activity() var traceparent = headers.GetValue(MessageHeaders.Traceparent.Key) as string; Assert.NotNull(traceparent); +#if NET11_0_OR_GREATER + var expected = $"00-{activity.TraceId.ToHexString()}-{activity.SpanId.ToHexString()}-03"; +#else var expected = $"00-{activity.TraceId.ToHexString()}-{activity.SpanId.ToHexString()}-01"; +#endif Assert.Equal(expected, traceparent); } @@ -288,7 +292,11 @@ public void WithActivity_Sets_Unsampled_TraceFlags_When_Activity_Not_Recorded() // assert var traceparent = headers.GetValue(MessageHeaders.Traceparent.Key) as string; Assert.NotNull(traceparent); +#if NET11_0_OR_GREATER + Assert.EndsWith("-02", traceparent); +#else Assert.EndsWith("-00", traceparent); +#endif } [Fact] diff --git a/src/Mocha/test/Mocha.Tests/Telemetry/TraceparentHelperTests.cs b/src/Mocha/test/Mocha.Tests/Telemetry/TraceparentHelperTests.cs index 2bf13f803d6..5add958d0cd 100644 --- a/src/Mocha/test/Mocha.Tests/Telemetry/TraceparentHelperTests.cs +++ b/src/Mocha/test/Mocha.Tests/Telemetry/TraceparentHelperTests.cs @@ -50,7 +50,11 @@ public void FormatTraceparent_Activity_Matches_TraceId_And_SpanId() // assert Assert.NotNull(result); +#if NET11_0_OR_GREATER + var expected = $"00-{activity.TraceId.ToHexString()}-{activity.SpanId.ToHexString()}-03"; +#else var expected = $"00-{activity.TraceId.ToHexString()}-{activity.SpanId.ToHexString()}-01"; +#endif Assert.Equal(expected, result); } diff --git a/src/StrawberryShake/MetaPackages/Blazor/StrawberryShake.Blazor.csproj b/src/StrawberryShake/MetaPackages/Blazor/StrawberryShake.Blazor.csproj index acd28b29cba..03d9cc81b69 100644 --- a/src/StrawberryShake/MetaPackages/Blazor/StrawberryShake.Blazor.csproj +++ b/src/StrawberryShake/MetaPackages/Blazor/StrawberryShake.Blazor.csproj @@ -45,6 +45,9 @@ + + + diff --git a/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets b/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets index 41000fd47c5..8aa62adf9d2 100644 --- a/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets +++ b/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets @@ -42,17 +42,19 @@ 8 9 10 + 11 + Text="The Strawberry Shake code generation requires .NET SDK 8, 9, 10, or 11 to work." + Condition="'$(DotNetMajor)' != '8' AND '$(DotNetMajor)' != '9' AND '$(DotNetMajor)' != '10' AND '$(DotNetMajor)' != '11'" /> $(MSBuildProjectDirectory)\$(GraphQLPersistedOperationOutput.TrimEnd('/').TrimEnd('\')) $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net8", "dotnet-graphql.dll")) $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net9", "dotnet-graphql.dll")) $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net10", "dotnet-graphql.dll")) + $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net11", "dotnet-graphql.dll")) diff --git a/src/StrawberryShake/MetaPackages/Maui/StrawberryShake.Maui.csproj b/src/StrawberryShake/MetaPackages/Maui/StrawberryShake.Maui.csproj index 92bbfff0a77..28a07c94298 100644 --- a/src/StrawberryShake/MetaPackages/Maui/StrawberryShake.Maui.csproj +++ b/src/StrawberryShake/MetaPackages/Maui/StrawberryShake.Maui.csproj @@ -44,6 +44,9 @@ + + + diff --git a/src/StrawberryShake/MetaPackages/Server/StrawberryShake.Server.csproj b/src/StrawberryShake/MetaPackages/Server/StrawberryShake.Server.csproj index 7960f74b909..5201a1a389c 100644 --- a/src/StrawberryShake/MetaPackages/Server/StrawberryShake.Server.csproj +++ b/src/StrawberryShake/MetaPackages/Server/StrawberryShake.Server.csproj @@ -44,6 +44,9 @@ + + + diff --git a/templates/azure-function/.template.config/template.json b/templates/azure-function/.template.config/template.json index 84b673f96ba..cc89662b47e 100644 --- a/templates/azure-function/.template.config/template.json +++ b/templates/azure-function/.template.config/template.json @@ -30,6 +30,10 @@ { "choice": "net10.0", "description": "Target .NET 10" + }, + { + "choice": "net11.0", + "description": "Target .NET 11" } ], "replaces": "net10.0", diff --git a/templates/gateway/.template.config/template.json b/templates/gateway/.template.config/template.json index 4a3bf5dc966..0d7506ec30c 100644 --- a/templates/gateway/.template.config/template.json +++ b/templates/gateway/.template.config/template.json @@ -30,6 +30,10 @@ { "choice": "net10.0", "description": "Target .NET 10" + }, + { + "choice": "net11.0", + "description": "Target .NET 11" } ], "replaces": "net10.0", diff --git a/templates/server/.template.config/template.json b/templates/server/.template.config/template.json index bde7173b5fa..6df7f959b6b 100644 --- a/templates/server/.template.config/template.json +++ b/templates/server/.template.config/template.json @@ -30,6 +30,10 @@ { "choice": "net10.0", "description": "Target .NET 10" + }, + { + "choice": "net11.0", + "description": "Target .NET 11" } ], "replaces": "net10.0",