Skip to content

fix(hydrogen): use relative schema paths for GraphQL checks on Windows - #4361

Open
Roshan931 wants to merge 1 commit into
Shopify:mainfrom
Roshan931:prilog/fix-error-absolute-schema-paths-in-the-generated-11-11-2026-d8f7f1
Open

Roshan931 wants to merge 1 commit into
Shopify:mainfrom
Roshan931:prilog/fix-error-absolute-schema-paths-in-the-generated-11-11-2026-d8f7f1

Conversation

@Roshan931

@Roshan931 Roshan931 commented Nov 11, 2026 •

Copy link
Copy Markdown

Closes #4359

On Windows, gql.tada interprets an absolute schema path such as C:\...\storefront.schema.json as a URL and tries to fetch it. This prevents hydrogen gql check from validating documents against the bundled schemas.

Before

The temporary tsconfig contains absolute schema paths, which gql.tada can mistake for remote URLs.

After

Schema paths are relative to the temporary tsconfig, use forward slashes, and resolve to the same bundled files. Custom tsconfig locations retain their correct base directory.

What this changes

  • Calculate the schema directory relative to the selected tsconfig.
  • Join schema filenames with POSIX separators.
  • Add a regression that checks filesystem resolution and rejects URL interpretation.

Automated validation: CLI unit tests (4), CLI integration tests (2), and CLI dispatch tests (4) passed on Linux. The path regression fails against the original implementation and passes with this change. Windows manual testing has not been run.

Developer impact

Includes a patch changeset for @shopify/hydrogen. No public API changes.

Risk

Windows paths on different drives cannot be made relative with node:path; this addresses the reported same-drive setup.

How to Test

  1. On Windows, build this checkout with pnpm install --frozen-lockfile and pnpm --filter @shopify/hydrogen run build.
  2. From a Hydrogen project on the same drive, run node <checkout>/packages/hydrogen/bin/hydrogen.mjs gql check and confirm valid documents pass without a schema fetch error.
  3. Add an invalid Storefront API field and confirm the command reports it.
  4. Repeat with a tsconfig in a subdirectory using --tsconfig <relative-config-path>.

This issue was fixed with Prilog. This is our way of giving back to the open source community.

Signed-off-by: Robert Markovski <5818108+Roshan931@users.noreply.github.com>
@Roshan931
Roshan931 requested a review from a team as a code owner November 11, 2026 16:50
@Roshan931 Roshan931 changed the title fix: hydrogen gql check fails on Windows: absolute schema path is parsed as... fix(hydrogen): use relative schema paths for GraphQL checks on Windows Nov 11, 2026

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hydrogen gql check fails on Windows: absolute schema path is parsed as a URL by gql.tada

1 participant