From 86ff9988eb0eb4e9e2a6d778a69db13edc33d083 Mon Sep 17 00:00:00 2001 From: marcioscpinheiro <125901619+marcioscpinheiro@users.noreply.github.com> Date: Mon, 1 May 2023 10:12:23 +0100 Subject: [PATCH 1/3] Attempt to Fix NullReference Exception in OperationComplexityMiddleware (#6099) --- .../Pipeline/OperationComplexityMiddleware.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/HotChocolate/Core/src/Execution/Pipeline/OperationComplexityMiddleware.cs b/src/HotChocolate/Core/src/Execution/Pipeline/OperationComplexityMiddleware.cs index 71071a0d13c..447c176ee3e 100644 --- a/src/HotChocolate/Core/src/Execution/Pipeline/OperationComplexityMiddleware.cs +++ b/src/HotChocolate/Core/src/Execution/Pipeline/OperationComplexityMiddleware.cs @@ -67,7 +67,7 @@ context.OperationId is not null && if (!_cache.TryGetAnalyzer(cacheId, out var analyzer)) { - analyzer = CompileAnalyzer(context, document, operationDefinition); + analyzer = CompileAnalyzer(context, document, operationDefinition, cacheId); diagnostic.OperationComplexityAnalyzerCompiled(context); } @@ -101,7 +101,8 @@ context.OperationId is not null && private ComplexityAnalyzerDelegate CompileAnalyzer( IRequestContext requestContext, DocumentNode document, - OperationDefinitionNode operationDefinition) + OperationDefinitionNode operationDefinition, + string cacheId) { var validatorContext = _contextPool.Get(); ComplexityAnalyzerDelegate? operationAnalyzer = null; @@ -115,17 +116,14 @@ private ComplexityAnalyzerDelegate CompileAnalyzer( foreach (var analyzer in analyzers) { - if (analyzer.OperationDefinitionNode == operationDefinition) + if (analyzer.OperationDefinitionNode.Equals(operationDefinition, SyntaxComparison.Syntax)) { operationAnalyzer = analyzer.Analyzer; - } - _cache.TryAddAnalyzer( - requestContext.CreateCacheId( - CreateOperationId( - requestContext.DocumentId!, - analyzer.OperationDefinitionNode.Name?.Value)), - analyzer.Analyzer); + _cache.TryAddAnalyzer( + cacheId, + analyzer.Analyzer); + } } return operationAnalyzer!; From b5c0e87ba3184f7037aac987dd84b8bc99d334b5 Mon Sep 17 00:00:00 2001 From: Michael Staib Date: Mon, 1 May 2023 11:16:03 +0200 Subject: [PATCH 2/3] Reworked Cache Handling in Pipeline (#6100) --- ...sitor.cs => ComplexityAnalyzerCompiler.cs} | 26 +- .../Pipeline/OperationCacheMiddleware.cs | 10 +- .../Pipeline/OperationComplexityMiddleware.cs | 38 +- .../src/Execution/Pipeline/PipelineTools.cs | 62 +-- .../Processing/OperationResolverHelper.cs | 20 +- .../Properties/Resources.Designer.cs | 6 + .../src/Execution/Properties/Resources.resx | 3 + .../Pipeline/ComplexityAnalyzerTests.cs | 381 ++++++++++++------ .../Pipeline/DocumentCacheMiddlewareTests.cs | 2 +- .../Pipeline/OperationCacheMiddlewareTests.cs | 159 ++++++++ 10 files changed, 496 insertions(+), 211 deletions(-) rename src/HotChocolate/Core/src/Execution/Pipeline/Complexity/{ComplexityAnalyzerCompilerVisitor.cs => ComplexityAnalyzerCompiler.cs} (89%) create mode 100644 src/HotChocolate/Core/test/Execution.Tests/Pipeline/OperationCacheMiddlewareTests.cs diff --git a/src/HotChocolate/Core/src/Execution/Pipeline/Complexity/ComplexityAnalyzerCompilerVisitor.cs b/src/HotChocolate/Core/src/Execution/Pipeline/Complexity/ComplexityAnalyzerCompiler.cs similarity index 89% rename from src/HotChocolate/Core/src/Execution/Pipeline/Complexity/ComplexityAnalyzerCompilerVisitor.cs rename to src/HotChocolate/Core/src/Execution/Pipeline/Complexity/ComplexityAnalyzerCompiler.cs index c88e8b4101d..7abfc8eeeb7 100644 --- a/src/HotChocolate/Core/src/Execution/Pipeline/Complexity/ComplexityAnalyzerCompilerVisitor.cs +++ b/src/HotChocolate/Core/src/Execution/Pipeline/Complexity/ComplexityAnalyzerCompiler.cs @@ -9,10 +9,11 @@ using HotChocolate.Types; using HotChocolate.Validation; using static System.Linq.Expressions.Expression; +using static HotChocolate.Execution.Properties.Resources; namespace HotChocolate.Execution.Pipeline.Complexity; -internal sealed class ComplexityAnalyzerCompilerVisitor : TypeDocumentValidatorVisitor +internal sealed class ComplexityAnalyzerCompiler : TypeDocumentValidatorVisitor { private static readonly MethodInfo _getService = typeof(IServiceProvider).GetMethod("GetService")!; @@ -23,7 +24,7 @@ internal sealed class ComplexityAnalyzerCompilerVisitor : TypeDocumentValidatorV private readonly ParameterExpression _services = Parameter(typeof(IServiceProvider), "services"); - public ComplexityAnalyzerCompilerVisitor(ComplexityAnalyzerSettings settings) + public ComplexityAnalyzerCompiler(ComplexityAnalyzerSettings settings) { _settings = Constant(settings, typeof(ComplexityAnalyzerSettings)); } @@ -31,10 +32,7 @@ public ComplexityAnalyzerCompilerVisitor(ComplexityAnalyzerSettings settings) protected override ISyntaxVisitorAction Enter( DocumentNode node, IDocumentValidatorContext context) - { - context.List.Push(new List()); - return base.Enter(node, context); - } + => throw new InvalidOperationException(ComplexityAnalyzerCompiler_Enter_OnlyOperations); protected override ISyntaxVisitorAction Enter( OperationDefinitionNode node, @@ -49,14 +47,14 @@ protected override ISyntaxVisitorAction Leave( IDocumentValidatorContext context) { var expressions = (List)context.List.Pop()!; - var analyzers = (List)context.List.Peek()!; - - analyzers.Add(new OperationComplexityAnalyzer( - node, - Lambda( - Combine(expressions), - _services, - _variables).Compile())); + + context.List.Push( + new OperationComplexityAnalyzer( + node, + Lambda( + Combine(expressions), + _services, + _variables).Compile())); return base.Leave(node, context); } diff --git a/src/HotChocolate/Core/src/Execution/Pipeline/OperationCacheMiddleware.cs b/src/HotChocolate/Core/src/Execution/Pipeline/OperationCacheMiddleware.cs index f6c6d269519..033fae16bad 100644 --- a/src/HotChocolate/Core/src/Execution/Pipeline/OperationCacheMiddleware.cs +++ b/src/HotChocolate/Core/src/Execution/Pipeline/OperationCacheMiddleware.cs @@ -38,15 +38,11 @@ public async ValueTask InvokeAsync(IRequestContext context) if (operationId is null) { - operationId = CreateOperationId( - context.DocumentId, - context.Request.OperationName); + operationId = context.CreateCacheId(context.DocumentId, context.Request.OperationName); context.OperationId = operationId; } - var cacheId = context.CreateCacheId(operationId); - - if (_operationCache.TryGetOperation(cacheId, out var operation)) + if (_operationCache.TryGetOperation(operationId, out var operation)) { context.Operation = operation; addToCache = false; @@ -61,7 +57,7 @@ context.DocumentId is not null && context.Document is not null && context.IsValidDocument) { - _operationCache.TryAddOperation(cacheId, context.Operation); + _operationCache.TryAddOperation(operationId, context.Operation); _diagnosticEvents.AddedOperationToCache(context); } } diff --git a/src/HotChocolate/Core/src/Execution/Pipeline/OperationComplexityMiddleware.cs b/src/HotChocolate/Core/src/Execution/Pipeline/OperationComplexityMiddleware.cs index 447c176ee3e..126c8ac7208 100644 --- a/src/HotChocolate/Core/src/Execution/Pipeline/OperationComplexityMiddleware.cs +++ b/src/HotChocolate/Core/src/Execution/Pipeline/OperationComplexityMiddleware.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Threading.Tasks; using HotChocolate.Execution.Caching; using HotChocolate.Execution.Options; @@ -19,7 +18,7 @@ internal sealed class OperationComplexityMiddleware private readonly DocumentValidatorContextPool _contextPool; private readonly ComplexityAnalyzerSettings _settings; private readonly IComplexityAnalyzerCache _cache; - private readonly ComplexityAnalyzerCompilerVisitor _compiler; + private readonly ComplexityAnalyzerCompiler _compiler; private readonly VariableCoercionHelper _coercionHelper; public OperationComplexityMiddleware( @@ -40,7 +39,7 @@ public OperationComplexityMiddleware( _coercionHelper = coercionHelper ?? throw new ArgumentNullException(nameof(coercionHelper)); - _compiler = new ComplexityAnalyzerCompilerVisitor(_settings); + _compiler = new ComplexityAnalyzerCompiler(_settings); } public async ValueTask InvokeAsync(IRequestContext context) @@ -59,15 +58,18 @@ context.OperationId is not null && using (diagnostic.AnalyzeOperationComplexity(context)) { - var cacheId = context.CreateCacheId(context.OperationId); var document = context.Document; var operationDefinition = context.Operation?.Definition ?? document.GetOperation(context.Request.OperationName); - if (!_cache.TryGetAnalyzer(cacheId, out var analyzer)) + if (!_cache.TryGetAnalyzer(context.OperationId, out var analyzer)) { - analyzer = CompileAnalyzer(context, document, operationDefinition, cacheId); + analyzer = CompileAnalyzer( + context, + document, + operationDefinition, + context.OperationId); diagnostic.OperationComplexityAnalyzerCompiled(context); } @@ -102,31 +104,17 @@ private ComplexityAnalyzerDelegate CompileAnalyzer( IRequestContext requestContext, DocumentNode document, OperationDefinitionNode operationDefinition, - string cacheId) + string operationId) { var validatorContext = _contextPool.Get(); - ComplexityAnalyzerDelegate? operationAnalyzer = null; try { PrepareContext(requestContext, document, validatorContext); - - _compiler.Visit(document, validatorContext); - var analyzers = (List)validatorContext.List.Peek()!; - - foreach (var analyzer in analyzers) - { - if (analyzer.OperationDefinitionNode.Equals(operationDefinition, SyntaxComparison.Syntax)) - { - operationAnalyzer = analyzer.Analyzer; - - _cache.TryAddAnalyzer( - cacheId, - analyzer.Analyzer); - } - } - - return operationAnalyzer!; + _compiler.Visit(operationDefinition, validatorContext); + var analyzer = (OperationComplexityAnalyzer)validatorContext.List.Pop()!; + _cache.TryAddAnalyzer(operationId, analyzer.Analyzer); + return analyzer.Analyzer; } finally { diff --git a/src/HotChocolate/Core/src/Execution/Pipeline/PipelineTools.cs b/src/HotChocolate/Core/src/Execution/Pipeline/PipelineTools.cs index 65f87ffcaaa..f8f7d890cfb 100644 --- a/src/HotChocolate/Core/src/Execution/Pipeline/PipelineTools.cs +++ b/src/HotChocolate/Core/src/Execution/Pipeline/PipelineTools.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Runtime.CompilerServices; using HotChocolate.Execution.Processing; using HotChocolate.Language; @@ -6,42 +7,51 @@ namespace HotChocolate.Execution.Pipeline; internal static class PipelineTools { - private static readonly IReadOnlyDictionary _empty = - new Dictionary(); - private static readonly VariableValueCollection _noVariables = - VariableValueCollection.Empty; + private static readonly Dictionary _empty = new(); + private static readonly VariableValueCollection _noVariables = VariableValueCollection.Empty; - public static string CreateOperationId(string documentId, string? operationName) => - operationName is null ? documentId : $"{documentId}+{operationName}"; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string CreateOperationId(string documentId, string? operationName) + => operationName is null ? documentId : $"{documentId}+{operationName}"; - public static string CreateCacheId(this IRequestContext context, string operationId) => - $"{context.Schema.Name}-{context.ExecutorVersion}-{operationId}"; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string CreateCacheId(this IRequestContext context, string operationId) + => $"{context.Schema.Name}-{context.ExecutorVersion}-{operationId}"; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string CreateCacheId( + this IRequestContext context, + string documentId, + string? operationName) + => CreateCacheId(context, CreateOperationId(documentId, operationName)); public static void CoerceVariables( IRequestContext context, VariableCoercionHelper coercionHelper, IReadOnlyList variableDefinitions) { - if (context.Variables is null) + if (context.Variables is not null) { - if (variableDefinitions.Count == 0) - { - context.Variables = _noVariables; - } - else + return; + } + + if (variableDefinitions.Count == 0) + { + context.Variables = _noVariables; + } + else + { + using (context.DiagnosticEvents.CoerceVariables(context)) { - using (context.DiagnosticEvents.CoerceVariables(context)) - { - var coercedValues = new Dictionary(); - - coercionHelper.CoerceVariableValues( - context.Schema, - variableDefinitions, - context.Request.VariableValues ?? _empty, - coercedValues); - - context.Variables = new VariableValueCollection(coercedValues); - } + var coercedValues = new Dictionary(); + + coercionHelper.CoerceVariableValues( + context.Schema, + variableDefinitions, + context.Request.VariableValues ?? _empty, + coercedValues); + + context.Variables = new VariableValueCollection(coercedValues); } } } diff --git a/src/HotChocolate/Core/src/Execution/Processing/OperationResolverHelper.cs b/src/HotChocolate/Core/src/Execution/Processing/OperationResolverHelper.cs index 4bf2b0faffe..9ca34361c5c 100644 --- a/src/HotChocolate/Core/src/Execution/Processing/OperationResolverHelper.cs +++ b/src/HotChocolate/Core/src/Execution/Processing/OperationResolverHelper.cs @@ -21,16 +21,18 @@ public static OperationDefinitionNode GetOperation( for (var i = 0; i < length; i++) { - if (definitions[i] is OperationDefinitionNode op) + if (definitions[i] is not OperationDefinitionNode op) { - if (operation is null) - { - operation = op; - } - else - { - throw OperationResolverHelper_MultipleOperation(operation, op); - } + continue; + } + + if (operation is null) + { + operation = op; + } + else + { + throw OperationResolverHelper_MultipleOperation(operation, op); } } diff --git a/src/HotChocolate/Core/src/Execution/Properties/Resources.Designer.cs b/src/HotChocolate/Core/src/Execution/Properties/Resources.Designer.cs index 5f135f701a1..726a6c6dc9c 100644 --- a/src/HotChocolate/Core/src/Execution/Properties/Resources.Designer.cs +++ b/src/HotChocolate/Core/src/Execution/Properties/Resources.Designer.cs @@ -470,5 +470,11 @@ internal static string SelectionSetOptimizerContext_AddSelection_ResponseNameNot return ResourceManager.GetString("SelectionSetOptimizerContext_AddSelection_ResponseNameNotTheSame", resourceCulture); } } + + internal static string ComplexityAnalyzerCompiler_Enter_OnlyOperations { + get { + return ResourceManager.GetString("ComplexityAnalyzerCompiler_Enter_OnlyOperations", resourceCulture); + } + } } } diff --git a/src/HotChocolate/Core/src/Execution/Properties/Resources.resx b/src/HotChocolate/Core/src/Execution/Properties/Resources.resx index 3baf949c060..c4ba2fcadbb 100644 --- a/src/HotChocolate/Core/src/Execution/Properties/Resources.resx +++ b/src/HotChocolate/Core/src/Execution/Properties/Resources.resx @@ -330,4 +330,7 @@ The provided response name must be the same as on the selection. + + We only compile operations. + diff --git a/src/HotChocolate/Core/test/Execution.Tests/Pipeline/ComplexityAnalyzerTests.cs b/src/HotChocolate/Core/test/Execution.Tests/Pipeline/ComplexityAnalyzerTests.cs index 0dc2c628fa6..1644333fc36 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Pipeline/ComplexityAnalyzerTests.cs +++ b/src/HotChocolate/Core/test/Execution.Tests/Pipeline/ComplexityAnalyzerTests.cs @@ -1,13 +1,11 @@ -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using ChilliCream.Testing; +using Microsoft.Extensions.DependencyInjection; +using CookieCrumble; +using HotChocolate.Execution.Instrumentation; using HotChocolate.Execution.Options; -using HotChocolate.Tests; using HotChocolate.Types; -using Xunit; using static HotChocolate.WellKnownContextData; using static HotChocolate.Tests.TestHelper; +using FileResource = ChilliCream.Testing.FileResource; namespace HotChocolate.Execution.Pipeline; @@ -19,24 +17,22 @@ public async Task MaxComplexity_Not_Reached() var complexity = 0; await ExpectValid( - @" - { - foo { - ... on Foo { - ... on Foo { - field - ... on Bar { - baz { - foo { - field - } - } + @"{ + foo { + ... on Foo { + ... on Foo { + field + ... on Bar { + baz { + foo { + field } } } } } - ", + } + }", configure: b => b .AddDocumentFromString(FileResource.Open("CostSchema.graphql")) .UseField(_ => _ => default) @@ -60,24 +56,22 @@ ... on Bar { public async Task MaxComplexity_Reached() { await ExpectError( - @" - { - foo { - ... on Foo { - ... on Foo { - field - ... on Bar { - baz { - foo { - field - } - } + @"{ + foo { + ... on Foo { + ... on Foo { + field + ... on Bar { + baz { + foo { + field } } } } } - ", + } + }", configure: b => b .AddDocumentFromString(FileResource.Open("CostSchema.graphql")) .UseField(_ => _ => default) @@ -94,24 +88,22 @@ ... on Bar { public async Task MaxComplexity_Analysis_Skipped() { await ExpectValid( - @" - { - foo { - ... on Foo { - ... on Foo { - field - ... on Bar { - baz { - foo { - field - } - } + @"{ + foo { + ... on Foo { + ... on Foo { + field + ... on Bar { + baz { + foo { + field } } } } } - ", + } + }", request: b => b.SkipComplexityAnalysis(), configure: b => b .AddDocumentFromString(FileResource.Open("CostSchema.graphql")) @@ -129,24 +121,22 @@ ... on Bar { public async Task MaxComplexity_Analysis_Request_Maximum() { await ExpectValid( - @" - { - foo { - ... on Foo { - ... on Foo { - field - ... on Bar { - baz { - foo { - field - } - } + @"{ + foo { + ... on Foo { + ... on Foo { + field + ... on Bar { + baz { + foo { + field } } } } } - ", + } + }", request: b => b.SetMaximumAllowedComplexity(1000), configure: b => b .AddDocumentFromString(FileResource.Open("CostSchema.graphql")) @@ -166,24 +156,22 @@ public async Task MaxComplexity_Custom_Calculation() var complexity = 0; await ExpectValid( - @" - { - foo { - ... on Foo { - ... on Foo { - field - ... on Bar { - baz { - foo { - field - } - } + @"{ + foo { + ... on Foo { + ... on Foo { + field + ... on Bar { + baz { + foo { + field } } } } } - ", + } + }", configure: b => b .AddDocumentFromString(FileResource.Open("CostSchema.graphql")) .UseField(_ => _ => default) @@ -212,12 +200,12 @@ public async Task Apply_Complexity_Defaults_For_Connections() await ExpectValid( @"{ - persons { - nodes { - name - } + persons { + nodes { + name } - }", + } + }", configure: b => b .AddQueryType() .ModifyRequestOptions(o => @@ -242,15 +230,15 @@ public async Task Apply_Complexity_Defaults_For_Connections_And_Resolvers() await ExpectValid( @"{ - persons { - nodes { - name - } - } - person { + persons { + nodes { name } - }", + } + person { + name + } + }", configure: b => b .AddQueryType() .ModifyRequestOptions(o => @@ -275,16 +263,16 @@ public async Task Apply_Complexity_Defaults_For_Connections_And_Resolvers_And_In await ExpectValid( @"{ - persons { - nodes { - name - } - } - person { + persons { + nodes { name } - sayHello - }", + } + person { + name + } + sayHello + }", configure: b => b .AddQueryType() .ModifyRequestOptions(o => @@ -305,16 +293,19 @@ await ExpectValid( [Fact] public async Task Apply_Complexity_Defaults() { - await new ServiceCollection() - .AddGraphQL() - .AddQueryType() - .ModifyRequestOptions(o => - { - o.Complexity.Enable = true; - o.Complexity.MaximumAllowed = 1000; - }) - .BuildSchemaAsync() - .MatchSnapshotAsync(); + var schema = + await new ServiceCollection() + .AddGraphQL() + .AddQueryType() + .ModifyRequestOptions( + o => + { + o.Complexity.Enable = true; + o.Complexity.MaximumAllowed = 1000; + }) + .BuildSchemaAsync(); + + schema.MatchSnapshot(); } [Fact] @@ -323,21 +314,11 @@ public async Task MaxComplexity_Not_With_Union() var complexity = 0; await ExpectValid( - @" - { - bazOrBar { - ... on Foo { - ... on Foo { - field - ... on Bar { - baz { - foo { - field - } - } - } - } - } + @"{ + bazOrBar { + ... on Foo { + ... on Foo { + field ... on Bar { baz { foo { @@ -347,7 +328,15 @@ ... on Bar { } } } - ", + ... on Bar { + baz { + foo { + field + } + } + } + } + }", configure: b => b .AddDocumentFromString(FileResource.Open("CostSchema.graphql")) .UseField(_ => _ => default) @@ -367,24 +356,148 @@ ... on Bar { Assert.Equal(16, complexity); } - private static ISchema CreateSchema() + [Fact] + public async Task Ensure_Cache_Is_Hit_When_Two_Ops_In_Request() + { + // arrange + const string requestDocument = + """ + query GetBazBar { + bazOrBar { + ... on Foo { + ... on Foo { + field + ... on Bar { + baz { + foo { + field + } + } + } + } + } + ... on Bar { + baz { + foo { + field + } + } + } + } + } + + query FooBar { + bazOrBar { + __typename + } + } + """; + + var request = + QueryRequestBuilder.New() + .SetQuery(requestDocument); + + var diagnostics = new CacheHit(); + + var executor = + await new ServiceCollection() + .AddGraphQLServer() + .AddDocumentFromString(FileResource.Open("CostSchema.graphql")) + .UseField(_ => _ => default) + .ConfigureSchema(s => s.AddCostDirectiveType()) + .ModifyRequestOptions( + o => + { + o.Complexity.Enable = true; + o.Complexity.MaximumAllowed = 1000; + }) + .AddDiagnosticEventListener(_ => diagnostics) + .UseDefaultPipeline() + .BuildRequestExecutorAsync(); + + // act + await executor.ExecuteAsync(request.SetOperation("GetBazBar").Create()); + await executor.ExecuteAsync(request.SetOperation("FooBar").Create()); + await executor.ExecuteAsync(request.SetOperation("GetBazBar").Create()); + await executor.ExecuteAsync(request.SetOperation("FooBar").Create()); + await executor.ExecuteAsync(request.SetOperation("GetBazBar").Create()); + await executor.ExecuteAsync(request.SetOperation("GetBazBar").Create()); + await executor.ExecuteAsync(request.SetOperation("GetBazBar").Create()); + await executor.ExecuteAsync(request.SetOperation("FooBar").Create()); + + // assert + Assert.Equal(2, diagnostics.Compiled); + } + + [Fact] + public async Task Ensure_Cache_Is_Hit_When_Single_Op() { - return SchemaBuilder.New() - .AddDocumentFromString( - FileResource.Open("CostSchema.graphql")) - .AddCostDirectiveType() - .Use(_ => _ => default) - .Create(); + // arrange + const string requestDocument = + """ + query GetBazBar { + bazOrBar { + ... on Foo { + ... on Foo { + field + ... on Bar { + baz { + foo { + field + } + } + } + } + } + ... on Bar { + baz { + foo { + field + } + } + } + } + } + """; + + var request = + QueryRequestBuilder.New() + .SetQuery(requestDocument); + + var diagnostics = new CacheHit(); + + var executor = + await new ServiceCollection() + .AddGraphQLServer() + .AddDocumentFromString(FileResource.Open("CostSchema.graphql")) + .UseField(_ => _ => default) + .ConfigureSchema(s => s.AddCostDirectiveType()) + .ModifyRequestOptions( + o => + { + o.Complexity.Enable = true; + o.Complexity.MaximumAllowed = 1000; + }) + .UseDefaultPipeline() + .AddDiagnosticEventListener(_ => diagnostics) + .BuildRequestExecutorAsync(); + + // act + await executor.ExecuteAsync(request.Create()); + await executor.ExecuteAsync(request.Create()); + + // assert + Assert.Equal(1, diagnostics.Compiled); } public class Query { [UsePaging] - public IQueryable GetPersons() => - new[] { new Person() }.AsQueryable(); + public IQueryable GetPersons() + => new[] { new Person() }.AsQueryable(); - public Task GetPersonAsync() => - Task.FromResult(new Person()); + public Task GetPersonAsync() + => Task.FromResult(new Person()); public string SayHello() => "Hello"; } @@ -393,4 +506,14 @@ public class Person { public string Name { get; set; } = "Luke"; } -} \ No newline at end of file + + public sealed class CacheHit : ExecutionDiagnosticEventListener + { + public int Compiled { get; private set; } + + public override void OperationComplexityAnalyzerCompiled(IRequestContext context) + { + Compiled++; + } + } +} diff --git a/src/HotChocolate/Core/test/Execution.Tests/Pipeline/DocumentCacheMiddlewareTests.cs b/src/HotChocolate/Core/test/Execution.Tests/Pipeline/DocumentCacheMiddlewareTests.cs index 78959007686..477a8a7cb20 100644 --- a/src/HotChocolate/Core/test/Execution.Tests/Pipeline/DocumentCacheMiddlewareTests.cs +++ b/src/HotChocolate/Core/test/Execution.Tests/Pipeline/DocumentCacheMiddlewareTests.cs @@ -16,7 +16,7 @@ public async Task RetrieveItemFromCache_DocumentFoundOnCache() var hashProvider = new MD5DocumentHashProvider(); var middleware = new DocumentCacheMiddleware( - context => default, + _ => default, new NoopExecutionDiagnosticEvents(), cache, hashProvider); diff --git a/src/HotChocolate/Core/test/Execution.Tests/Pipeline/OperationCacheMiddlewareTests.cs b/src/HotChocolate/Core/test/Execution.Tests/Pipeline/OperationCacheMiddlewareTests.cs new file mode 100644 index 00000000000..43272d8bea7 --- /dev/null +++ b/src/HotChocolate/Core/test/Execution.Tests/Pipeline/OperationCacheMiddlewareTests.cs @@ -0,0 +1,159 @@ +using Microsoft.Extensions.DependencyInjection; +using HotChocolate.Execution.Instrumentation; +using FileResource = ChilliCream.Testing.FileResource; + +namespace HotChocolate.Execution.Pipeline; + +public class OperationCacheMiddlewareTests +{ + [Fact] + public async Task Ensure_Cache_Is_Hit_When_Two_Ops_In_Request() + { + // arrange + const string requestDocument = + """ + query GetBazBar { + bazOrBar { + ... on Foo { + ... on Foo { + field + ... on Bar { + baz { + foo { + field + } + } + } + } + } + ... on Bar { + baz { + foo { + field + } + } + } + } + } + + query FooBar { + bazOrBar { + __typename + } + } + """; + + var request = + QueryRequestBuilder.New() + .SetQuery(requestDocument); + + var diagnostics = new CacheHit(); + + var executor = + await new ServiceCollection() + .AddGraphQLServer() + .AddDocumentFromString(FileResource.Open("CostSchema.graphql")) + .UseField(_ => _ => default) + .ConfigureSchema(s => s.AddCostDirectiveType()) + .AddDiagnosticEventListener(_ => diagnostics) + .UseDefaultPipeline() + .BuildRequestExecutorAsync(); + + // act + await executor.ExecuteAsync(request.SetOperation("GetBazBar").Create()); + await executor.ExecuteAsync(request.SetOperation("FooBar").Create()); + await executor.ExecuteAsync(request.SetOperation("GetBazBar").Create()); + await executor.ExecuteAsync(request.SetOperation("FooBar").Create()); + await executor.ExecuteAsync(request.SetOperation("GetBazBar").Create()); + await executor.ExecuteAsync(request.SetOperation("GetBazBar").Create()); + await executor.ExecuteAsync(request.SetOperation("GetBazBar").Create()); + await executor.ExecuteAsync(request.SetOperation("FooBar").Create()); + + // assert + Assert.Equal(2, diagnostics.AddedToCache); + Assert.Equal(2, diagnostics.Compiled); + Assert.Equal(6, diagnostics.RetrievedFromCache); + } + + [Fact] + public async Task Ensure_Cache_Is_Hit_When_Single_Op() + { + // arrange + const string requestDocument = + """ + query GetBazBar { + bazOrBar { + ... on Foo { + ... on Foo { + field + ... on Bar { + baz { + foo { + field + } + } + } + } + } + ... on Bar { + baz { + foo { + field + } + } + } + } + } + """; + + var request = + QueryRequestBuilder.New() + .SetQuery(requestDocument); + + var diagnostics = new CacheHit(); + + var executor = + await new ServiceCollection() + .AddGraphQLServer() + .AddDocumentFromString(FileResource.Open("CostSchema.graphql")) + .UseField(_ => _ => default) + .ConfigureSchema(s => s.AddCostDirectiveType()) + .UseDefaultPipeline() + .AddDiagnosticEventListener(_ => diagnostics) + .BuildRequestExecutorAsync(); + + // act + await executor.ExecuteAsync(request.Create()); + await executor.ExecuteAsync(request.Create()); + + // assert + Assert.Equal(1, diagnostics.AddedToCache); + Assert.Equal(1, diagnostics.Compiled); + Assert.Equal(1, diagnostics.RetrievedFromCache); + } + + public sealed class CacheHit : ExecutionDiagnosticEventListener + { + public int RetrievedFromCache { get; private set; } + + public int AddedToCache { get; private set; } + + public int Compiled { get; private set; } + + public override void RetrievedOperationFromCache(IRequestContext context) + { + RetrievedFromCache++; + } + + public override void AddedOperationToCache(IRequestContext context) + { + AddedToCache++; + } + + public override IDisposable CompileOperation(IRequestContext context) + { + Compiled++; + return base.CompileOperation(context); + } + } +} From b030d4b79433ec4bf45502a3ea3f98859ec23670 Mon Sep 17 00:00:00 2001 From: Michael Staib Date: Mon, 1 May 2023 12:02:12 +0200 Subject: [PATCH 3/3] Updated Test Snapshots --- .../Pipeline/OperationComplexityMiddleware.cs | 8 ++- ...zerTests.Apply_Complexity_Defaults.graphql | 49 +++++++++++++++++++ ...onTests.Allow_document_to_be_captured.snap | 2 +- ...s.Allow_document_to_be_captured__NET7.snap | 2 +- ...r_error_that_deletes_the_whole_result.snap | 2 +- ...r_that_deletes_the_whole_result__NET7.snap | 2 +- ...e_operation_display_name_with_1_field.snap | 2 +- ...ation_display_name_with_1_field__NET7.snap | 2 +- ...tion_display_name_with_1_field_and_op.snap | 2 +- ...isplay_name_with_1_field_and_op__NET7.snap | 2 +- ...e_operation_display_name_with_3_field.snap | 2 +- ...ation_display_name_with_3_field__NET7.snap | 2 +- ...e_operation_display_name_with_4_field.snap | 2 +- ...ation_display_name_with_4_field__NET7.snap | 2 +- ...peration_name_is_used_as_request_name.snap | 2 +- ...on_name_is_used_as_request_name__NET7.snap | 2 +- ...tationTests.MaxComplexity_Not_Reached.snap | 2 +- ...Tests.MaxComplexity_Not_Reached__NET7.snap | 2 +- ...umentationTests.MaxComplexity_Reached.snap | 2 +- ...tionTests.MaxComplexity_Reached__NET7.snap | 2 +- ...ack_events_of_a_simple_query_detailed.snap | 2 +- ...ents_of_a_simple_query_detailed__NET7.snap | 2 +- ...ts.Http_Get_SingleRequest_GetHeroName.snap | 2 +- ...p_Get_SingleRequest_GetHeroName__NET7.snap | 2 +- ...s.Http_Post_SingleRequest_GetHeroName.snap | 2 +- ...ost_SingleRequest_GetHeroName_Default.snap | 2 +- ...ngleRequest_GetHeroName_Default__NET7.snap | 2 +- ..._Post_SingleRequest_GetHeroName__NET7.snap | 2 +- ....Http_Post_add_query_to_http_activity.snap | 2 +- ...Post_add_query_to_http_activity__NET7.snap | 2 +- ...p_Post_add_variables_to_http_activity.snap | 2 +- ..._add_variables_to_http_activity__NET7.snap | 2 +- ...s.Http_Post_capture_deferred_response.snap | 2 +- ..._Post_capture_deferred_response__NET7.snap | 2 +- ...t_ensure_list_path_is_correctly_built.snap | 2 +- ...re_list_path_is_correctly_built__NET7.snap | 2 +- ...not_automatically_added_to_activities.snap | 2 +- ...tomatically_added_to_activities__NET7.snap | 2 +- ...onTests.Http_Post_with_extensions_map.snap | 2 +- ...s.Http_Post_with_extensions_map__NET7.snap | 2 +- 40 files changed, 93 insertions(+), 40 deletions(-) create mode 100644 src/HotChocolate/Core/test/Execution.Tests/Pipeline/__snapshots__/ComplexityAnalyzerTests.Apply_Complexity_Defaults.graphql diff --git a/src/HotChocolate/Core/src/Execution/Pipeline/OperationComplexityMiddleware.cs b/src/HotChocolate/Core/src/Execution/Pipeline/OperationComplexityMiddleware.cs index 126c8ac7208..52acb073adc 100644 --- a/src/HotChocolate/Core/src/Execution/Pipeline/OperationComplexityMiddleware.cs +++ b/src/HotChocolate/Core/src/Execution/Pipeline/OperationComplexityMiddleware.cs @@ -28,12 +28,16 @@ public OperationComplexityMiddleware( IComplexityAnalyzerCache cache, VariableCoercionHelper coercionHelper) { + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + _next = next ?? throw new ArgumentNullException(nameof(next)); _contextPool = contextPool ?? throw new ArgumentNullException(nameof(contextPool)); - _settings = options?.Complexity ?? - throw new ArgumentNullException(nameof(options)); + _settings = options.Complexity; _cache = cache ?? throw new ArgumentNullException(nameof(cache)); _coercionHelper = coercionHelper ?? diff --git a/src/HotChocolate/Core/test/Execution.Tests/Pipeline/__snapshots__/ComplexityAnalyzerTests.Apply_Complexity_Defaults.graphql b/src/HotChocolate/Core/test/Execution.Tests/Pipeline/__snapshots__/ComplexityAnalyzerTests.Apply_Complexity_Defaults.graphql new file mode 100644 index 00000000000..d694990bfc0 --- /dev/null +++ b/src/HotChocolate/Core/test/Execution.Tests/Pipeline/__snapshots__/ComplexityAnalyzerTests.Apply_Complexity_Defaults.graphql @@ -0,0 +1,49 @@ +schema { + query: Query +} + +"Information about pagination in a connection." +type PageInfo { + "Indicates whether more edges exist following the set defined by the clients arguments." + hasNextPage: Boolean! + "Indicates whether more edges exist prior the set defined by the clients arguments." + hasPreviousPage: Boolean! + "When paginating backwards, the cursor to continue." + startCursor: String + "When paginating forwards, the cursor to continue." + endCursor: String +} + +type Person { + name: String +} + +"A connection to a list of items." +type PersonsConnection { + "Information to aid in pagination." + pageInfo: PageInfo! + "A list of edges." + edges: [PersonsEdge!] + "A flattened list of the nodes." + nodes: [Person] +} + +"An edge in a connection." +type PersonsEdge { + "A cursor for use in pagination." + cursor: String! + "The item at the end of the edge." + node: Person +} + +type Query { + persons("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): PersonsConnection @cost(complexity: 5, multipliers: [ "first", "last" ], defaultMultiplier: 10) + person: Person @cost(complexity: 5) + sayHello: String +} + +"The cost directives is used to express the complexity of a field." +directive @cost("Defines the complexity of the field." complexity: Int! = 1 "Defines field arguments that act as complexity multipliers." multipliers: [MultiplierPath!] defaultMultiplier: Int) on FIELD_DEFINITION + +"The multiplier path scalar represents a valid GraphQL multiplier path string." +scalar MultiplierPath \ No newline at end of file diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured.snap index 384dd537c8e..47e1cccad35 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "6af18618ae20c266f6ffc352b78cb69b" + "Value": "_Default-1-6af18618ae20c266f6ffc352b78cb69b" }, { "Key": "graphql.operation.name", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured__NET7.snap index c29c74df87d..b2ae1cfdaa4 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Allow_document_to_be_captured__NET7.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "6af18618ae20c266f6ffc352b78cb69b" + "Value": "_Default-1-6af18618ae20c266f6ffc352b78cb69b" }, { "Key": "graphql.operation.name", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result.snap index 99f41c5865f..12b18db2571 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "851fb754d9ba6b5cc5a55ebcbea2621d" + "Value": "_Default-1-851fb754d9ba6b5cc5a55ebcbea2621d" }, { "Key": "graphql.operation.name", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result__NET7.snap index de1568da464..4b1b519400a 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Cause_a_resolver_error_that_deletes_the_whole_result__NET7.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "851fb754d9ba6b5cc5a55ebcbea2621d" + "Value": "_Default-1-851fb754d9ba6b5cc5a55ebcbea2621d" }, { "Key": "graphql.operation.name", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field.snap index a56b9f0256e..1bddc07f2e5 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "452ea802c4d1bf2a81a7411b0b361d9f" + "Value": "_Default-1-452ea802c4d1bf2a81a7411b0b361d9f" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field__NET7.snap index 2cfd7833ee0..771be359ae1 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field__NET7.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "452ea802c4d1bf2a81a7411b0b361d9f" + "Value": "_Default-1-452ea802c4d1bf2a81a7411b0b361d9f" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op.snap index 3cc54f4bc16..2779244c49e 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "cee0e2939ece72d650cb0331f4be4669" + "Value": "_Default-1-cee0e2939ece72d650cb0331f4be4669" }, { "Key": "graphql.operation.name", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op__NET7.snap index dae2603aeec..2700e91cddf 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_1_field_and_op__NET7.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "cee0e2939ece72d650cb0331f4be4669" + "Value": "_Default-1-cee0e2939ece72d650cb0331f4be4669" }, { "Key": "graphql.operation.name", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field.snap index efa114cbf82..efee13923db 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "2e55fbe10a9e3ddf26935a8f8d15ec89" + "Value": "_Default-1-2e55fbe10a9e3ddf26935a8f8d15ec89" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field__NET7.snap index 73ee6bc8565..783652f24f0 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_3_field__NET7.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "2e55fbe10a9e3ddf26935a8f8d15ec89" + "Value": "_Default-1-2e55fbe10a9e3ddf26935a8f8d15ec89" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field.snap index ccb95e74da4..ded7c9b9ac9 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "a5f924bb2f5f8651014e92e1cc2428c7" + "Value": "_Default-1-a5f924bb2f5f8651014e92e1cc2428c7" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field__NET7.snap index 78704c8d655..0e8e0a920fb 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Create_operation_display_name_with_4_field__NET7.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "a5f924bb2f5f8651014e92e1cc2428c7" + "Value": "_Default-1-a5f924bb2f5f8651014e92e1cc2428c7" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name.snap index 3fbdb1fa1c2..ba2917a876a 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "6af18618ae20c266f6ffc352b78cb69b" + "Value": "_Default-1-6af18618ae20c266f6ffc352b78cb69b" }, { "Key": "graphql.operation.name", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name__NET7.snap index 15554f70720..b8ab25a95f0 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Ensure_operation_name_is_used_as_request_name__NET7.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "6af18618ae20c266f6ffc352b78cb69b" + "Value": "_Default-1-6af18618ae20c266f6ffc352b78cb69b" }, { "Key": "graphql.operation.name", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Not_Reached.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Not_Reached.snap index 89c7e497608..2e15c7fea28 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Not_Reached.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Not_Reached.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "79ecf2e15f97b06a2830d8730e407c91" + "Value": "_Default-1-79ecf2e15f97b06a2830d8730e407c91" }, { "Key": "graphql.document.body", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Not_Reached__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Not_Reached__NET7.snap index 6b3391a1ee7..9d2ba9e263c 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Not_Reached__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Not_Reached__NET7.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "79ecf2e15f97b06a2830d8730e407c91" + "Value": "_Default-1-79ecf2e15f97b06a2830d8730e407c91" }, { "Key": "graphql.document.body", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Reached.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Reached.snap index d3202ee7774..8e1ddd2c5ca 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Reached.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Reached.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "79ecf2e15f97b06a2830d8730e407c91" + "Value": "_Default-1-79ecf2e15f97b06a2830d8730e407c91" }, { "Key": "graphql.document.body", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Reached__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Reached__NET7.snap index ea30a2acee8..4996716107f 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Reached__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.MaxComplexity_Reached__NET7.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "79ecf2e15f97b06a2830d8730e407c91" + "Value": "_Default-1-79ecf2e15f97b06a2830d8730e407c91" }, { "Key": "graphql.document.body", diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed.snap index 5db86e6415e..f1e3a1d98c4 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "f7e9989fbb67af7fa747a9983313c9e5" + "Value": "_Default-1-f7e9989fbb67af7fa747a9983313c9e5" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed__NET7.snap index de749a6899a..274c05d4964 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/QueryInstrumentationTests.Track_events_of_a_simple_query_detailed__NET7.snap @@ -15,7 +15,7 @@ }, { "Key": "graphql.operation.id", - "Value": "f7e9989fbb67af7fa747a9983313c9e5" + "Value": "_Default-1-f7e9989fbb67af7fa747a9983313c9e5" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName.snap index c52d193904c..c06ce623854 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName.snap @@ -43,7 +43,7 @@ }, { "Key": "graphql.operation.id", - "Value": "530cb46cabc38757c74c05cc7a96b636" + "Value": "_Default-1-530cb46cabc38757c74c05cc7a96b636" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName__NET7.snap index b92202f6bad..60658aa9148 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Get_SingleRequest_GetHeroName__NET7.snap @@ -43,7 +43,7 @@ }, { "Key": "graphql.operation.id", - "Value": "530cb46cabc38757c74c05cc7a96b636" + "Value": "_Default-1-530cb46cabc38757c74c05cc7a96b636" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName.snap index c02b9439cfb..1b1249162c2 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName.snap @@ -47,7 +47,7 @@ }, { "Key": "graphql.operation.id", - "Value": "a570a6bff748b5916eadf153261d9c6d" + "Value": "_Default-1-a570a6bff748b5916eadf153261d9c6d" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default.snap index 4e55ff1fb27..ec525b84bfb 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default.snap @@ -27,7 +27,7 @@ }, { "Key": "graphql.operation.id", - "Value": "a570a6bff748b5916eadf153261d9c6d" + "Value": "_Default-1-a570a6bff748b5916eadf153261d9c6d" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default__NET7.snap index 9b120d22a22..afe49f4b835 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName_Default__NET7.snap @@ -27,7 +27,7 @@ }, { "Key": "graphql.operation.id", - "Value": "a570a6bff748b5916eadf153261d9c6d" + "Value": "_Default-1-a570a6bff748b5916eadf153261d9c6d" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName__NET7.snap index 49265abe6bb..62a2329b082 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_SingleRequest_GetHeroName__NET7.snap @@ -47,7 +47,7 @@ }, { "Key": "graphql.operation.id", - "Value": "a570a6bff748b5916eadf153261d9c6d" + "Value": "_Default-1-a570a6bff748b5916eadf153261d9c6d" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity.snap index 77a6d3d92c8..bc25e55af3b 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity.snap @@ -51,7 +51,7 @@ }, { "Key": "graphql.operation.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" + "Value": "_Default-1-1d4bca4d0dff630390ddf48e9085589d" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity__NET7.snap index e8d9fe1f2af..78959d92435 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_query_to_http_activity__NET7.snap @@ -51,7 +51,7 @@ }, { "Key": "graphql.operation.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" + "Value": "_Default-1-1d4bca4d0dff630390ddf48e9085589d" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity.snap index 77a6d3d92c8..bc25e55af3b 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity.snap @@ -51,7 +51,7 @@ }, { "Key": "graphql.operation.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" + "Value": "_Default-1-1d4bca4d0dff630390ddf48e9085589d" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity__NET7.snap index e8d9fe1f2af..78959d92435 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_add_variables_to_http_activity__NET7.snap @@ -51,7 +51,7 @@ }, { "Key": "graphql.operation.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" + "Value": "_Default-1-1d4bca4d0dff630390ddf48e9085589d" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response.snap index a013224ee71..7e4b88fcc0c 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response.snap @@ -47,7 +47,7 @@ }, { "Key": "graphql.operation.id", - "Value": "c563b5e7a3e68a1f25847ac7ab07017c" + "Value": "_Default-1-c563b5e7a3e68a1f25847ac7ab07017c" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response__NET7.snap index 2d4195c0981..38268989b38 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_capture_deferred_response__NET7.snap @@ -47,7 +47,7 @@ }, { "Key": "graphql.operation.id", - "Value": "c563b5e7a3e68a1f25847ac7ab07017c" + "Value": "_Default-1-c563b5e7a3e68a1f25847ac7ab07017c" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built.snap index 18829e82522..9c5acc163d6 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built.snap @@ -47,7 +47,7 @@ }, { "Key": "graphql.operation.id", - "Value": "c0513b4b6f0cf7430f64de4aa3dcd7c6" + "Value": "_Default-1-c0513b4b6f0cf7430f64de4aa3dcd7c6" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built__NET7.snap index c9586a09316..12d691a2d20 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_ensure_list_path_is_correctly_built__NET7.snap @@ -47,7 +47,7 @@ }, { "Key": "graphql.operation.id", - "Value": "c0513b4b6f0cf7430f64de4aa3dcd7c6" + "Value": "_Default-1-c0513b4b6f0cf7430f64de4aa3dcd7c6" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities.snap index 5235090bd1c..e95f7a2e96d 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities.snap @@ -47,7 +47,7 @@ }, { "Key": "graphql.operation.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" + "Value": "_Default-1-1d4bca4d0dff630390ddf48e9085589d" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities__NET7.snap index fdfb8525f52..f8929e9fe1e 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_variables_are_not_automatically_added_to_activities__NET7.snap @@ -47,7 +47,7 @@ }, { "Key": "graphql.operation.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" + "Value": "_Default-1-1d4bca4d0dff630390ddf48e9085589d" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map.snap index 32921294921..2b9e6aaf159 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map.snap @@ -51,7 +51,7 @@ }, { "Key": "graphql.operation.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" + "Value": "_Default-1-1d4bca4d0dff630390ddf48e9085589d" } ], "event": [ diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map__NET7.snap b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map__NET7.snap index 72cbd888d6a..0f7d1b2f00c 100644 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map__NET7.snap +++ b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/__snapshots__/ServerInstrumentationTests.Http_Post_with_extensions_map__NET7.snap @@ -51,7 +51,7 @@ }, { "Key": "graphql.operation.id", - "Value": "1d4bca4d0dff630390ddf48e9085589d" + "Value": "_Default-1-1d4bca4d0dff630390ddf48e9085589d" } ], "event": [