Skip to content

fix(graphql-request): resolve relative endpoint URLs against current origin#1495

Open
SAY-5 wants to merge 1 commit into
graffle-js:graphql-requestfrom
SAY-5:say5-fix-relative-endpoint-url
Open

fix(graphql-request): resolve relative endpoint URLs against current origin#1495
SAY-5 wants to merge 1 commit into
graffle-js:graphql-requestfrom
SAY-5:say5-fix-relative-endpoint-url

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 12, 2026

graphql-request 7.4.0 parses the endpoint with new URL(params.url) in runRequest, which throws for relative endpoints like /graphql that worked previously in browser contexts. This resolves the endpoint (and any middleware-returned URL) against globalThis.location when available so relative paths keep working, while leaving non-browser behavior unchanged. Closes #1493.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant