Skip to content

Comments

fix(appsync): use convertPathToPattern for Windows path compatibility#13242

Merged
czubocha merged 1 commit intomainfrom
sc-3758
Jan 13, 2026
Merged

fix(appsync): use convertPathToPattern for Windows path compatibility#13242
czubocha merged 1 commit intomainfrom
sc-3758

Conversation

@czubocha
Copy link
Contributor

@czubocha czubocha commented Jan 12, 2026

Fixes #13240


Fix: Handle Windows path separators in AppSync schema glob patterns

Problem

On Windows, the AppSync schema resolver failed to find .graphql files when using glob patterns (e.g., Schema/*.graphql). This resulted in empty Definition in the CloudFormation template.

Root Cause

globby v10+ does not support backslash path separators. On Windows, path.join() produces paths with backslashes which caused globby to silently match zero files.

Solution

Use convertPathToPattern() from globby to convert Windows backslashes to forward slashes, and path.posix.join() to maintain forward slashes when joining paths.

Changes

  • Schema.js: Use convertPathToPattern + path.posix.join for cross-platform path handling
  • given.js: Updated test mock to use process.cwd() as servicePath
  • resolvers.test.js: Fixed mock to strip cwd prefix for portable snapshots
  • schema.test.js: Added test for absolute path handling

@czubocha czubocha requested a review from eahefnawy January 12, 2026 22:15
@Mmarzex
Copy link
Contributor

Mmarzex commented Jan 12, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@czubocha czubocha merged commit 59df5f7 into main Jan 13, 2026
10 checks passed
@czubocha czubocha deleted the sc-3758 branch January 13, 2026 12:51
@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AppSync schema definition empty in cloud formation template

3 participants