Skip to content

Resolve 404#179

Merged
barneyb merged 3 commits intomasterfrom
resolve-404
Feb 15, 2026
Merged

Resolve 404#179
barneyb merged 3 commits intomasterfrom
resolve-404

Conversation

@barneyb
Copy link
Member

@barneyb barneyb commented Feb 15, 2026

By default, Spring GraphQL just gives INTERNAL_ERROR with a UUID, but
an entity-not-found that reaches the top level is almost certainly due
to a bad request param. E.g., unknown recipe id. So let that "leak" back
out, so the client knows it's their fault.

Also fix a couple similar issues with anonymous requests yielding INTERNAL_ERROR instead of UNAUTHORIZED, from @currentuser setting errorOnInvalidType=true

By default, Spring GraphQL just gives INTERNAL_ERROR with a UUID, but
an entity-not-found that reaches the top level is almost certainly due
to a bad request param. E.g., unknown recipe id. So let that "leak" back
out, so the client knows it's their fault.
Spring's @PreAuthorize happen after binding parameters, so with
errorOnInvalidType=true on @AuthenticationPrincipal, an anonymous user
who fails the pre-auth test gets a class cast exception, instead of
unauthorized.
@barneyb barneyb self-assigned this Feb 15, 2026
@barneyb barneyb merged commit 6a3050f into master Feb 15, 2026
1 check passed
@barneyb barneyb deleted the resolve-404 branch February 15, 2026 22:11
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