Hi,
I am using the AppsyncClientService in Angular with the package aws-appsync and it worked fine for me - until I wanted to use custom domains for my AWS graphql interface - then subscriptions stopped to work (more precisely the websocket connection).
I was using following code:
public getAppsyncClient() {
if (this.awsAppSyncClient == null) {
this.awsAppSyncClient = new AWSAppSyncClient({
url: aws_exports.aws_appsync_graphqlEndpoint,
region: aws_exports.aws_project_region,
auth: {
type: AUTH_TYPE.API_KEY,
apiKey: aws_exports.aws_appsync_apiKey
},
disableOffline: true
}).hydrated();
}
return this.awsAppSyncClient;
}
In some magical way, the specified address was converted from https://xxx.appsync-api.eu-central-1.amazonaws.com/graphql to wss://xxx.appsync-realtime-api.eu-central-1.amazonaws.com/graphql in the background. This does not happen using custom domains (where the realtime url is simply the http url + "/realtime"). So, AWSAppSyncClient lost its magic.
Is there any way to tell AWSAppSyncClient to use a custom websocket url?
Thanks for any hint!!
Hi Big Red, I did not understand the problem clearly, would you be able to detail it better?
Anyway, try to see if there is any field in the configurations that might interest you (maybe disableHostPrefix?) https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-appsync/interfaces/appsyncclientconfig.html