Skip to content

chore: update OFFSET pagination snippet #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 31, 2025
Merged

Conversation

asararatnakar
Copy link
Collaborator

@asararatnakar asararatnakar commented Jan 30, 2025

Adding OFFSET pagination example query field with a new test added

@asararatnakar asararatnakar changed the title chore: update OFFSET pagination exmaple chore: update OFFSET pagination snippet Jan 30, 2025
Copy link
Contributor

@ddebrunner ddebrunner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, couple of minor cleanups.

// Since this is OFFSET pagination
// "after" is decoded by StepZen from the opaque string value
// and passed into @rest as a integer offset value,
// with the first page being 1.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the offset of the first record being zero.


Typically the `endpoint` argument of `@rest` would have query
parameters that set the pagination arguments expected by the
REST API from the field arguments `first` ( ) and `after` (offset defaults to 0 if empty),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty parens?

Signed-off-by: asararatnakar <[email protected]>
@asararatnakar asararatnakar merged commit 9410ba5 into main Jan 31, 2025
1 check passed
@asararatnakar asararatnakar deleted the add_offset_test branch January 31, 2025 15:54
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.

2 participants