Skip to content

[typescript-resolver-files] Add e2e coverage for unresolvable mapper types - #497

Merged
eddeee888 merged 2 commits into
masterfrom
e2e-test
Sep 22, 2026
Merged

eddeee888 merged 2 commits into
masterfrom
e2e-test

Conversation

@eddeee888

@eddeee888 eddeee888 commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Why

This PR locks in the #455 fix behaviourally: it adds two adjacent schema types to the test-mappers-vs-schema-types-advanced e2e suite — one whose mapper points at an unresolvable import, one whose mapper is genuinely {} — so the committed generated output itself proves the two cases are now treated differently.

  • Unit tests alone can't catch the original bug: it only surfaces once ts-morph resolves a real mapper file against a real tsconfig, which is exactly what the e2e suite does.
  • #446 reported hand-written resolver files being overwritten with Promise<void> stubs whenever a mapper's import wasn't generated yet (e.g. a Prisma client on a fresh checkout).

What

  • schema.graphqls: adds MappedResolveError and MappedResolveEmptyObject, each with id: ID! and field: String!.
  • schema.mappers.ts: MappedResolveErrorMapper is re-exported from 'does-not-exist' (unresolvable → TS error type); MappedResolveEmptyObjectMapper = {} (genuinely empty).
  • The committed generated output is the assertion: MappedResolveError.ts carries no field stubs, while MappedResolveEmptyObject.ts still stubs both id and field — the exact distinction #455 introduced.
  • .changeset/tricky-mappers-warn.md: patch → minor, since skipping stub generation changes generation behaviour for existing configs.

Verification

  • The e2e run regenerates every file in this diff and fails on any drift — typescript-resolver-files-e2e is marked affected for this PR in .github/workflows/ci.yml, so the two new generated resolver files are checked in CI rather than merely committed.
  • No changeset is needed for the e2e package itself — typescript-resolver-files-e2e sits in the changesets ignore list, and the changeset bot confirms a single minor bump for @eddeee888/gcg-typescript-resolver-files.

Resources

@changeset-bot

changeset-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1ad6386

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 1 package
Name Type
@eddeee888/gcg-typescript-resolver-files Minor

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@eddeee888 eddeee888 changed the title [typescript-resolver-filess] [typescript-resolver-files] Add e2e coverage for unresolvable mapper types Sep 22, 2026
@eddeee888
eddeee888 marked this pull request as ready for review September 22, 2026 13:57
@eddeee888
eddeee888 merged commit 2e6715d into master Sep 22, 2026
10 checks passed
@eddeee888
eddeee888 deleted the e2e-test branch September 22, 2026 13:57
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.

1 participant