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
I experience the typescript error in @apollo/client v3.12.5 and v3.12.4 when using MockedProvider or MockedResponse type.
Type 'Unmasked<sub-TData>' is not assignable to type 'Unmasked<super-TData>'.
Type 'sub-TData | (sub-TData extends object ? UnwrapFragmentRefs<RemoveMaskedMarker<RemoveFragmentName<sub-TData>>> : sub-TData)' is not assignable to type 'Unmasked<super-TData>'.
Type 'sub-TData' is not assignable to type 'Unmasked<super-TData>'.
Type 'super-TData' is not assignable to type 'Unmasked<super-TData>'.
11 export interface MockedResponse<out TData = Record<string, any>, out TVariables = Record<string, any>> {
Issue Description
I experience the typescript error in @apollo/client v3.12.5 and v3.12.4 when using
MockedProvider
orMockedResponse
type.The origin of the error appears to be here
apollo-client/src/testing/core/mocking/mockLink.ts
Line 40 in cda321c
In the source code it is suppressed but in the installed package there is no ignore statement
It seems the error can be fixed if
out TData
is changed toin out TData
. I think it is related to branches in theUnmasked
type.Link to Reproduction
https://codesandbox.io/p/devbox/admiring-newton-94hmcs
Reproduction Steps
npm i && npm run type-check
@apollo/client
version3.12.5
The text was updated successfully, but these errors were encountered: