Product
Hot Chocolate
Version
16.0.9
Link to minimal reproduction
https://github.com/ChilliCream/graphql-platform/blob/1063f8bde76509c1e6cbf36e034a63cc40c51b21/src/HotChocolate/Core/src/Types/Types/Directives/DirectiveTypeInterceptor.cs
Steps to reproduce
- Set up GraphQL with
.AddApolloFederation():
builder.Services.AddGraphQLServer()
.AddApolloFederation()
.AddTypes()
.AddFiltering()
.AddSorting()
.AddPagingArguments();
- Create query with paging
[QueryType]
public static partial class EmployeeResolver
{
[UseConnection]
public static async Task<PageConnection<Employee>> GetEmployeeByPageTest(AppDbContext db, QueryContext<Employee> query, PagingArguments args)
{
var page = await db.Employees.With(query).OrderByDescending(e => e.EmpId).ToPageAsync(args);
return new PageConnection<Employee>(page);
}
}
- Build and run applicationl; it crashes and fails to start.
What is expected?
The application runs and you can run the query with paging.
What is actually happening?
The application is crashing on startup.
Relevant log output
System.NullReferenceException: Object reference not set to an instance of an object.
at HotChocolate.Types.DirectiveTypeInterceptor.RegisterDirectiveUsage(IDirectivesProvider member)
at HotChocolate.Types.DirectiveTypeInterceptor.InspectType(TypeSystemObject obj)
at HotChocolate.Types.DirectiveTypeInterceptor.OnAfterCompleteMetadata(ITypeCompletionContext context, TypeSystemConfiguration configuration)
at HotChocolate.Configuration.AggregateTypeInterceptor.OnAfterCompleteMetadata(ITypeCompletionContext context, TypeSystemConfiguration configuration)
at HotChocolate.Types.TypeSystemObject`1.OnAfterCompleteMetadata(ITypeCompletionContext context, TypeSystemConfiguration configuration)
at HotChocolate.Types.TypeSystemObject`1.CompleteMetadata(ITypeCompletionContext context)
at HotChocolate.Configuration.TypeInitializer.CompleteMetadata()
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.RequestExecutorManager.CreateSchemaAsync(ConfigurationContext context, RequestExecutorSetup setup, RequestExecutorOptions executorOptions, IServiceProvider schemaServices, TypeModuleChangeMonitor typeModuleChangeMonitor, CancellationToken cancellationToken)
at HotChocolate.Execution.RequestExecutorManager.CreateSchemaServicesAsync(ConfigurationContext context, RequestExecutorSetup setup, TypeModuleChangeMonitor typeModuleChangeMonitor, CancellationToken cancellationToken)
at HotChocolate.Execution.RequestExecutorManager.CreateRequestExecutorAsync(String schemaName, Boolean isInitialCreation, CancellationToken cancellationToken)
at HotChocolate.Execution.RequestExecutorManager.GetExecutorAsync(String schemaName, CancellationToken cancellationToken)
at HotChocolate.AspNetCore.Warmup.RequestExecutorWarmupService.WarmupAsync(String schemaName, CancellationToken cancellationToken)
at HotChocolate.AspNetCore.Warmup.RequestExecutorWarmupService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__14_1(IHostedService service, CancellationToken token)
at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
Additional context
No response
Product
Hot Chocolate
Version
16.0.9
Link to minimal reproduction
https://github.com/ChilliCream/graphql-platform/blob/1063f8bde76509c1e6cbf36e034a63cc40c51b21/src/HotChocolate/Core/src/Types/Types/Directives/DirectiveTypeInterceptor.cs
Steps to reproduce
.AddApolloFederation():What is expected?
The application runs and you can run the query with paging.
What is actually happening?
The application is crashing on startup.
Relevant log output
Additional context
No response