Skip to content

feat(sdk): use TailorErrors for resolver input validation#805

Draft
toiroakr wants to merge 4 commits intomainfrom
feat/gql-error-path
Draft

feat(sdk): use TailorErrors for resolver input validation#805
toiroakr wants to merge 4 commits intomainfrom
feat/gql-error-path

Conversation

@toiroakr
Copy link
Contributor

@toiroakr toiroakr commented Mar 23, 2026

Summary

  • Replace generic Error with PF runtime's TailorErrors in resolver input validation (both production bundler and test-run bundler)
  • Validation issues now include field-level path arrays (e.g. ["a"]), enabling the PF to expand them into individual GraphQL errors
  • Add setupTailorErrorsMock() test utility to mock the PF runtime's TailorErrors global

Replace generic Error with TailorErrors in resolver input validation
so that the PF runtime can expand validation issues into individual
GraphQL errors with field-level paths.
@changeset-bot
Copy link

changeset-bot bot commented Mar 23, 2026

🦋 Changeset detected

Latest commit: af4ee05

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tailor-platform/sdk Minor
@tailor-platform/create-sdk Minor

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 23, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@tailor-platform/create-sdk@805

commit: af4ee05

@github-actions
Copy link

Code Metrics Report (packages/sdk)

main (08b4d38) #805 (1e7ee12) +/-
Coverage 55.8% 55.8% +0.0%
Code to Test Ratio 1:0.4 1:0.4 +0.0
Details
  |                    | main (08b4d38) | #805 (1e7ee12) |  +/-  |
  |--------------------|----------------|----------------|-------|
+ | Coverage           |          55.8% |          55.8% | +0.0% |
  |   Files            |            324 |            324 |     0 |
  |   Lines            |          10320 |          10324 |    +4 |
+ |   Covered          |           5764 |           5768 |    +4 |
+ | Code to Test Ratio |          1:0.4 |          1:0.4 |  +0.0 |
  |   Code             |          61615 |          61651 |   +36 |
+ |   Test             |          24673 |          24696 |   +23 |

Code coverage of files in pull request scope (74.7% → 75.7%)

Files Coverage +/- Status
packages/sdk/src/cli/commands/function/bundle.ts 96.4% 0.0% modified
packages/sdk/src/cli/services/resolver/bundler.ts 92.3% 0.0% modified
packages/sdk/src/utils/test/mock.ts 32.1% +11.3% modified

SDK Configure Bundle Size

main (08b4d38) #805 (1e7ee12) +/-
configure-index-size 10.74KB 10.74KB 0KB
dependency-chunks-size 34KB 34KB 0KB
total-bundle-size 44.74KB 44.74KB 0KB

Runtime Performance

main (08b4d38) #805 (1e7ee12) +/-
Generate Median 2,632ms 2,584ms -48ms
Generate Max 2,653ms 2,601ms -52ms
Apply Build Median 2,648ms 2,602ms -46ms
Apply Build Max 2,674ms 2,628ms -46ms

Type Performance (instantiations)

main (08b4d38) #805 (1e7ee12) +/-
tailordb-basic 43,028 43,028 0
tailordb-optional 3,927 3,927 0
tailordb-relation 4,071 4,071 0
tailordb-validate 2,925 2,925 0
tailordb-hooks 5,790 5,790 0
tailordb-object 11,571 11,571 0
tailordb-enum 2,793 2,793 0
resolver-basic 9,239 9,239 0
resolver-nested 25,626 25,626 0
resolver-array 17,862 17,862 0
executor-schedule 4,244 4,244 0
executor-webhook 883 883 0
executor-record 4,847 4,847 0
executor-resolver 4,273 4,273 0
executor-operation-function 877 877 0
executor-operation-gql 879 879 0
executor-operation-webhook 898 898 0
executor-operation-workflow 2,290 2,290 0

Reported by octocov

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