Aws-mobile-appsync-sdk-js: aws-appsync errors calling FetchResult

Created on 16 Apr 2020  路  11Comments  路  Source: awslabs/aws-mobile-appsync-sdk-js

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

What is the current behavior?
[email protected] has these errors;

ERROR in node_modules/aws-appsync-auth-link/lib/auth-link.d.ts:24:55 - error TS2707: Generic type 'FetchResult' requires between 0 and 2 type arguments.

24 request(operation: any, forward: any): Observable ~~~~~~~
25 [key: string]: any;
26 }, Record, Record>>;

node_modules/aws-appsync/lib/client.d.ts:63:98 - error TS2707: Generic type 'FetchResult' requires between 0 and 2 type arguments.

63 mutate(options: MutationOptions): Promise, Record>>;

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?

This is in an angular 9 CLI project

Errors occur with:

aws-appsync 3.0.3
aws-appsync-auth-link 2.0.2

I reverted to:

aws-appsync 3.0.2
aws-appsync-auth-link 2.0.1

and errors dissappear

auth-link

Most helpful comment

Hi, Any estimated date to publish the solution to this case?

All 11 comments

Same problem.
Solved with the same solution just now

The issue is mainly that apollo-link supports FetchResult<x,y,z>only since version apollo-link@^1.2.5 and it's fixed to "apollo-link": "1.2.3" which only accepts 2 parameters

I am having the same issue.Tried downgrading the versions.still it's not working.

The workaround to this issue is found (just about the same problem) here:
https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/559

Will this be fixed anytime soon? It's been almost 3 months since it was reported.

It's simple to reproduce. Create a new app using angular-cli:

ng new testAppSync

cd testAppSync

npm install aws-appsync

Paste this into your app.component.ts and ng serve

import {Component, OnInit} from '@angular/core';
import AWSAppSyncClient from 'aws-appsync/lib';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {

  ngOnInit() {
const appsyncClient = new AWSAppSyncClient({});
  }
}

I personally have given up on this package. I went with the aws-amplify package and a configured apollo client. If you're waiting for this to be resolved, I would encourage others to do the same.

I've been using workarounds for the past few months. I need offline sync and complex object support which amplify does not provide out the box and the AWS documentation points to this library, so it needs to be resolved

This is too late, the fix was deployed after a release version was published. Shouldn't these kind of stuff be fixed in alpha or beta release? Why even publish a broken release?

@dexster how did you work around this? It was fixed but after 4.0.0 was released.

I'm still using the old versions until they update their package

Hi, Any estimated date to publish the solution to this case?

It seems to finally be fixed in 4.0.1, 5 months later. This is incredibly poor service from AWS

Was this page helpful?
0 / 5 - 0 ratings