Skip to content

Commit

Permalink
Merge pull request #60 from damontecres/fix/issue-58
Browse files Browse the repository at this point in the history
Support proxy by URL prefix
  • Loading branch information
damontecres authored Jan 23, 2024
2 parents 631b35d + bed2832 commit 890d9ec
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ fun createApolloClient(
cleanedStashUrl = "http://$cleanedStashUrl"
}
var url = Uri.parse(cleanedStashUrl)
val pathSegments = url.pathSegments.toMutableList()
if (pathSegments.isEmpty() || pathSegments.last() != "graphql") {
pathSegments.add("graphql")
}
url =
url.buildUpon()
.path("/graphql") // Ensure the URL is the graphql endpoint
.path(pathSegments.joinToString("/")) // Ensure the URL is the graphql endpoint
.build()
Log.d(Constants.TAG, "StashUrl: $stashUrl => $url")
ApolloClient.Builder()
Expand Down

0 comments on commit 890d9ec

Please sign in to comment.