fix!: match the backend's standardized single-level pagination shape#50
Merged
Merged
Conversation
BREAKING CHANGE: the Authorizer backend removed the PaginatedRequest
wrapper type entirely (authorizerdev/authorizer, fix(graphql)! commit
standardizing pagination on PaginationRequest directly, matching the
proto/gRPC surface which never had a double-wrapper). This SDK's
verificationRequests/webhooks/emailTemplates methods hardcoded
PaginatedRequest in both their query strings and Types.PaginatedRequest
parameter type - both now updated to PaginationRequest directly.
Callers previously wrote e.g. `.webhooks({ pagination: { limit: 10 } })`;
now write `.webhooks({ limit: 10 })` directly.
The 6 List*Request types (Clients/TrustedIssuers/SAMLServiceProviders/
Organizations/OrgDomains/OrgMembers) needed no change here: their
`pagination` field was already typed as PaginationRequest in this SDK,
even though the old backend schema actually required the PaginatedRequest
wrapper for those - meaning no strictly-typed caller of this SDK could
have constructed the shape the old schema demanded for those 6 endpoints
in the first place. This backend fix makes those types correct rather
than accidentally correct.
Verified against a locally built authorizer image running the backend
fix: all 26 admin.test.ts integration tests pass (graphql + rest), full
build and typecheck clean.
5 tasks
Picks up the backend's pagination schema fix this PR targets.
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.
Summary
PaginatedRequestwrapper type entirely (see the correspondingauthorizerdev/authorizerPR — afix(graphql)!breaking-change commit standardizing GraphQL pagination onPaginationRequestdirectly, matching the proto/gRPC surface, which never had a double-wrapper)verificationRequests/webhooks/emailTemplatesmethods hardcodedPaginatedRequestin both their GraphQL query strings and theirTypes.PaginatedRequestparameter type — both updated toPaginationRequestdirectly.webhooks({ pagination: { limit: 10 } })becomes.webhooks({ limit: 10 })(same foremailTemplates/verificationRequests)List*Requesttypes (Clients/TrustedIssuers/SAMLServiceProviders/Organizations/OrgDomains/OrgMembers) needed no change here: theirpaginationfield was already typed asPaginationRequestin this SDK, even though the old backend schema actually required thePaginatedRequestwrapper for those — meaning no strictly-typed caller of this SDK could have constructed the shape the old schema demanded for those 6 endpoints in the first place. The backend fix makes those types correct rather than accidentally correct.Test plan
npx tsc --noEmitcleanpnpm buildcleanauthorizerimage running the backend fix (not yet released): all 26admin.test.tsintegration tests pass (graphql + rest transports), including the 2 test call sites updated to the new flat pagination shapequay.io/authorizer/authorizer:latestimage (predates the backend fix) that the old server correctly rejects the new shape withVariable "$params" of type "PaginationRequest" used in position expecting type "PaginatedRequest"— expected, and confirms this SDK change is correctly coordinated with (not accidentally divergent from) the backend fixPlease coordinate merging/releasing this alongside the backend fix — until the backend PR ships, this SDK version would send a shape the currently-deployed backend rejects.