Dave van Herten
This is an interesting implementation. All of the GraphQL implementations I’ve seen so far have accessed the Entity Framework DB context by adding Service Location within Resolve methods which allows for an instance per request.
This takes a different take on it where a controller is used to build up the schema and execute it allowing the controller to bring in the request scoped DBContext dependency. Despite the service location, this has the advantage of a singleton schema declaration which prevents building it on every request.
The OPs mechanism is essentially trading avoiding service location in favor of building the schema up on every single request. Depending on the size of your schema I like the way this looks, but I’d have to play with it more.
Neat stuff! Thanks for sharing!