ToGraphQLParams converts REST API pagination parameters to GraphQL-specific parameters. This converts page/perPage to first parameter for GraphQL queries. If After is provided, it takes precedence over page-based pagination.
()
| 481 | // This converts page/perPage to first parameter for GraphQL queries. |
| 482 | // If After is provided, it takes precedence over page-based pagination. |
| 483 | func (p PaginationParams) ToGraphQLParams() (*GraphQLPaginationParams, error) { |
| 484 | // Convert to CursorPaginationParams and delegate to avoid duplication |
| 485 | cursor := CursorPaginationParams{ |
| 486 | PerPage: p.PerPage, |
| 487 | After: p.After, |
| 488 | } |
| 489 | return cursor.ToGraphQLParams() |
| 490 | } |
no test coverage detected