Skip to content

Commit

Permalink
More docs and renamed annotation
Browse files Browse the repository at this point in the history
Co-Authored-By: Jack Boswell <[email protected]>
  • Loading branch information
imashnake0 and boswelja committed Jan 15, 2024
1 parent 577740d commit b19f774
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object AnilistApiModule {

@Provides
@Singleton
@Authorized
@AuthorizedClient
fun provideAuthorizedApolloClient(
@ApplicationContext context: Context,
httpInterceptor: HttpInterceptor
Expand Down Expand Up @@ -81,4 +81,4 @@ object AnilistApiModule {

@Qualifier
@Retention(AnnotationRetention.BINARY)
annotation class Authorized
annotation class AuthorizedClient
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ import com.imashnake.animite.api.anilist.type.MediaType
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject

/**
* Repository for fetching [MediaQuery.Media] or a list of [MediaListQuery.Medium].
*
* @param apolloClient Default apollo client.
* @property fetchMediaList Fetches a list of [MediaListQuery.Medium].
* @property fetchMedia Fetches detailed media: [MediaQuery.Media].
*/
class AnilistMediaRepository @Inject constructor(
private val apolloClient: ApolloClient
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import com.imashnake.animite.api.anilist.type.MediaType
import kotlinx.coroutines.flow.Flow
import javax.inject.Inject

/**
* Repository for fetching media search results (e.g., search bar).
*
* @param apolloClient Default apollo client.
* @property fetchSearch Fetch a list of `search`es.
*/
class AnilistSearchRepository @Inject constructor(
private val apolloClient: ApolloClient
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import javax.inject.Inject
* @property fetchViewer Fetches the current user with an authorized [apolloClient].
*/
class AnilistUserRepository @Inject constructor(
@Authorized private val apolloClient: ApolloClient
@AuthorizedClient private val apolloClient: ApolloClient
) {
fun fetchViewer(): Flow<Result<ViewerQuery.Viewer>> {
return apolloClient
Expand Down

0 comments on commit b19f774

Please sign in to comment.