Skip to content

subscription request is using /graphql/realtime instead of /graphql #6877

@marcuscheung-carbonlinking

Description

Description

using amplify_api: 2.10.0
when we set the amplifyconfiguration.dart api.awsAPIPlugin..endpoint to https://custom-domain/graphql, we can't establish ws connection.

Error during WebSocket handshake: Unexpected response code: 403
ERROR | WebSocketBloc - ... | Shutting down with exception: NetworkException {
"message": "Exception from WebSocketService.",
"underlyingException": "WebSocketChannelException: WebSocketException: Failed to connect WebSocket"
}

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

  1. change lib/amplifyconfiguration.dart api block.
    "api": {
        "plugins": {
            "awsAPIPlugin": {
                "<appsync name>": {
                    "endpointType": "GraphQL",
                    "endpoint": "https://<custom-doamin>/graphql",
                    "region": <region id>,
                    "authorizationType": "AMAZON_COGNITO_USER_POOLS"
                }
            }
        }
    }
  1. start subscription
      const document = r'''
        subscription OnCreateTodo($owner: String!) {
          onCreateTodo(owner: $owner) {
            id owner title done createdAt updatedAt
          }
        }
      ''';
 final operation = Amplify.API.subscribe(
        request,
        onEstablished: () {
          developer.log('Subscription established', name: 'TodoListScreenController');
          state = state.copyWith(subscription_active: true);
        },
      );

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.38.10

Amplify Flutter Version

2.10.0

Deployment Method

Amplify Gen 2

Schema

Metadata

Metadata

Assignees

Labels

GraphQL APIIssues related to the API (GraphQL) CategoryWebIssues specific to the Web PlatformbugSomething is not working; the issue has reproducible steps and has been reproduced

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions