Repository navigation
fix(hydrogen): use relative schema paths for GraphQL checks on Windows - #4361
Open
Roshan931 wants to merge 1 commit into
Conversation
Signed-off-by: Robert Markovski <5818108+Roshan931@users.noreply.github.com>
hydrogen gql check fails on Windows: absolute schema path is parsed as...This branch has not been deployed
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.
Closes #4359
On Windows, gql.tada interprets an absolute schema path such as
C:\...\storefront.schema.jsonas a URL and tries to fetch it. This preventshydrogen gql checkfrom 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
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
pnpm install --frozen-lockfileandpnpm --filter @shopify/hydrogen run build.node <checkout>/packages/hydrogen/bin/hydrogen.mjs gql checkand confirm valid documents pass without a schema fetch error.--tsconfig <relative-config-path>.This issue was fixed with Prilog. This is our way of giving back to the open source community.