This is necessary as I need to show which array element is causing the issue.
This was working fine before in HotChocolate 10, but after upgrading to 12 this is breaking. I am running the following line and it is breaking with the error below it:
IErrorBuilder errorBuilder = new ErrorBuilder()
.SetPath(new List<string>() { "Users[0]"})
"extensions": {
"message": "`Users[0]` is not a valid GraphQL type name. (Parameter 'value')",
"stackTrace": " at HotChocolate.NameString..ctor(String value)
at HotChocolate.NameString.ConvertFromString(String s)
at HotChocolate.Path.FromList(IReadOnlyList`1 path)
at HotChocolate.ErrorBuilder.SetPath(IReadOnlyList`1 path)
at AppAPI.Common.AppServicesExceptionHandler.ConstructQueryError(String type, String path, String idCode, String description, Dictionary`2 parameters) in \\Project.AppAPI HOT CHOCOLATE 12\\AppAPI WebAPI\\Common\\Exceptions\\AppServicesExceptionHandler.cs:line 268
at AppAPI.Common.AppServicesExceptionHandler.ProcessException(Exception e, IConfiguration configuration) in \\Project.AppAPI HOT CHOCOLATE 12\\AppAPI WebAPI\\Common\\Exceptions\\AppServicesExceptionHandler.cs:line 97
at AppAPI.Queries.TestByPeriodQuery.GetTestByPeriod(Int32 accountId, DateTime startUtcDate, DateTime endUtcDate, String aggregatePeriodIdCode, Int32[] Users, Int32[] monitorGroupIds, String[] groupByIdCodes, IMediator mediator, IMapper mapper, IHttpContextAccessor httpContextAccessor, IConfiguration configuration) in \\Project.AppAPI HOT CHOCOLATE 12\\AppAPI WebAPI\\Queries\\TestByPeriodQuery.cs:line 43
at HotChocolate.Resolvers.Expressions.ExpressionHelper.AwaitTaskHelper[T](Task`1 task)
at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.<<CreateResolverMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at HotChocolate.AspNetCore.Authorization.AuthorizeMiddleware.InvokeAsync(IDirectiveContext context)
at HotChocolate.Utilities.MiddlewareCompiler`1.ExpressionHelper.AwaitTaskHelper(Task task)
at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken)
at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken)"
}