apollographql/apollo-link

TypeScript error in Header authentication tutorial

dandv opened this issue · 1 comments

dandv commented

Expected Behavior

No TypeScript errors in the code from https://www.apollographql.com/docs/react/v3.0-beta/networking/authentication/#header.

Actual Behavior

TypeScript error for the link: authLink.concat(httpLink) line:

Property 'toKey' is missing in type 'import(".../node_modules/@apollo/client/link/core/types").Operation' but required in type 'import(".../node_modules/apollo-link/lib/types").Operation'.

A simple reproduction

The official Header authentication sample.

Switching to "@apollo/link-persisted-queries": "1.0.0-beta.0" worked for me.