graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

The service provider given to AddRedisQueryStorage is scoped to the schema

Open mvestergaard opened this issue 4 years ago • 4 comments

The service provider given to .AddRedisQueryStorage(sp => sp.GetRequiredService<IRedisConnectionProvider>().GetConnection().GetDatabase()) only has access to "schema services" so it cannot resolve IRedisConnectionProvider

A workaround is to use sp.GetApplicationService<IRedisConnectionProvider> instead.

mvestergaard avatar Apr 24 '21 12:04 mvestergaard

I have a similar issue where I do .AddErrorFilter and the error filter doesn't have access to the application's IHttpContextAccessor.

AlexKubiesa avatar Apr 22 '22 17:04 AlexKubiesa

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 21 '22 18:06 stale[bot]

@AlexKubiesa Did you get it to work with sp.GetApplicationService<YourDependency>

PascalSenn avatar Jun 21 '22 19:06 PascalSenn

Yes, I did. Thanks for checking 😃

AlexKubiesa avatar Jun 21 '22 21:06 AlexKubiesa

This issue is fixed in 13.

michaelstaib avatar Jul 03 '23 10:07 michaelstaib