fix(search-api-graphql): tell the caller which argument they got wrong - #737
Merged
Conversation
ddeboer
force-pushed
the
feat-iri-typed-filters
branch
2 times, most recently
from
August 14, 2026 10:20
d653032 to
af453bf
Compare
ddeboer
force-pushed
the
worktree-issue-730-graphql-user-errors
branch
from
August 14, 2026 10:41
cffe872 to
686dbaa
Compare
- throw a GraphQLError with extensions.code BAD_USER_INPUT for the paging bounds and the IRI scalar, so the transport keeps the message instead of masking it as "Unexpected error." - describe every root-field argument in the SDL, stating the perPage bound where the playground shows it
ddeboer
force-pushed
the
worktree-issue-730-graphql-user-errors
branch
from
August 14, 2026 11:43
686dbaa to
4d5b903
Compare
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.
Fix #730
Stacked on #728 (the
IRIscalar this touches lives there); base retargets tomainonce that merges.An out-of-range
perPage(orpage) was a plainErrorthrown from a resolver, which graphql-yoga masks as"Unexpected error.". The sentence saying what was wrong survived only in the API container’s log – unreadable to a presentation-layer developer building against a hosted endpoint.Changes
build-schema.ts– auserError()helper throwing aGraphQLErrorwithextensions.code = 'BAD_USER_INPUT', used for the paging bounds and theIRIscalar’s coercion failure. The message now reaches the client, and the code lets a consumer tell “fix your query” from “retry later” without matching on prose."Unexpected error."is left for faults nobody anticipated – an unreachable engine still masks as before.perPagebound (Results per page, between 0 and 100. …), so the playground’s own documentation answers where the boundary is before a request has to fail to say it. Complements feat(search-api-graphql): write the GraphQL contract of a schema module to a file #722.docs/reference/search-api-graphql.md, plus a note that both paging bounds are in the SDL.The generated SDL changes shape: arguments now carry descriptions, so
printSchemabreaks the root field over several lines. Snapshot updated; a consumer with its own contract snapshot will see the same diff.