You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you create any query, there is an interface and a class implementation generated for it. Only the direct class implementation is added to the service collection when using services.AddGraphQLClient(). This means the interface type cannot be used as a dependency on other classes.
A workaround is available, but this needs to be repeated manually for each query type:
Product
Strawberry Shake
Is your feature request related to a problem?
If you create any query, there is an interface and a class implementation generated for it. Only the direct class implementation is added to the service collection when using services.AddGraphQLClient(). This means the interface type cannot be used as a dependency on other classes.
A workaround is available, but this needs to be repeated manually for each query type:
services.AddSingleton(sp => sp.GetRequiredService<IGraphQLClient>().GetTaskTypes);
The interface type is needed so it can be mocked in unit tests.
The solution you'd like
Register the generated query interfaces in the service collection.
The text was updated successfully, but these errors were encountered: