Skip to content

Support for scoped services being injected into schema types constructor #133

Open
@ampersandd

Description

@ampersandd

For now it is possible to set own dependency injector for executor using WithDependencyInjector method. Then using InjectAttribute for parameters of Query methods we can inject scoped services using provided dependency container.
But what if we need to share scoped services within whole Query class injecting them into constructor?
For now services injected into constructor of schema type are resolved using typeResolutionDelegate provided into GraphQLEngine constructor. Engine mainly constructed one time and that's why there is no option to provide it with scoped services resolution (used in Microsoft ASP.NET Core dependency
container).
Is there any solution to use injector provided for executor by WithDependencyInjector method to resolve services for injection into constructor of schema types?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions