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회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠