Error: Could not convert argument of type symbol to string. #897
-
ScreenshotDescriptionI recently upgraded from
I'm wondering if anyone has ideas what could be causing this, and if there's some breaking change that I need to adapt to? Thanks! Reproduction Steps/Repo LinkN/A |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I also ran into this recently. From what I can tell, at some point (I think in this commit), graphql-request started using the - const headers = { ...params.headers }
+ const headers = new Headers(params.headers as HeadersInit) In my use-case, I was originally modifying and passing headers in a request middleware as such: const requestMiddleware: RequestMiddleware = async (request) => {
return {
...request,
headers: {
...request.headers,
Authorization: `Bearer ${await getToken()}`,
},
};
}; After the change in the above commit, the resulting headers that are passed look something to the effect of:
at which point I believe the error is thrown. For me, I simply changed from spreading the headers to constructing a new I'm not sure if this is the same issue as your use-case based on the context provided but thought I'd share |
Beta Was this translation helpful? Give feedback.
I also ran into this recently. From what I can tell, at some point (I think in this commit), graphql-request started using the
Headers
object as opposed to a plain JS objectIn my use-case, I was originally modifying and passing headers in a request middleware as such:
After the change in the above commit, the resulting headers that are passed look something to the effect of: