Skip to content
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

Cursor/limit functionality not available through the SDK? #613

Open
acomito opened this issue Dec 24, 2024 · 1 comment
Open

Cursor/limit functionality not available through the SDK? #613

acomito opened this issue Dec 24, 2024 · 1 comment
Labels

Comments

@acomito
Copy link

acomito commented Dec 24, 2024

The docs reference a "limit" field that doesn't seem to exist in queryParams anymore.

This reference the new cursor ability but I don't think the SDK has a field for it either

https://developer.nylas.com/docs/v2/upgrade-to-v3/features-and-changes/

@acomito acomito added the bug label Dec 24, 2024
Copy link

Hi! I've investigated this issue and found that this appears to be a documentation/naming mismatch rather than missing functionality:

  1. The limit field IS actually available in queryParams (see src/models/listQueryParams.ts)
  2. The cursor functionality IS implemented but under a different name:
    • V3 API docs refer to it as cursor
    • SDK implements it as pageToken

The functionality works exactly as described in the V3 upgrade documentation, just with a slightly different parameter name in the SDK. Here's how to use it:

When making paginated requests:

  1. First request: Use limit without pageToken
  2. Subsequent requests: Use the nextCursor value from the previous response as the pageToken parameter

The functionality is fully implemented and working, it's just that the parameter name in the SDK (pageToken) differs from what's mentioned in the V3 upgrade docs (cursor).

You can find the implementation in:

  • src/models/listQueryParams.ts (interface definition)
  • src/resources/resource.ts (pagination implementation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant