You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.
The middleware example in the readme should typecheck when used in Typescript:
apolloFetch.use(({ request, options },next)=>{if(!options.headers){options.headers={};// Create the headers object if needed.}options.headers['authorization']='created token';next();});
Actual outcome:
An empty object cannot be assigned to options.headers:
message: 'Type '{}' is not assignable to type 'Headers | string[][] | undefined'.
Type '{}' is not assignable to type 'string[][]'.
Property 'includes' is missing in type '{}'.'
Apparently options.headers is either string[][] or Headers, where Headers seems to be (from the dom lib in the Typescript compiler options below):
Intended outcome:
The middleware example in the readme should typecheck when used in Typescript:
Actual outcome:
An empty object cannot be assigned to
options.headers
:Apparently
options.headers
is eitherstring[][]
orHeaders
, whereHeaders
seems to be (from thedom
lib in the Typescript compiler options below):How to reproduce the issue:
Typescript compiler options:
If there's anything else you need to be able to reproduce, let me know and I'll try to help out.
The text was updated successfully, but these errors were encountered: