Skip to content

DefaultContext added via declaration-merging is strictly forcing HttpHeaders #2386

@vz-tl

Description

@vz-tl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions