ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.26k stars 746 forks source link

Fusion gateway schema hot reload not working with ConfigureFromFile #6500

Open interad-woergoetter opened 1 year ago

interad-woergoetter commented 1 year ago

Is there an existing issue for this?

Product

Hot Chocolate

Describe the bug

When I configure my fusion gateway server from a file, changes to the file don't take effect until the server is restarted.

services
    .AddFusionGatewayServer()
    .ConfigureFromFile("gateway.fgp", watchFileForUpdates: true)

The issue occurred in version 13.5.1. After downgrading to 13.2.1, when the configuration looked slightly differently, hot reload worked without needing to restart.

Steps to reproduce

  1. Set up a HotChocolate Fusion gateway server with services.AddFusionGatewayServer().ConfigureFromFile("gateway.fgp", watchFileForUpdates: true).
  2. Create a valid gateway.fgp file.
  3. Start the GraphQL Fusion server.
  4. Confirm in BananaCakePop that the schema was loaded correctly from the gateway.fgp file.
  5. Replace the gateway.fgp file with a different valid configuration.
  6. Reload the schema in BananaCakePop and notice that the schema hasn't changed.
  7. Restart the GraphQL Fusion server.
  8. Confirm that BananaCakePop now shows the new schema.

Relevant log output

No response

Additional Context?

.ConfigureFromCloud() seems to work. So I assume the error might be related to the file watcher.

Version

13.5.1

jeroenbongers commented 10 months ago

Just wanted to add that we have the same issue. I can even delete the gateway.fgp file and it keeps working.

However if I restart it after deleting the file it can't load the schema, so I'm sure that the same file is being loaded and the correct directory is being used.