You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When constructing a schema with an invalid name we get the following error:
An unhandled exception has occurred while executing the request.
System.ArgumentException: The specified name is not a valid GraphQL name. (Parameter 'value')
at HotChocolate.Utilities.NameUtils.EnsureGraphQLName(String name, String argumentName)
at HotChocolate.Types.Descriptors.Definitions.DefinitionBase.set_Name(String value)
at HotChocolate.Execution.RequestExecutorResolver.SetSchemaNameInterceptor.OnBeforeCompleteName(ITypeCompletionContext completionContext, DefinitionBase definition)
at HotChocolate.Configuration.AggregateTypeInterceptor.OnBeforeCompleteName(ITypeCompletionContext completionContext, DefinitionBase definition)
at HotChocolate.Types.TypeSystemObjectBase`1.OnBeforeCompleteName(ITypeCompletionContext context, DefinitionBase definition)
at HotChocolate.Types.TypeSystemObjectBase`1.CompleteName(ITypeCompletionContext context)
at HotChocolate.Configuration.TypeInitializer.CompleteTypeName(RegisteredType registeredType)
at HotChocolate.Configuration.TypeInitializer.ProcessTypes(TypeDependencyFulfilled fulfilled, Func`2 action)
at HotChocolate.Configuration.TypeInitializer.CompleteNames()
at HotChocolate.Configuration.TypeInitializer.Initialize()
at HotChocolate.SchemaBuilder.Setup.InitializeTypes(SchemaBuilder builder, IDescriptorContext context, IReadOnlyList`1 types)
at HotChocolate.SchemaBuilder.Setup.Create(SchemaBuilder builder, LazySchema lazySchema, IDescriptorContext context)
at HotChocolate.SchemaBuilder.Create(IDescriptorContext context)
at HotChocolate.SchemaBuilder.HotChocolate.ISchemaBuilder.Create(IDescriptorContext context)
at HotChocolate.Execution.RequestExecutorResolver.CreateSchemaAsync(ConfigurationContext context, RequestExecutorSetup setup, RequestExecutorOptions executorOptions, IServiceProvider schemaServices, TypeModuleChangeMonitor typeModuleChangeMonitor, CancellationToken cancellationToken)
at HotChocolate.Execution.RequestExecutorResolver.CreateSchemaServicesAsync(ConfigurationContext context, RequestExecutorSetup setup, CancellationToken cancellationToken)
at HotChocolate.Execution.RequestExecutorResolver.GetRequestExecutorNoLockAsync(String schemaName, CancellationToken cancellationToken)
at HotChocolate.Execution.RequestExecutorResolver.GetRequestExecutorAsync(String schemaName, CancellationToken cancellationToken)
Debugging this error would be a lot easier if the invalid value would be logged as well.
The solution you'd like
In NameUtils.EnsureGraphQLName add the invalid value to the exception message.
throw new ArgumentException(string.Format(NameUtils_InvalidGraphQLName, name), argumentName);
Change the string from The specified name is not a valid GraphQL name. to {0} is not a valid GraphQL name..
The text was updated successfully, but these errors were encountered:
Product
Hot Chocolate
Is your feature request related to a problem?
When constructing a schema with an invalid name we get the following error:
Debugging this error would be a lot easier if the invalid value would be logged as well.
The solution you'd like
In
NameUtils.EnsureGraphQLName
add the invalid value to the exception message.throw new ArgumentException(string.Format(NameUtils_InvalidGraphQLName, name), argumentName);
Change the string from
The specified name is not a valid GraphQL name.
to{0} is not a valid GraphQL name.
.The text was updated successfully, but these errors were encountered: