Title: Feat: Use only one standardized method for pagination across the API · Issue #1358 · coder/coder · GitHub
Open Graph Title: Feat: Use only one standardized method for pagination across the API · Issue #1358 · coder/coder
X Title: Feat: Use only one standardized method for pagination across the API · Issue #1358 · coder/coder
Description: What is your suggestion? We should only use one standardized method of pagination across the API, preferably we'd keep the cursor based pagination and drop support for offset. Another approach would be to return pagination metadata in th...
Open Graph Description: What is your suggestion? We should only use one standardized method of pagination across the API, preferably we'd keep the cursor based pagination and drop support for offset. Another approach woul...
X Description: What is your suggestion? We should only use one standardized method of pagination across the API, preferably we'd keep the cursor based pagination and drop support for offset. Another approach ...
Opengraph URL: https://github.com/coder/coder/issues/1358
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Feat: Use only one standardized method for pagination across the API","articleBody":"## What is your suggestion?\r\n\r\nWe should only use one standardized method of pagination across the API, preferably we'd keep the cursor based pagination and drop support for `offset`.\r\n\r\nAnother approach would be to return pagination metadata in the API responses, for instance, something like:\r\n\r\n```json\r\n{\r\n \"page\": {\r\n \"current_number\": 2,\r\n \"total_pages\": 10,\r\n \"current\": \"/api/path?limit=10&after_id=xxx\",\r\n \"next\": \"/api/path?limit=10&after_id=yyy\",\r\n \"previous\": \"/api/path?limit=10&after_id=zzz\"\r\n }\r\n}\r\n```\r\n\r\n## Why do you want this feature?\r\n\r\nThis was discussed in https://github.com/coder/coder/pull/1308 and @spikecurtis had good motivations for only keeping one (https://github.com/coder/coder/pull/1308#discussion_r866139073), according to @presleyp it may suffice to only keep cursor based pagination around (https://github.com/coder/coder/pull/1308#discussion_r866866704).\r\n\r\nHaving two methods for pagination can be confusing and hard to enforce on the API side across all endpoints. It might also add complexity if we introduce more advanced features, like sorting on column.\r\n\r\nI think it would be good if @Emyrk had a chance to give his two cents as developer of the original implementation.\r\n\r\nThe issue described in #1357 may also need to be considered here.\r\n\r\n## Are there any workarounds to get this functionality today?\r\n\r\nNo.\r\n\r\n## Are you interested in submitting a PR for this?\r\n\r\nAfter we have consensus on what approach to take? Sure.","author":{"url":"https://github.com/mafredri","@type":"Person","name":"mafredri"},"datePublished":"2022-05-10T08:14:12Z","url":"https://github.com/coder/coder/issues/1358"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:34d9023a-a473-064f-e55e-0c873c2e354d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C14:1EC9BC:2052BF4:29327CC:6B017413 |
| html-safe-nonce | a74f113f322d5a2c8f932cc8cbebb89ab35e11379745150a3e029f470101ce19 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzE0OjFFQzlCQzoyMDUyQkY0OjI5MzI3Q0M6NkIwMTc0MTMiLCJ2aXNpdG9yX2lkIjoiNDcxMTIwMjQ2MTE3MDM2NTQ1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 38b2a3f5a18388a45c149e5ba8c09b18297e48bd685c7561c0868272d1c2de91 |
| hovercard-subject-tag | issue:1230785710 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/1358/issue_layout |
| twitter:image | https://opengraph.githubassets.com/91485548b5891f173a3a1e44db268465c98ac1007aca3bf7b630a5b8cbe15e2b/coder/coder/issues/1358 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/91485548b5891f173a3a1e44db268465c98ac1007aca3bf7b630a5b8cbe15e2b/coder/coder/issues/1358 |
| og:image:alt | What is your suggestion? We should only use one standardized method of pagination across the API, preferably we'd keep the cursor based pagination and drop support for offset. Another approach woul... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mafredri |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width