I'm getting the following error message when testing queries on a test project:
"The feature Authorization is missing the state with the key HotChocolate.Authorization.UserState"
My TestExecutorHelper has the .AddAuthorization() and .AddAuthorizationPermissions() it still doesn't work.
Does anyone know how i can solve this?
Here's my TestExecutor.ExecuteAsync method
IRequestExecutorBuilder requestExecutor = serviceCollection
.AddAuthorization()
.AddLogging()
.AddGraphQL()
.AddAuthorization()
.AddAuthorizePermissions()
.AddErrorFilter<ErrorFilter>()
.AddQueryType<QueryType>();
var serviceProvider = requestExecutor.Services.BuildServiceProvider();
var request = QueryRequestBuilder.New()
.SetQuery(query)
.SetServices(serviceProvider)
.Create();
var executor = await requestExecutor.BuildRequestExecutorAsync();
return await executor.ExecuteAsync(request);