Non-blocking Schema Initialization for ASP.net core middleware
See original GitHub issueIs your feature request related to a problem? Please describe. I’m just started looking into this tool so perhaps I’m missing something, but it would be nice if there were the option to load the schema in a non-blocking when using the ASP.net core middleware.
Right now I’m having to do something like this to initialize the schema in Startup.cs:
public void ConfigureServices(IServiceCollection services) { ISchema schema = Schema.Create(File.ReadAllText(($"{env.ContentRootPath}/GraphQL/schema.graphql"))); services.AddGraphQL(schema); }
Describe the solution you’d like It would be nice if there were an alternative async lazy initialization. I imagine there could be performance downsides if requests come in before the application loads; however, this could be mitigated by using something like this (https://github.com/thomaslevesque/AspNetCore.AsyncInitialization) for those concerned about performance.
Describe alternatives you’ve considered
- Not using the middleware and implementing async schema loading/the endpoint
- Maybe this is possible and I’ve just overlooked something key
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
If you are on version 9 preview try the new schema builder:
This one is now implemented with the new configuration API on version 11.