-
-
Notifications
You must be signed in to change notification settings - Fork 787
Description
Product
Strawberry Shake
Version
15.1.7
Link to minimal reproduction
https://github.com/stevefan1999-personal/chilicream-fullstack-bug
Steps to reproduce
- Create a solution with a separated GraphQL client project/assembly
- Configure Strawberry Shake in the client project with source generators
- Run the application with hot reload enabled (
dotnet watch --project ChilliCreamBlazor.Server --verbose
or Visual Studio hot reload) - Modify any .graphql file in the separated client project (except the schema)
- Observe that hot reload reports "No C# changes to apply"
- Attempt manual build - source generator is not triggered
- Try modifying generated files in obj\berry folder - no hot reload notification
What is expected?
- Hot reload should detect changes to .graphql files in the separated assembly
- Source generator should automatically regenerate C# client code
- Hot reload should recognize the regenerated files and reload the application
- Manual builds should trigger the source generator when GraphQL files are modified
What is actually happening?
- Modifying .graphql files shows "No C# changes to apply" message
- Source generator is not triggered on GraphQL file changes
- Manual builds do not trigger code regeneration
- Even direct modifications to generated files in obj\berry folder don't trigger hot reload notifications
- The application continues running with outdated GraphQL client code
Relevant log output
dotnet watch ⌚ [FW] Updated '<Redacted>\ChilliCreamBlazor.GraphQL.Client\GraphQL\GetBooks.graphql'.
dotnet watch ⌚ File change: Update '<Redacted>\ChilliCreamBlazor.GraphQL.Client\GraphQL\GetBooks.graphql'.
dotnet watch ⌚ [FW] Updated '<Redacted>\ChilliCreamBlazor.GraphQL.Client\GraphQL\GetBooks.graphql'.
dotnet watch ⌚ File change: Update '<Redacted>\ChilliCreamBlazor.GraphQL.Client\GraphQL\GetBooks.graphql'.
dotnet watch ⌚ File updated: .\ChilliCreamBlazor.GraphQL.Client\GraphQL\GetBooks.graphql
dotnet watch ⌚ Solution:
dotnet watch ⌚ Project: <Redacted>\ChilliCreamBlazor.Server\ChilliCreamBlazor.Server.csproj
dotnet watch ⌚ Document: <Redacted>\ChilliCreamBlazor.Server\Program.cs [kH3Me5Gz2ryIPSoKum9Bb5Pstz6JE06fLZI43mAhAtE=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.Server\debug\ChilliCreamBlazor.Server.GlobalUsings.g.cs [3N9VcC4C88yI78mo7CtogYkfiCHfJ9uQFXuklq6YE6E=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.Server\debug\.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [nnZJnE5ctiOtSInqqZsaU9nJcO/PkC2LCW54oZ7kKF0=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.Server\debug\ChilliCreamBlazor.Server.AssemblyInfo.cs [VEnw01Z9MyD6/e4BoM8Kq/wpGF9MDLMNKer9NWpW5sg=]
dotnet watch ⌚ Additional: <Redacted>\ChilliCreamBlazor.Server\Components\App.razor [I8fFRjneEB5ilYgsP5ZP7sLBv74LKtnvJJzBjfCjPtU=]
dotnet watch ⌚ Additional: <Redacted>\ChilliCreamBlazor.Server\Components\_Imports.razor [E7dl/08MW8s3PhhSSWcfMkkQJIGJClq5ZrT8IEF3lJ8=]
dotnet watch ⌚ Config: <Redacted>\artifacts\obj\ChilliCreamBlazor.Server\debug\ChilliCreamBlazor.Server.GeneratedMSBuildEditorConfig.editorconfig [lyDOHSaAZyWHiQTZh5UcSjU98Z6fFD5BJO2Oe5gGF3c=]
dotnet watch ⌚ Config: C:\Program Files\dotnet\sdk\10.0.100-preview.6.25326.107\Sdks\Microsoft.NET.Sdk\analyzers\build\config\analysislevel_9_default.globalconfig [Z5Z6v/jv/85BTcyqLaRCJsEfeG6E0m9bq2jtPLCVjMc=]
dotnet watch ⌚ Project: <Redacted>\ChilliCreamBlazor.DTO\ChilliCreamBlazor.DTO.csproj
dotnet watch ⌚ Document: <Redacted>\ChilliCreamBlazor.DTO\Book.cs [6CwYARGoqeipcZwzhtq74Mxd7yZh1y3R6zdUnRZkGzI=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.DTO\debug\ChilliCreamBlazor.DTO.GlobalUsings.g.cs [o8YEi7TZIrF5mpl3+ENio3h7aIEMrGeqhqw6ojKV8ic=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.DTO\debug\.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [nnZJnE5ctiOtSInqqZsaU9nJcO/PkC2LCW54oZ7kKF0=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.DTO\debug\ChilliCreamBlazor.DTO.AssemblyInfo.cs [2tQAoVrJdcx1PoL2As4S5tqZYGwxSbfCRsBPiS4Ss0E=]
dotnet watch ⌚ Config: <Redacted>\artifacts\obj\ChilliCreamBlazor.DTO\debug\ChilliCreamBlazor.DTO.GeneratedMSBuildEditorConfig.editorconfig [LjztqRxUB8iU326gQeRH8VeoCZpzMo0NvgnJWGHkTsE=]
dotnet watch ⌚ Config: C:\Program Files\dotnet\sdk\10.0.100-preview.6.25326.107\Sdks\Microsoft.NET.Sdk\analyzers\build\config\analysislevel_9_default.globalconfig [Z5Z6v/jv/85BTcyqLaRCJsEfeG6E0m9bq2jtPLCVjMc=]
dotnet watch ⌚ Project: <Redacted>\ChilliCreamBlazor.GraphQL.Server\ChilliCreamBlazor.GraphQL.Server.csproj
dotnet watch ⌚ Document: <Redacted>\ChilliCreamBlazor.GraphQL.Server\BookContext.cs [7cU8UQGdBUOgHF+lwg8eVUvjfwBn0LG98NLCpq8KBOc=]
dotnet watch ⌚ Document: <Redacted>\ChilliCreamBlazor.GraphQL.Server\GraphQLServerExtensions.cs [VFFQU8MJqSa2Km9MrlH46YHbCRzo/XgyjjJVS5rEHyM=]
dotnet watch ⌚ Document: <Redacted>\ChilliCreamBlazor.GraphQL.Server\Query.cs [CZaHFSxImb2jycQ6/FkTcysZ3nS8Ad8aRGdSOjiAH/A=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.GraphQL.Server\debug\ChilliCreamBlazor.GraphQL.Server.GlobalUsings.g.cs [8sAcHuxbB68erO5AikA1MOLZvk2wdrXpBSVNuKUkfPg=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.GraphQL.Server\debug\.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [nnZJnE5ctiOtSInqqZsaU9nJcO/PkC2LCW54oZ7kKF0=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.GraphQL.Server\debug\ChilliCreamBlazor.GraphQL.Server.AssemblyInfo.cs [JoM7IRyatQFvDyBDzR14/tUOWcHu+zKL34P3RGLvJ2s=]
dotnet watch ⌚ Config: <Redacted>\artifacts\obj\ChilliCreamBlazor.GraphQL.Server\debug\ChilliCreamBlazor.GraphQL.Server.GeneratedMSBuildEditorConfig.editorconfig [vuj60qVJEsZwmr4OCUyoKl9Vi72aoPDbeLLKEqmK6bI=]
dotnet watch ⌚ Config: C:\Program Files\dotnet\sdk\10.0.100-preview.6.25326.107\Sdks\Microsoft.NET.Sdk\analyzers\build\config\analysislevel_9_default.globalconfig [Z5Z6v/jv/85BTcyqLaRCJsEfeG6E0m9bq2jtPLCVjMc=]
dotnet watch ⌚ Project: <Redacted>\ChilliCreamBlazor.GraphQL.Client\ChilliCreamBlazor.GraphQL.Client.csproj
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.GraphQL.Client\debug\ChilliCreamBlazor.GraphQL.Client.GlobalUsings.g.cs [o8YEi7TZIrF5mpl3+ENio3h7aIEMrGeqhqw6ojKV8ic=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.GraphQL.Client\debug\.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [nnZJnE5ctiOtSInqqZsaU9nJcO/PkC2LCW54oZ7kKF0=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.GraphQL.Client\debug\ChilliCreamBlazor.GraphQL.Client.AssemblyInfo.cs [1FZDrueJdThE6rHS/LM9woWsht4BNM+Rc20iG8jUd1w=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.GraphQL.Client\debug\berry\ChilliCreamBlazorClient.Client.cs [5TJ4vdiq2OYMLfo8qRS8wtTKExhA7LkdI6OiTdCw8FA=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.GraphQL.Client\debug\berry\ChilliCreamBlazorClient.Components.cs [eH3rjnxZ3in/nZ3AeV51+mExa4OJFbLKFQtxaVaGQEs=]
dotnet watch ⌚ Additional: <Redacted>\ChilliCreamBlazor.GraphQL.Client\GraphQL\GetBooks.graphql [MxEzTjo1s3/yfPYORyVkcES2UXI=]
dotnet watch ⌚ Additional: <Redacted>\ChilliCreamBlazor.GraphQL.Client\schema.graphql [xbdzI0U1mh+rUkDgj8UL4kV3+xxY41MFq+muc9S+GDU=]
dotnet watch ⌚ Config: <Redacted>\artifacts\obj\ChilliCreamBlazor.GraphQL.Client\debug\ChilliCreamBlazor.GraphQL.Client.GeneratedMSBuildEditorConfig.editorconfig [KFfrW0Kv9TjlfzDS+LVjlX9aOyE8pbaRJFd3KX780Z4=]
dotnet watch ⌚ Config: C:\Program Files\dotnet\sdk\10.0.100-preview.6.25326.107\Sdks\Microsoft.NET.Sdk\analyzers\build\config\analysislevel_9_default.globalconfig [Z5Z6v/jv/85BTcyqLaRCJsEfeG6E0m9bq2jtPLCVjMc=]
dotnet watch ⌚ Project: <Redacted>\ChilliCreamBlazor.Client\ChilliCreamBlazor.Client.csproj
dotnet watch ⌚ Document: <Redacted>\ChilliCreamBlazor.Client\Program.cs [r5G+gTYoGeV6fCvqiXEGe0V78eBJ3ogOukqhGIXIE10=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.Client\debug\ChilliCreamBlazor.Client.GlobalUsings.g.cs [Z3dDFt3wileqyFz9wWuit9Ty+kPOd8Y4G8glc5aMXYI=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.Client\debug\.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [nnZJnE5ctiOtSInqqZsaU9nJcO/PkC2LCW54oZ7kKF0=]
dotnet watch ⌚ Document: <Redacted>\artifacts\obj\ChilliCreamBlazor.Client\debug\ChilliCreamBlazor.Client.AssemblyInfo.cs [84yhRWLQeYIHtgcdZV62B/wKSNN0DFzr1ZvVZN6Pp4M=]
dotnet watch ⌚ Additional: <Redacted>\ChilliCreamBlazor.Client\Pages\Home.razor [4lvhULC5J1dPLh7u1SugazcW55PQxyNwG6VX/IGFnEM=]
dotnet watch ⌚ Additional: <Redacted>\ChilliCreamBlazor.Client\Pages\Weather.razor [8PxBskO6OTpooBsccPYBdxdP56DawHySl28Ws5AlPYY=]
dotnet watch ⌚ Additional: <Redacted>\ChilliCreamBlazor.Client\Routes.razor [6gckVidsuCLYBZgWG7uCVhJa6py/uytYoBwyL8xwUPM=]
dotnet watch ⌚ Additional: <Redacted>\ChilliCreamBlazor.Client\_Imports.razor [vrf3Lr/4bw4wELAmCcDaYqgLrZFaQotoryxvhxwMVC8=]
dotnet watch ⌚ Additional: <Redacted>\ChilliCreamBlazor.Client\Layout\MainLayout.razor [i8zbm3RTiWbTtjELFa2o4Mh8Bt+RWpBihK+kiBjDbBU=]
dotnet watch ⌚ Additional: <Redacted>\ChilliCreamBlazor.Client\Layout\NavMenu.razor [45UmdORjbuCHeErec5iKahFWOqf/raIWhZWMlbktxaE=]
dotnet watch ⌚ Config: <Redacted>\artifacts\obj\ChilliCreamBlazor.Client\debug\ChilliCreamBlazor.Client.GeneratedMSBuildEditorConfig.editorconfig [fAQuPa5DQJjQQHiwkN6wOML1FG6QVvFsWNyYY3kJSqA=]
dotnet watch ⌚ Config: C:\Program Files\dotnet\sdk\10.0.100-preview.6.25326.107\Sdks\Microsoft.NET.Sdk\analyzers\build\config\analysislevel_9_default.globalconfig [Z5Z6v/jv/85BTcyqLaRCJsEfeG6E0m9bq2jtPLCVjMc=]
dotnet watch 🔥 Hot reload capabilities: Baseline AddMethodToExistingType AddStaticFieldToExistingType NewTypeDefinition ChangeCustomAttributes AddInstanceFieldToExistingType GenericAddMethodToExistingType GenericUpdateMethod UpdateParameters GenericAddFieldToExistingType.
dotnet watch ⌚ No C# changes to apply.
dotnet watch ⌚ Updating diagnostics in the browser.
dotnet watch ⌚ Failed to receive response from a connected browser.
dotnet watch 🔥 Hot reload change handled in 889ms.
Additional context
Using separated assembly for GraphQL client (not in the main project)
Hot reload works correctly for C# files in both projects
Source generator works on initial build but not on subsequent changes
Schema Generation Without Live Server
In the minimal reproduction repo, I've implemented a custom build trigger that generates schema.graphql
without requiring a running server. This might warrant a separate feature request, but I wanted to bring it to the developers' attention as it could inspire improvements to the current workflow.
Integration Challenge: Hot Chocolate + Strawberry Shake
My goal is to create a seamless development experience using:
- Hot Chocolate (GraphQL server)
- Strawberry Shake (GraphQL client)
- Blazor WebAssembly
- Hot reload for rapid development
However, Strawberry Shake has a limitation: it requires a valid schema file path to generate client code. This constraint forced me to restructure my solution architecture:
- Separated the GraphQL/data layer from the ASP.NET Core layer
- Created a dedicated schema builder project that:
- Uses Hot Chocolate server components
- Emits the schema file during build
- Configured Strawberry Shake to consume this generated schema for its source generation
Hot Reload Configuration Limitation
The current hot reload implementation doesn't support forcing a full rebuild when *.graphql
files change. Ideally, we could configure the file watcher to treat GraphQL file changes as "rude edits" that trigger:
- A complete project rebuild
- Assembly reload
- Source generator execution
This would eliminate significant manual overhead in the development workflow. Without this capability, developers must manually rebuild after every GraphQL change, which defeats the purpose of hot reload.