Describe the bug
In apollo-angular v12, the @apollo/client DefaultContext interface becomes redefined via declaration-merging and specifies the headers property to be strictly of type HttpHeaders , which wasn't the case with pre-v12 versions.
This contradicts how headers are processed and handled in general, either by the underlying @apollo/client package, which just supports Record<string, string> or even apollo-angular, which finally checks if the headers provided in a query context are instanceof HttpHeaders and if not it will just accept a regular object.
Expected behavior
I'm requesting to at least define the headers prop as a union to allow HttpHeaders | Record<string, string>, as I'm currently forced to again redeclare the DefaultContext for supporting that.
Environment:
- @angular/cli@20.3.9
- @angular/core@20.3.10
- @apollo/client@4.0.9
- apollo-angular@12.1.0
- graphql@16.10.0
- typescript@5.9.3
Describe the bug
In
apollo-angularv12, the@apollo/clientDefaultContextinterface becomes redefined via declaration-merging and specifies theheadersproperty to be strictly of typeHttpHeaders, which wasn't the case with pre-v12 versions.This contradicts how headers are processed and handled in general, either by the underlying
@apollo/clientpackage, which just supportsRecord<string, string>or evenapollo-angular, which finally checks if the headers provided in a query context areinstanceof HttpHeadersand if not it will just accept a regular object.Expected behavior
I'm requesting to at least define the
headersprop as a union to allowHttpHeaders | Record<string, string>, as I'm currently forced to again redeclare theDefaultContextfor supporting that.Environment: