Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Your service provider may not support keyed services for HotChocolate.Stitching.Redis 13.9.0 in dotnet aspire #7029

Open
gpproton opened this issue Mar 28, 2024 · 0 comments
Labels
🐛 bug Something isn't working 🌶️ hot chocolate

Comments

@gpproton
Copy link

gpproton commented Mar 28, 2024

Product

Hot Chocolate

Version

13.9.0

Link to minimal reproduction

https://github.com/gpproton/hotchocolate-aspire

Environment:

windows 11
vscode
.NET 8.0 Aspire
webapi
redis

Steps to reproduce

Added the line below after setting up dependent services.

builder.Services
    .AddGraphQLServer()
    .AddQueryType(d => d.Name("Query"))
    .AddRemoteSchemasFromRedis("Demo", sp => sp.GetRequiredService<IConnectionMultiplexer>());

What is expected?

To setup a graphql gateway using federation with Redis and this was working fine before dotnet aspire preview 4.

What is actually happening?

The other services work fine except for the gateway service when using AddRemoteSchemasFromRedis for schema stitching.

Relevant log output

Unhandled exception. System.InvalidOperationException: This service descriptor is keyed. Your service provider may not support keyed services.
   at Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ThrowKeyedDescriptor()
   at Microsoft.Extensions.DependencyInjection.ServiceDescriptor.get_ImplementationType()
   at Microsoft.Extensions.DependencyInjection.HotChocolateStitchingRedisRequestExecutorBuilderExtensions.<>c.<AddRemoteSchemasFromRedis>b__0_2(ServiceDescriptor t)
   at System.Linq.Enumerable.All[TSource](IEnumerable`1 source, Func`2 predicate)
   at Microsoft.Extensions.DependencyInjection.HotChocolateStitchingRedisRequestExecutorBuilderExtensions.AddRemoteSchemasFromRedis(IRequestExecutorBuilder builder, String configurationName, Func`2 connectionFactory)
   at Program.<Main>$(String[] args) in D:\sandbox\hotchocolate-aspire\hotchocolate-aspire.ApiGateway\Program.cs:line 16

Additional context

Alsoo tried with version 13.5.0 and above except 14.0.0 since no version is available for HotChocolate.Stitching.Redis

Screenshot_28-3-2024_194924_localhost
Screenshot_28-3-2024_194947_localhost

@gpproton gpproton added the 🐛 bug Something isn't working label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🌶️ hot chocolate
Projects
None yet
Development

No branches or pull requests

2 participants