Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support .NET Hot Reload #5638

Closed
tobias-tengler opened this issue Dec 23, 2022 · 5 comments
Closed

Support .NET Hot Reload #5638

tobias-tengler opened this issue Dec 23, 2022 · 5 comments

Comments

@tobias-tengler
Copy link
Collaborator

tobias-tengler commented Dec 23, 2022

Is your feature request related to a problem?

It would be nice if the Hot Reload functionality of .NET played nicely with Hot Chocolate:

  • Removed and added schema members should be correctly updated (can use the existing schema eviction (replacement) mechanism)
  • Changes to Resolver signatures should be correctly handled

The solution you'd like

A Hot Reload can be intercepted using the MetadataUpdateHandlerAttribute.

I initially explored this in #5165.

Product

Hot Chocolate

@glen-84
Copy link
Collaborator

glen-84 commented Feb 6, 2023

#5165 was merged, not sure if there's more to do?

@glen-84
Copy link
Collaborator

glen-84 commented Feb 7, 2023

I get this after a while, so I think I'm going to switch back to --no-hot-reload for now.

HotChocolate.SchemaException: For more details look at the `Errors` property.

1. Operation is not valid due to the current state of the object. (HotChocolate.Types.StaticObjectTypeExtension)

   at HotChocolate.Configuration.TypeInitializer.DiscoverTypes()
   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(String schemaName, RequestExecutorSetup options, RequestExecutorOptions executorOptions, IServiceProvider serviceProvider, TypeModuleChangeMonitor typeModuleChangeMonitor, CancellationToken cancellationToken)
   at HotChocolate.Execution.RequestExecutorResolver.CreateSchemaServicesAsync(String schemaName, RequestExecutorSetup options, CancellationToken cancellationToken)
   at HotChocolate.Execution.RequestExecutorResolver.GetRequestExecutorNoLockAsync(String schemaName, CancellationToken cancellationToken)
   at HotChocolate.Execution.RequestExecutorResolver.GetRequestExecutorAsync(String schemaName, CancellationToken cancellationToken)
   at HotChocolate.Execution.RequestExecutorProxy.GetRequestExecutorAsync(CancellationToken cancellationToken)
   at HotChocolate.AspNetCore.HttpPostMiddlewareBase.HandleRequestAsync(HttpContext context)
   at HotChocolate.AspNetCore.HttpPostMiddlewareBase.InvokeAsync(HttpContext context)
   at Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.<>c__DisplayClass20_0.<<UseCancellation>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)

@tobias-tengler
Copy link
Collaborator Author

@glen-84 Can you open a new bug for it please?

@glen-84
Copy link
Collaborator

glen-84 commented Feb 7, 2023

@tobias-tengler I can't really create a reproduction, is it still useful to have an issue?

@tobias-tengler
Copy link
Collaborator Author

Yes, it's mainly about organization. It's a new bug that should be tracked separately. And you provided a stack trace at least - that's something to go off of :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants