I have an angular client ( Version 17+) that connects to AWSAppSync using AWSAppSyncClient library.
client!: AWSAppSyncClient<any>;
this.client = new AWSAppSyncClient({
url: 'https://<AppSync EndPoint domain>/graphql',
region: '<Region>',
auth: {
type: 'OPENID_CONNECT',
jwtToken: async () => await this.AuthProvider.accessToken()
},
disableOffline: true,
});
And the subscription as follows
this.client.hydrated().then((client: any) => {
client.subscribe({ query:<GQLQUERY> }).subscribe({
next: (data: any) => {
console.log('data', data);
},
error: (error: any) => {
console.error('error', error);
},
});
});
where as network error is shown in the dev tools WS messages. However The error handler of the subscription doesn’t get triggered for a while.
Any inputs/Guidance in this regard would greatly help.
Package details as follows
"@angular/common": "^17.1.3",
"@angular/compiler": "^17.1.3",
"@angular/core": "^17.1.3",
"@angular/platform-browser": "^17.1.3",
"@angular/platform-browser-dynamic": "^17.1.3",
"@angular/router": "^17.1.3",
"apollo-client": "^2.6.10",
"aws-appsync": "^4.1.10",
"graphql": "^14.7.0",
"graphql-tag": "^2.12.6",
"rxjs": "~7.8.1",