Conversation
Without this patch, GraphiQL endpoints were configured with absolute URLs constructed from ExternalBaseURL. This caused GraphiQL to fail when the service was accessed through a different domain (e.g., via proxy, load balancer, or alternate hostname) because it would always try to connect to the configured base URL rather than the domain the user was actually using. This is a problem because it prevents GraphiQL from working in multi-domain deployments and makes local development harder when accessing the service through different hostnames. This patch solves the problem by changing GraphiQLConfig to accept relative paths (EndpointPath and SubscriptionPath) instead of absolute URLs. The GraphiQL HTML template now uses JavaScript to dynamically construct the full URLs from window.location at runtime, ensuring the page always connects to the correct domain. The WebSocket protocol is also derived dynamically (ws: for http:, wss: for https:). Changes: - Replace Endpoint/SubscriptionEndpoint with EndpointPath/SubscriptionPath - Use window.location.origin to build full GraphQL URL at runtime - Derive WebSocket protocol from page protocol dynamically - Update tests to verify path-based configuration Co-authored-by: Claude Code <claude-code@noreply.anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🚅 Environment hyperindex-pr-31 in hypercerts has no services deployed. 4 services not affected by this PR
|
HYPER-74 hyperindex has just broken again
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EXTERNAL_BASE_URL, which defaulted tohttp://0.0.0.0:8080when unset — causing "Failed to fetch" errors in the browserlocation.originin JavaScript so the URL is derived from the browser's address bar at runtimelocation.protocolandlocation.hostThis makes GraphiQL work correctly regardless of which domain it's accessed through (e.g.
hi.test.certified.appvia Vercel proxy orhyperindex.test.certified.appdirectly on Railway).Also set
EXTERNAL_BASE_URL=https://hyperindex.test.certified.appon Railway for OAuth and other features that still need a canonical URL.