aws-mobile-appsync-sdk-js icon indicating copy to clipboard operation
aws-mobile-appsync-sdk-js copied to clipboard

aws-appsync-subscription-link v3.0.9 compile error

Open cheziyi opened this issue 4 years ago • 1 comments

Note: If your issue/feature-request/question is regarding the AWS AppSync service, please log it in the official AWS AppSync forum

Do you want to request a feature or report a bug? Bug

What is the current behavior? Project using aws-appsync-subscription-link v3.0.9 fails to compile in a project which uses it.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Install @apollo/client v3, aws-appsync-auth-link 3.0.7 and aws-appsync-subscription-link v3.0.9. Run tsc to build, and error below is thrown.

node_modules/aws-appsync-subscription-link/lib/subscription-handshake-link.d.ts:17:5 - error TS2416: Property 'request' in type 'SubscriptionHandshakeLink' is not assignable to the same property in base type 'ApolloLink'.
  Type '(operation: Operation) => Observable<unknown>' is not assignable to type '(operation: Operation, forward?: NextLink | undefined) => Observable<FetchResult<{ [key: string]: any; }, Record<string, any>, Record<string, any>>> | null'.
    Type 'Observable<unknown>' is not assignable to type 'Observable<FetchResult<{ [key: string]: any; }, Record<string, any>, Record<string, any>>>'.
      Type 'unknown' is not assignable to type 'FetchResult<{ [key: string]: any; }, Record<string, any>, Record<string, any>>'.

17     request(operation: Operation): Observable<unknown>;
       ~~~~~~~

What is the expected behavior? Project builds successfully.

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions? Typescript v4, @apollo/client v3, node v14. This does not happen with aws-appsync-auth-link 3.0.6 and aws-appsync-subscription-link v3.0.8.

cheziyi avatar Sep 27 '21 15:09 cheziyi

Related to https://github.com/awslabs/aws-mobile-appsync-sdk-js/pull/566

cheziyi avatar Sep 27 '21 15:09 cheziyi