Closed julkue closed 1 week ago
headers: new HttpHeaders({
"Accept": "*/*, application/json",
"Content-Type": "application/json",
"Access-Control-Allow-Headers": "*",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Method": "*"
}),
Thats works for me :)
@krystadamianpzpn Thanks, this also seems to work for me!
Would be great to have it documented.
Describe the bug
I'm trying to use the
HttpBatchLink
, just by replacingHttpLink
withHttpBachLink
, resulting in the following code of my GraphQl module:My expectation would be that this works because this follows the docs. However, instead I'm getting an error in the console throwed by Apollo Angular:
It seems to complain that
headers
is not aMap
. The error is thrown on this line:https://github.com/kamilkisiela/apollo-angular/blob/master/packages/apollo-angular/http/src/http-batch-link.ts#L158
So, effectively
context.headers.keys()
is not working because headers - as you can see in my above example - is an Object, not a Map. However, this follows the documentation as well, therefore I'm confused.I now even tried to adjust my above
authInstance
method to the following, making the header aMap
:But that will just lead to the next error:
Sice I'm following the documentation I'm lost here and I'm assuming that the problem is not in my usage of the library.
Environment: