`gql check` and the TS plugin still fail on Windows when schema paths are absolute
Maintainers usually reply within 3 days
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- node.js, typescript, vscode
Research direction
Start with src/ts-plugin/index.ts, the schema loading helper in @gql.tada/internal 1.0.9, and graphqlsp 1.15.4; then review #4359 and #4367. Reproduce absolute-path loading on Windows, including a project and package on different drives, and verify how backslash relative paths are handled. Done means both gql check and the editor plugin load schemas from disk on Windows, with VS Code testing and no regressions on other platforms.
Written by the indexing model from the issue text.
Description
Follow-up to #4359 and the draft fix in #4367.
Status: neither case below has been reproduced on Windows yet. Both come from reading the code in @gql.tada/internal 1.0.9 and @0no-co/graphqlsp 1.15.4, plus Node URL behavior checks that are platform independent.
Background
gql.tada's getURLConfig runs new URL(origin) first. If that parses, the schema is loaded with loadFromURL (a network fetch). Only if it throws is the string treated as a file path and read via resolve(rootPath, origin).
On Windows, new URL("C:\\x\\y.json") parses (protocol c:), so an absolute drive-letter schema path is fetched instead of read from disk, which is the [Network] fetch failed in #4359. A file: URL is not a workaround: it parses as a URL too and goes to fetch.
#4367 fixes hydrogen gql check by passing the schema directory relative to the temporary tsconfig. Two cases remain.
1. Project and Hydrogen package on different drives
path.relative cannot produce a relative path across drives, so it returns the absolute path (for example path.win32.relative('D:\\proj\\.t', 'C:\\pkg\\dist') returns C:\pkg\dist). That parses as a URL, so hydrogen gql check still fails for this layout. A unit test in #4367 documents this as a known limitation.
Possible fix: copy the two schema files (about 1.4 MB and 1.7 MB) next to the temporary tsconfig and reference them by relative name, cleaned up with the existing temporary-file cleanup.
2. Editor TypeScript plugin
src/ts-plugin/index.ts passes an absolute SCHEMA_DIRECTORY = resolve(__dirname, "..") to the same helper, loaded through graphqlsp, which applies the same URL check. It very likely fails the same way on Windows, probably only logging Failed to load schema in the editor.
Things to be careful about:
- graphqlsp computes
rootPathasynchronously fromresolveTypeScriptRootDir(project.getProjectName()), so a relative path needs the right base directory. A wrong base would break every OS. - The change should apply only when the absolute path would parse as a URL, to leave POSIX behavior untouched.
- It needs testing in VS Code on Windows.
Needed
- Reproduction of both cases on Windows (including a cross-drive setup).
- Confirmation from #4359 on whether backslash relative paths are read from disk by gql.tada, which affects the approach for both.
- Dominant language
- TypeScript
- Stars
- 2.2k
- Forks
- 466
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 59
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Shopify/hydrogen
-
ShopifyPrivacyBanner.showBanner()/showPreferences() types declare zero args, but headless stores require storefrontAccessToken (and domains) at runtimePossibly taken @minwookshin claimed this 53 days ago. Openinactive
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Shopify/hydrogen#4069 · 1 comment ·
Maintainers usually reply within 3 days
-
Remix 3: running Hydrogen 2026-10's core without a bindingPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 5/5 Over a week Newbie friendliness 12/100
Maintainers usually reply within 3 days
-
`runWithCache` starts a background refresh for every stale hit, where 2025.7 started one per keyPossibly taken @debojyoti10CC claimed this 6 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Maintainers usually reply within 3 days
-
`shopify:page:view` fires when `history.replaceState` changes only the query, as a variant selection doesPossibly taken @Peerapatfc claimed this 6 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 53/100
Maintainers usually reply within 3 days
-
`hydrogen gql check` fails on Windows: absolute schema path is parsed as a URL by gql.tadaPossibly taken @Roshan931 claimed this 12 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
Shopify/hydrogen#4359 · 1 comment ·
Maintainers usually reply within 3 days
All issues in Shopify/hydrogen
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 66/100
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
prometheus/docs#3198 ·
Maintainers usually reply within 3 days
-
[Bug]: OpenCode v2 skips an assistant message that gains text after an earlier capturePossibly taken @jianyx1 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
volcengine/OpenViking#8354 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ARTPARK-SAHAI-ORG/calibrate-frontend#842 ·
Maintainers usually reply within 1 day
-
Chat: Copying a selection that includes the end of a message also copies the actions menu labelsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
suitenumerique/hub#176 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day