graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

Support .NET 6 Hot Reload

Open tobias-tengler opened this issue 2 years ago • 3 comments

This uses a Type Module in combination with MetadataUpdateHandlerAttribute to detect hot reloads and evict / rebuild the schema automatically:

HotChocolate_HotReload

I wasn't really sure where to place the related pieces and this is more of a POC to see if this is something we want to support. But I think Hot Reloading will become increasingly more popular, so Hot Chocolate should support it.

tobias-tengler avatar Jun 17 '22 08:06 tobias-tengler

@michaelstaib @PascalSenn how do you feel about this? I just used a Type Module, since it's something I know and it didn't require adding anything, but I feel like maybe it's too indirect. Maybe we should have something that evicts the request executor / rebuilds the schema explicitly, since the semantics of Type Modules could change.

tobias-tengler avatar Jun 17 '22 08:06 tobias-tengler

This looks great Tobias ... There are a couple of downstream issues with this that we need to get out of the way.

At the moment the resolver compile does not cache compiled expressions. This is something we need to to do so that we do not block hot reload for larger schemas.

But we can still go ahead and get the one into main and then fix the fallout :D

michaelstaib avatar Jun 17 '22 13:06 michaelstaib

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 17 '22 14:08 CLAassistant