Skip to content

fix: fetch schema at build time - #99

Merged
yokelpole merged 6 commits into
mainfrom
fix/update-committed-schema
Nov 10, 2026
Merged

yokelpole merged 6 commits into
mainfrom
fix/update-committed-schema

Conversation

@yokelpole

@yokelpole yokelpole commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Fetch the latest schema at the start of each build and stop committing src/resources/schema.graphql. Operation generation derives introspection from that fetched SDL, so generation, codegen validation, and the schema shipped in the npm package all use the same snapshot. Failed schema downloads stop the build.

The version-bump workflow compares the fetched schema against the schema in the latest published npm package, preserving schema diff release notes and automatic minor/patch selection without schema commits.

The branch includes the latest main and bumps the package to 2.6.4 for release after merging. Both pnpm publish scripts use --no-git-checks so generated build changes do not block publishing.

The release workflow also accepts a dry_run boolean input. It uses a temporary unpublished prerelease version inside the runner, runs npm publish --dry-run with build hooks enabled, and skips the real publication step. Run it with gh workflow run release.yml --ref fix/update-committed-schema -f dry_run=true before merging, or select the dry-run input in Actions after merging.

Validation:

  • Full CI publishing dry run passes with the real API-key-dependent prebuild and prepublishOnly hook enabled: network-config fetches, schema download, all 112 operations, GraphQL codegen, lint, CJS/ESM/edge builds, and publish-time rebuild.
  • All 96 SDK tests pass (pnpm exec jest --runInBand --coverage=false --modulePathIgnorePatterns dist .worktrees; the override excludes an existing nested worktree).
  • The CI dry run assembles a 39-file, 1.1 MB npm package containing the schema and public entrypoints. The real publish step is skipped. Verified that the temporary prerelease is absent from npm and the latest tag remains 2.6.3.
  • Both pnpm publish scripts also pass with --dry-run --ignore-scripts against a local test registry while generated files are modified.
  • Verified npm package schema extraction and schema:diff, including GitHub Actions version-bump outputs.

@yokelpole yokelpole changed the title fix: refresh committed schema for release build fix: fetch schema at build time Nov 9, 2026
@yokelpole
yokelpole marked this pull request as ready for review November 9, 2026 23:17
Keep the schema untracked and retain main's 2.6.3 version. Allow pnpm publish scripts to run with generated build changes.
@yokelpole
yokelpole merged commit b4bc897 into main Nov 10, 2026
1 check passed
@yokelpole
yokelpole deleted the fix/update-committed-schema branch November 10, 2026 16:21
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.

2 participants