Custom domain with aws-appsync's AppsyncClientService

0

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!!

Big Red
質問済み 2年前64ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ