All Projects → AniTrend → retrofit-graphql

AniTrend / retrofit-graphql

Licence: Apache-2.0 License
Retrofit converter which uses annotations to inject .graphql query or mutation files into a request body, along with any variables.

Programming Languages

kotlin
9241 projects
shell
77523 projects

Projects that are alternatives of or similar to retrofit-graphql

TheMovieDB
TheMovieDB is an android app based on TMDB api.
Stars: ✭ 16 (-85.19%)
Mutual labels:  retrofit2
kotlin-coroutines-android
Kotlin Coroutines for Android
Stars: ✭ 14 (-87.04%)
Mutual labels:  retrofit2
GitHubApplication
GitHubApplication 📱 is an Android application built to demonstrate the use of modern Android development tools - (Kotlin, Coroutines, Hilt, LiveData, View binding, Data Store, Architecture components, MVVM, Room, Retrofit, Navigation).
Stars: ✭ 11 (-89.81%)
Mutual labels:  retrofit2
mvp-android-template
MVP Android Template to give you a Quick Head Start for your next Android Project. It implements MVP Architecture using Dagger2, Room, RxJava2 , Retrofit2
Stars: ✭ 20 (-81.48%)
Mutual labels:  retrofit2
AndroidGithubIssues
Android app to fetch issues for a given repository
Stars: ✭ 34 (-68.52%)
Mutual labels:  retrofit2
paybill-manager
Your personal finance manager
Stars: ✭ 46 (-57.41%)
Mutual labels:  retrofit2
ParseRSS
A cup of library to Parse RSS for android. Also available as a ConverterFactory for Retrofit & Fuel
Stars: ✭ 17 (-84.26%)
Mutual labels:  retrofit2
neo4j-graphql-py
A GraphQL to Cypher query execution layer for Neo4j and Python GraphQL implementations.
Stars: ✭ 14 (-87.04%)
Mutual labels:  graphql-query
Dowy
🎬Application that displays a list of Movies and Tv Series using Modern Android Application Development tools and API's
Stars: ✭ 29 (-73.15%)
Mutual labels:  retrofit2
catchflicks
🎬 Kitchen sink project for learning android concepts 🎬
Stars: ✭ 12 (-88.89%)
Mutual labels:  retrofit2
Retrofit2-Flow-Call-Adapter
A Retrofit 2 adapter for Kotlin Flows.
Stars: ✭ 41 (-62.04%)
Mutual labels:  retrofit2
AndroidMVPArchitecture
Android MVP architecture sample project with or without RxJava and Dagger2 and Kotlin
Stars: ✭ 78 (-27.78%)
Mutual labels:  retrofit2
graphql-example
Intuitive GraphQL Resolver Example - Application example using RawModel.js as GraphQL rootValue on steroids.
Stars: ✭ 25 (-76.85%)
Mutual labels:  graphql-query
RxFamilyUser
框架使用retrofit2与rxjava2+databing,Md风格一个开源项目.
Stars: ✭ 21 (-80.56%)
Mutual labels:  retrofit2
EasyRetro
An Easy to use retrofit based network/api call extention for android
Stars: ✭ 16 (-85.19%)
Mutual labels:  retrofit2
Paging-3-Sample
This app is created as a sample app which loads movies from Tmdb api and uses Paging 3 library to show it in a Recycler view.
Stars: ✭ 96 (-11.11%)
Mutual labels:  retrofit2
CleanArchitectureMVVM
Example of Clean Architecture of Android app using MVVM, Koin, Coroutines, Retrofit, Room, Solid Principle, DRY, KISS, OOP
Stars: ✭ 60 (-44.44%)
Mutual labels:  retrofit2
tuya-connector
tuya-connector helps you efficiently create cloud development projects regarding the OpenAPI or message subscription capabilities. You can put all the focus on business logic without taking care of server-side programming nor relational databases.
Stars: ✭ 28 (-74.07%)
Mutual labels:  retrofit2
MVPArchitecture
Android MVP architecture in Kotlin using Dagger2, RxJava2, Retrofit2 and so on
Stars: ✭ 27 (-75%)
Mutual labels:  retrofit2
weather-app-android-mvvm
Simple MVVM practice repository for very very beginners. You don't need to know about Dagger, Coroutine or Rx for understanding MVVM and this project. To check the MVVM Architecture Bengali Tutorial visit my blog site
Stars: ✭ 32 (-70.37%)
Mutual labels:  retrofit2

Retrofit Converter - With GraphQL Support     Codacy Badge   Build Status

Seeing how we already have a really powerful type-safe HTTP client for Android and Java Retrofit why not use it and extend it's functionality, this project is a retrofit converter which uses annotations to inject .graphql query or mutation file contents into a request body along with any GraphQL variables.

Why This Project Exists?

Many might wonder why this exists when an android GraphQL library like Apollo exists. Unfortunately Apollo for Android still lacks some basic but important features/functionality which led to the following questions about General Design Questions Regarding Apollo, Polymorphic Type Handling and Non Shared Types. Don't get me wrong Apollo is not inferior any way, it has amazing features such as:

  • Code Generation (Classes and Data Types)
  • Custom Scalar Types
  • Cached Responses

But since model classes are automatically generated for you, the developer loses some flexibility, such as use of generics, abstraction and inheritance. Also Android Performance best practice suggests that developers should use StringDef and IntDef over enums and here's why, with the exception of kotlin especially when using R8.

Strangely there are tons of simple examples all over Medium using apollo graphql for Android, but none of them address these issues because most of them just construct a simple single resource request demo application. These look just fine at first glance until you start working with multiple data types and apollo starts generating classes for every fragment and query even if the data models are the same, or share similar properties.

See a list of changes from here


How Everything Works

Getting Started

  • Add the JitPack repository to your build file
allprojects {
    repositories {
        ...
        maven { url 'https://www.jitpack.io' }
    }
}
  • Add the dependency
dependencies {
    implementation 'com.github.anitrend:retrofit-graphql:{latest_version}'
}
  • Optional R8 / ProGuard Rules

If you are using R8 the shrinking and obfuscation rules are included automatically.

ProGuard users must manually copy the options from this file.

You might also need retrofit rules and it's dependencies (OkHttp and Okio)

Examples

Define, your .graphql files for your GraphQL queries, fragments, and mutations e.t.c.

If you use insomnia you can use this tool to generate your workspaces into directories and files insomnia-graphql-generator. After you can simply place the generated content into your assets folder e.g.:

N.B. You might find this too useful too JetBrains JS GraphQL - Plugin

For more instructions on how to setup the sample app and other examples with file uploads, persisted queries, custom loggers, custom graphql files location (outside assets) please visit the projects wiki page

Screenshots

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].