{"id":20592104,"url":"https://github.com/bennyhuo/retroapollo-android","last_synced_at":"2026-03-14T09:04:33.700Z","repository":{"id":78951919,"uuid":"99171410","full_name":"bennyhuo/RetroApollo-Android","owner":"bennyhuo","description":"Apollo-Android wrapper like Retrofit for GraphQL.","archived":false,"fork":false,"pushed_at":"2018-04-30T23:11:24.000Z","size":203,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T22:53:58.343Z","etag":null,"topics":["apollo-android","graphql","retroapollo-android"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bennyhuo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-08-03T00:00:05.000Z","updated_at":"2019-12-07T06:15:33.000Z","dependencies_parsed_at":"2023-04-20T01:31:14.695Z","dependency_job_id":null,"html_url":"https://github.com/bennyhuo/RetroApollo-Android","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bennyhuo/RetroApollo-Android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennyhuo%2FRetroApollo-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennyhuo%2FRetroApollo-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennyhuo%2FRetroApollo-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennyhuo%2FRetroApollo-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bennyhuo","download_url":"https://codeload.github.com/bennyhuo/RetroApollo-Android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennyhuo%2FRetroApollo-Android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005549,"owners_count":26083918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apollo-android","graphql","retroapollo-android"],"created_at":"2024-11-16T07:42:46.065Z","updated_at":"2025-10-10T23:08:30.099Z","avatar_url":"https://github.com/bennyhuo.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RetroApollo-Android\n[Apollo-Android](https://github.com/apollographql/apollo-android) wrapper like Retrofit for easy use.\n\nTested on Apollo-Android 0.4.2. It has been deployed to jCenter: \n\n```groovy\napi \"com.bennyhuo.retroapollo:retroapollo:0.4.2-beta\"\n```\n\n## Example\n\nThis is based on [Apollo-Android](https://github.com/apollographql/apollo-android), so you should config graphql api as what we do in Apollo-Android.\n\n Suppose we have graphql request below:\n\n ```\n query RepositoryStatistics($repo: String!, $owner: String!){\n   repository(name: $repo, owner: $owner) {\n     stargazers{\n       totalCount\n     }\n     watchers{\n       totalCount\n     }\n     issues{\n       totalCount\n     }\n   }\n }\n ```\n\nWe can then create an interface like this:\n\n```kotlin\ninterface GraphQLService {\n    fun repositoryStatisticsQuery(@GraphQLQuery(\"owner\") owner: String, @GraphQLQuery(\"repo\") repo: String): Observable\u003cData\u003e\n}\n```\n\nJust like what we do in retrofit, create an instance of interface by RetroApollo.Builder:\n\n```\nval apolloClient by lazy {\n\n//Build the Apollo Client\n    ApolloClient.builder()\n            .okHttpClient(OkHttpClient.Builder().addInterceptor(AuthInterceptor()).build())\n            .serverUrl(\"https://api.github.com/graphql\")\n            .build()\n}\n\nval graphQLService by lazy {\n    RetroApollo.Builder()\n            .apolloClient(apolloClient)\n            .addCallAdapterFactory(RxJavaCallAdapterFactory()\n                    .observableScheduler(AndroidSchedulers.mainThread())\n                    .subscribeScheduler(Schedulers.io()))\n            .build()\n            .createGraphQLService(GraphQLService::class)\n}\n```\n\nThat's it! Now we can make request like this:\n\n```kotlin\ngraphQLService.repositoryStatisticsQuery(\"enbandari\", \"RetroApollo\")\n            .subscribe {\n                ...\n            }\n```\n\n# License\n\n```\nCopyright 2017 Bennyhuo\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbennyhuo%2Fretroapollo-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbennyhuo%2Fretroapollo-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbennyhuo%2Fretroapollo-android/lists"}