René's URL Explorer Experiment


Title: Support pagination by thomasjm · Pull Request #503 · haskell-github/github · GitHub

Open Graph Title: Support pagination by thomasjm · Pull Request #503 · haskell-github/github

X Title: Support pagination by thomasjm · Pull Request #503 · haskell-github/github

Description: This PR is an attempt to support GitHub's pagination API. At present, this package allows you to construct a request with FetchCount, which has constructors FetchAtLeast Word and FetchAll. Both of these cause the library to repeatedly call the GitHub endpoint as many times as necessary to collect the desired number of items. This obscures the actual pagination API from the user. What if I want to fetch a specific page? And what if I want to access the Link header information returned by the GitHub API, to determine the total number of pages, next/last page links, etc.? This PR adds a new constructor to FetchCount called FetchPage PageParams. PageParams allows you to specify the page and/or perPage as integers, and you will get exactly the items you're asking for. This PR also exposes a function parsePageLinks, which you can use to extract the page links from an HTTP response. You can use it like this: mgr <- newManager tlsManagerSettings ret <- executeRequestWithMgrAndRes mgr auth $ issuesForRepoR owner repo mempty (GitHub.FetchPage (GitHub.PageParams (Just 2) (Just 1))) case ret of Left e -> expectationFailure . show $ e Right res -> do let issues = responseBody res let pageLinks = GitHub.parsePageLinks res putStrLn ("pageLinks: " ++ show pageLinks) I'd like to expose this in a nicer way at the higher levels of the API, like the github function. Maybe by providing a githubPaged version that returns the response value and also a PageLinks object. But this is serviceable enough for now. More API design suggestions are welcome!

Open Graph Description: This PR is an attempt to support GitHub's pagination API. At present, this package allows you to construct a request with FetchCount, which has constructors FetchAtLeast Word and FetchAll. Both...

X Description: This PR is an attempt to support GitHub&#39;s pagination API. At present, this package allows you to construct a request with FetchCount, which has constructors FetchAtLeast Word and FetchAll. ...

Opengraph URL: https://github.com/haskell-github/github/pull/503

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:0eb9b444-df24-2bd3-f7a2-bb5e5fe33811
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC4FE:AB4C6:71686BE:9A7604B:69787115
html-safe-nonce7b54360299dcbde91dd2de7ae6a8c95294104da18b0769cf0178e2ce377a8323
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNEZFOkFCNEM2OjcxNjg2QkU6OUE3NjA0Qjo2OTc4NzExNSIsInZpc2l0b3JfaWQiOiI5MTEzNDM4MDgwMjMxMzAzODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacfd7dda0179627c3736306cb8774b603b72bccb7d8d2195d2ca102db55859adac
hovercard-subject-tagpull_request:1746798242
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/haskell-github/github/pull/503/files
twitter:imagehttps://avatars.githubusercontent.com/u/1634990?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1634990?s=400&v=4
og:image:altThis PR is an attempt to support GitHub's pagination API. At present, this package allows you to construct a request with FetchCount, which has constructors FetchAtLeast Word and FetchAll. Both...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None2981c597c945c1d90ac6fa355ce7929b2f413dfe7872ca5c435ee53a24a1de50
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/haskell-github/github git https://github.com/haskell-github/github.git
octolytics-dimension-user_id101745265
octolytics-dimension-user_loginhaskell-github
octolytics-dimension-repository_id2677437
octolytics-dimension-repository_nwohaskell-github/github
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id2677437
octolytics-dimension-repository_network_root_nwohaskell-github/github
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release520b65a872113b919c1bbdb03834a50af15859fd
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhaskell-github%2Fgithub%2Fpull%2F503%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhaskell-github%2Fgithub%2Fpull%2F503%2Ffiles
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=haskell-github%2Fgithub
Reloadhttps://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files
Reloadhttps://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files
Reloadhttps://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files
haskell-github https://patch-diff.githubusercontent.com/haskell-github
githubhttps://patch-diff.githubusercontent.com/haskell-github/github
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fhaskell-github%2Fgithub
Fork 194 https://patch-diff.githubusercontent.com/login?return_to=%2Fhaskell-github%2Fgithub
Star 437 https://patch-diff.githubusercontent.com/login?return_to=%2Fhaskell-github%2Fgithub
Code https://patch-diff.githubusercontent.com/haskell-github/github
Issues 37 https://patch-diff.githubusercontent.com/haskell-github/github/issues
Pull requests 7 https://patch-diff.githubusercontent.com/haskell-github/github/pulls
Actions https://patch-diff.githubusercontent.com/haskell-github/github/actions
Projects 0 https://patch-diff.githubusercontent.com/haskell-github/github/projects
Wiki https://patch-diff.githubusercontent.com/haskell-github/github/wiki
Security 0 https://patch-diff.githubusercontent.com/haskell-github/github/security
Insights https://patch-diff.githubusercontent.com/haskell-github/github/pulse
Code https://patch-diff.githubusercontent.com/haskell-github/github
Issues https://patch-diff.githubusercontent.com/haskell-github/github/issues
Pull requests https://patch-diff.githubusercontent.com/haskell-github/github/pulls
Actions https://patch-diff.githubusercontent.com/haskell-github/github/actions
Projects https://patch-diff.githubusercontent.com/haskell-github/github/projects
Wiki https://patch-diff.githubusercontent.com/haskell-github/github/wiki
Security https://patch-diff.githubusercontent.com/haskell-github/github/security
Insights https://patch-diff.githubusercontent.com/haskell-github/github/pulse
Sign up for GitHub https://patch-diff.githubusercontent.com/signup?return_to=%2Fhaskell-github%2Fgithub%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2Fhaskell-github%2Fgithub%2Fissues%2Fnew%2Fchoose
andreasabelhttps://patch-diff.githubusercontent.com/andreasabel
haskell-github:masterhttps://patch-diff.githubusercontent.com/haskell-github/github/tree/master
codedownio:per-page-query-v2https://patch-diff.githubusercontent.com/codedownio/github/tree/per-page-query-v2
Conversation 1 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503
Commits 11 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/commits
Checks 1 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/checks
Files changed https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files
Please reload this pagehttps://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files
Support pagination https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#top
Show all changes 11 commits https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files
c03f559 Working on PerPageQuery thomasjm Feb 24, 2024 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/commits/c03f5596183e33d12f2164b52f6f8e4efc3ead56
d17426f Add issuesForRepoPagedR + failing test thomasjm Feb 26, 2024 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/commits/d17426fae41b9c04a38dd2e07972bdb7304f697d
80b79cf Testing, todo REVERT thomasjm Feb 26, 2024 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/commits/80b79cf0aba34035be2e351a4ac659c880c41e8c
cb03a51 About to try integrating paging into the normal executeRequest calls thomasjm Feb 28, 2024 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/commits/cb03a51c3b9c66991e511c906285c5ffe8428cff
b6f3b3f API is looking better, call this v2 thomasjm Feb 28, 2024 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/commits/b6f3b3f8c0a46e718bd4b0cd4920b6c66682c20b
c51f3b7 Clean up some debugging stuff thomasjm Feb 28, 2024 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/commits/c51f3b7440f2be9429f17e563e263c1d41e9f784
7af0eb5 More cleanup thomasjm Feb 28, 2024 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/commits/7af0eb51199c980fb77a838845f4a731fdec2718
87c3e33 More cleanup thomasjm Feb 28, 2024 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/commits/87c3e33fd76252c13ab4501c7f7e13dba94b9188
d93ae32 Another slight refactor thomasjm Feb 28, 2024 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/commits/d93ae32eef1525396d119821c3c4f0b9053b9cdb
5c3da95 Another cleanup thomasjm Feb 28, 2024 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/commits/5c3da95413aec8b0e827b7a7b7b6efe447620b91
cd32569 Improve test thomasjm Feb 28, 2024 https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/commits/cd32569e3b4572158ce240096a79633607b08e0a
Clear filters https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files
Please reload this pagehttps://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files
Please reload this pagehttps://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files
github.cabal https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-bc207a57b14db1b5eeba4e14620b0a339b0dc0f79fcc46f845247af0c87728a4
IssuesSpec.hs https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-166fba24b4e92feb9d9ee1b9bd0b73b6678596874ce1255c7b622f42397f94cd
Request.hs https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-6c2e54ee97bb6d5dd1f56be03b898a3f7f37643f6a26a52d348668837c5972ca
Request.hs https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
github.cabalhttps://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-bc207a57b14db1b5eeba4e14620b0a339b0dc0f79fcc46f845247af0c87728a4
View file https://patch-diff.githubusercontent.com/codedownio/github/blob/cd32569e3b4572158ce240096a79633607b08e0a/github.cabal
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-bc207a57b14db1b5eeba4e14620b0a339b0dc0f79fcc46f845247af0c87728a4
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-bc207a57b14db1b5eeba4e14620b0a339b0dc0f79fcc46f845247af0c87728a4
spec/GitHub/IssuesSpec.hshttps://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-166fba24b4e92feb9d9ee1b9bd0b73b6678596874ce1255c7b622f42397f94cd
View file https://patch-diff.githubusercontent.com/codedownio/github/blob/cd32569e3b4572158ce240096a79633607b08e0a/spec/GitHub/IssuesSpec.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-166fba24b4e92feb9d9ee1b9bd0b73b6678596874ce1255c7b622f42397f94cd
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-166fba24b4e92feb9d9ee1b9bd0b73b6678596874ce1255c7b622f42397f94cd
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-166fba24b4e92feb9d9ee1b9bd0b73b6678596874ce1255c7b622f42397f94cd
src/GitHub/Data/Request.hshttps://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-6c2e54ee97bb6d5dd1f56be03b898a3f7f37643f6a26a52d348668837c5972ca
View file https://patch-diff.githubusercontent.com/codedownio/github/blob/cd32569e3b4572158ce240096a79633607b08e0a/src/GitHub/Data/Request.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-6c2e54ee97bb6d5dd1f56be03b898a3f7f37643f6a26a52d348668837c5972ca
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-6c2e54ee97bb6d5dd1f56be03b898a3f7f37643f6a26a52d348668837c5972ca
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-6c2e54ee97bb6d5dd1f56be03b898a3f7f37643f6a26a52d348668837c5972ca
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-6c2e54ee97bb6d5dd1f56be03b898a3f7f37643f6a26a52d348668837c5972ca
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-6c2e54ee97bb6d5dd1f56be03b898a3f7f37643f6a26a52d348668837c5972ca
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-6c2e54ee97bb6d5dd1f56be03b898a3f7f37643f6a26a52d348668837c5972ca
src/GitHub/Request.hshttps://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
View file https://patch-diff.githubusercontent.com/codedownio/github/blob/cd32569e3b4572158ce240096a79633607b08e0a/src/GitHub/Request.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://patch-diff.githubusercontent.com/haskell-github/github/pull/503/files#diff-31808faf5dac15907e21ff282cdd342a3673653d139d1b51a28505df398ec8a6
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.