Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for custom WebSockets subscription URL #274

Open
c-davor opened this issue Apr 30, 2020 · 1 comment
Open

Support for custom WebSockets subscription URL #274

c-davor opened this issue Apr 30, 2020 · 1 comment
Labels
feature-request Request a new feature

Comments

@c-davor
Copy link

c-davor commented Apr 30, 2020

Issue described below is related to v3.0.1

The library does not allow configuring a separate URL for the WebSocket subscriptions endpoint. Instead it determines the WebSocket endpoint based on the ApiUrl provided in the configuration in WebSocketConnectionManager.getConnectionRequestUrl:

  return new Uri.Builder()
            .scheme("wss")
            .authority(appSyncEndpoint.getHost()
                .replace("appsync-api", "appsync-realtime-api"))
            .appendPath(appSyncEndpoint.getPath())
            .appendQueryParameter("header", Base64.encodeToString(rawHeader, Base64.DEFAULT))
            .appendQueryParameter("payload", "e30=")
            .build()
            .toString();

This does not seem to be clearly documented and no proper error is reported when a custom domain name is used for ApiUrl (eg. https://our.custom.domain.com/graphql) when subscription is executed.
In our use case the AppSyncSubscriptionCall.Callback.onFailure is raised with "Expected HTTP 101 response but was '400 Bad Request'"

For us, using the "full URL" (eg. https://abcde123565defghj.appsync-api.eu-west-1.amazonaws.com/graphql) is not possible for all use cases.

The only workaround we have currently is to have separate instance of AppSync client for subscriptions, configured with the full URL and additional instances for all other GraphQL operations configured with URL with a custom domain name.

Please provide additional configuration property allowing configuration of the WebSocket endpoint for GraphQL subscriptions.

@c-davor c-davor changed the title Support for custom web sockets subscription URL Support for custom WebSockets subscription URL Apr 30, 2020
@darylsze
Copy link

darylsze commented Aug 3, 2020

same here, appsync embedded whole Apollo package into aar with customization to the apollo core, so this Apollo is already out-of-date, we are unable to enjoy any new features provided by latest apollo client (cuz you can't import two aar with same package name into gradle, unless do something like shadowJar, but it's not advised and error-prone).

@gpanshu gpanshu added the pending-triage Issue is pending triage label May 1, 2023
@tylerjroach tylerjroach added feature-request Request a new feature and removed pending-triage Issue is pending triage labels Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request a new feature
Projects
None yet
Development

No branches or pull requests

4 participants