I'm working on adding propagation to HotChocolate GraphQL server but simply can't get it working.
I've configured my propagation in my ConfigureServices services.AddHeaderPropagation(o => o.Headers.Add("Authorization"));
I've added it to my httpClient: services.AddHttpClient(AssumptionManagement, c => c.BaseAddress = new Uri("http://localhost:19801")).AddHeaderPropagation();
I've added it in my Configure method:
app.UseHeaderPropagation();
Despite all this it still gives me the following error when I run the app in debug:
An unhandled exception of type System.InvalidOperationException occurred in System.Private.CoreLib.dll: The HeaderPropagationValues.Headers property has not been initialized.
Register the header propagation middleware by adding app.UseHeaderPropagation()
in the Configure(...)
method. Header propagation can only be used within the context of an HTTP request.'
Am I just not seeing something here or what am I doing wrong?