'GraphQL StrawberryCake Unable to resolve service for type <Interface>

I'm using StrawberryCake as GraphQL Client v12.6. I'm following their tutorial to getting started.

After use dotnet graphql init -n ConferenceClient

Then register DI in Startup as follows

services.AddConferenceClient()
     .ConfigureHttpClient(client 
         => client.BaseAddress = new Uri("graphql_url_server_here"));;

I inject into controller as follows

private readonly IConferenceClient _conferenceClient;
    
SearchController(IConferenceClient conferenceClient) { _conferenceClient = conferenceClient; }

When I call to the endpoint of SearchController, it said

Unable to resolve service for type IConferenceClient

Does anyone get this error and how to solve it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source