Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bod/apollokotlinpaginationsample
Apollo Kotlin pagination sample
https://github.com/bod/apollokotlinpaginationsample
Last synced: 8 days ago
JSON representation
Apollo Kotlin pagination sample
- Host: GitHub
- URL: https://github.com/bod/apollokotlinpaginationsample
- Owner: BoD
- Created: 2024-01-24T10:14:20.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-07-22T14:37:44.000Z (4 months ago)
- Last Synced: 2024-10-12T13:09:08.702Z (about 1 month ago)
- Language: Kotlin
- Size: 274 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Apollo Kotlin pagination sample
A simple example of how to implement pagination with Apollo Kotlin and the normalized cache.
Uses the [GitHub GraphQL API](https://docs.github.com/en/graphql) to fetch a list of repositories
for a given user.### "Manual" way
In the main branch is the "manual" way of doing it, where you update the cache via the
[`ApolloStore` API](https://www.apollographql.com/docs/kotlin/caching/store).The gist of it is [here](app/src/main/java/com/example/apollokotlinpaginationsample/repository/Apollo.kt#L44).
### Incubating pagination support way
The [`incubating-pagination` branch](../../tree/incubating-pagination) shows how to use the [incubating pagination support](https://github.com/apollographql/apollo-kotlin/blob/main/design-docs/Normalized%20cache%20pagination.md#using-the-incubating-pagination-support).
You can see a the diff [here](../../compare/incubating-pagination).
### Setup
To run the app, first get a GitHub token from https://github.com/settings/tokens and update
`githubOauthKey` in `gradle.properties`.