You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Contributing to Apollo Android
1
+
# Contributing to Apollo Kotlin
2
2
3
3
The Apollo team welcomes contributions of all kinds, including bug reports, documentation, test cases, bug fixes, and
4
4
features.
@@ -62,7 +62,7 @@ Java interop
62
62
* If some extensions do not make sense in Java, mark them with `@JvmName("-$methodName")` to hide them from Java
63
63
64
64
Logging & Error messages
65
-
* Apollo Android must not log anything to System.out or System.err
65
+
* Apollo Kotlin must not log anything to System.out or System.err
66
66
* Error messages are passed to the user through `Exception.message`
67
67
* For debugging logs, APIs are provided to get diagnostics (like CacheMissException, HttpInfo, ...). APIs are better defined and allow more fine-grained diagnostics.
68
68
* There is one exception for the Gradle plugin. It is allowed to log information though the lifecycle() methods.
@@ -84,7 +84,7 @@ Please note that we will not accept pull requests for style changes.
84
84
85
85
## API compatibility
86
86
87
-
Apollo Android observes [semantic versioning](https://semver.org/). Between major releases, breaking changes are not
87
+
Apollo Kotlin observes [semantic versioning](https://semver.org/). Between major releases, breaking changes are not
88
88
allowed and any public API change will fail the build.
89
89
90
90
If that happens, you will need to run `./gradlew apiDump` and check for any incompatible changes before commiting these
@@ -94,7 +94,7 @@ files.
94
94
95
95
Using Kotlin's (or other dependencies') experimental or internal APIs, such as the ones marked
96
96
with `@ExperimentalCoroutinesApi` should be avoided as much as possible (exceptions can be made for native/JS targets only when no other option is
97
-
available). Indeed, applications using a certain version of Apollo Android could use a more up-to-date version of these
97
+
available). Indeed, applications using a certain version of Apollo Kotlin could use a more up-to-date version of these
98
98
APIs than the one used when building the library, causing crashes or other issues.
99
99
100
100
We also have the `@ApolloExperimental` annotation which can be used to mark APIs as experimental, for instance when
[](http://community.apollographql.com/new-topic?category=Help&tags=mobile,client)
Apollo Android is a GraphQL client that generates Kotlin and Java models from GraphQL queries.
11
+
Apollo Kotlin is a GraphQL client that generates Kotlin and Java models from GraphQL queries.
12
12
13
-
Apollo Android executes queries and mutations against a GraphQL server and returns results as query-specific Kotlin types. This means you don't have to deal with parsing JSON, or passing around `Map`s and making clients cast values to the right type manually. You also don't have to write model types yourself, because these are generated from the GraphQL definitions your UI uses.
13
+
Apollo Kotlin executes queries and mutations against a GraphQL server and returns results as query-specific Kotlin types. This means you don't have to deal with parsing JSON, or passing around `Map`s and making clients cast values to the right type manually. You also don't have to write model types yourself, because these are generated from the GraphQL definitions your UI uses.
14
14
15
15
Because generated types are query-specific, you can only access data that you actually specify as part of a query. If you don't ask for a particular field in a query, you can't access the corresponding property on the returned data structure.
16
16
@@ -34,7 +34,7 @@ This library is designed primarily with Android in mind, but you can use it in a
34
34
35
35
## Multiplatform
36
36
37
-
Apollo Android is a [Kotlin Multiplatform](https://kotlinlang.org/docs/multiplatform.html) project.
37
+
Apollo Kotlin is a [Kotlin Multiplatform](https://kotlinlang.org/docs/multiplatform.html) project.
38
38
39
39
Here's the current matrix of supported features per platform:
40
40
@@ -70,7 +70,7 @@ Check [the project website](https://www.apollographql.com/docs/android/) for in
70
70
71
71
If you are new to GraphQL, check out [the tutorial](https://www.apollographql.com/docs/android/v3/tutorial/00-introduction/) that will guide you through building an Android app using Apollo, Kotlin and coroutines.
72
72
73
-
If you'd like to add Apollo Android to an existing project, follow these steps:
73
+
If you'd like to add Apollo Kotlin to an existing project, follow these steps:
74
74
75
75
Add the plugin to your `build.gradle.kts`:
76
76
@@ -96,12 +96,12 @@ apollo {
96
96
}
97
97
```
98
98
99
-
Apollo Android supports three types of files:
99
+
Apollo Kotlin supports three types of files:
100
100
-`.graphqls` schema files: describes the types in your backend using the GraphQL syntax.
101
101
-`.json` schema files: describes the types in your backend using the Json syntax.
102
102
-`.graphql` executable files: describes your queries and operations in the GraphQL syntax.
103
103
104
-
By default, Apollo Android requires a schema in your module's `src/main/graphql` directory. You can download a schema using introspection with the `./gradlew downloadApolloSchema` task. Sometimes introspection is disabled and you will have to ask your backend team to provide a schema. Copy this schema to your module:
104
+
By default, Apollo Kotlin requires a schema in your module's `src/main/graphql` directory. You can download a schema using introspection with the `./gradlew downloadApolloSchema` task. Sometimes introspection is disabled and you will have to ask your backend team to provide a schema. Copy this schema to your module:
105
105
106
106
```
107
107
cp ${schema} ${module}/src/main/graphql/
@@ -133,7 +133,7 @@ Build your project, this will generate a `HeroQuery` class that you can use with
133
133
println("Hero.name=${response.data?.hero?.name}")
134
134
```
135
135
136
-
**To learn more about other Apollo Android APIs:**
136
+
**To learn more about other Apollo Kotlin APIs:**
137
137
138
138
* Execute your first [mutation](https://www.apollographql.com/docs/android/v3/essentials/mutations/)
@@ -204,9 +204,9 @@ If you'd like to contribute, please see [Contributing.md](https://github.com/apo
204
204
205
205
## Additional resources
206
206
207
-
-[MortyComposeKMM](https://github.com/joreilly/MortyComposeKMM): A Kotlin Multiplatform Github template using Apollo Android, SwiftUI and Jetpack Compose.
207
+
-[MortyComposeKMM](https://github.com/joreilly/MortyComposeKMM): A Kotlin Multiplatform Github template using Apollo Kotlin, SwiftUI and Jetpack Compose.
208
208
-[A journey to Kotlin multiplatform](https://www.youtube.com/watch?v=GN6LHrqyimI): how the project was moved to Kotlin multiplatform, talk given at Kotliners in June 2020.
209
-
-[#125, Fragmented Podcast](http://fragmentedpodcast.com/episodes/125/): Why's and How's about Apollo Android and the entire journey.
209
+
-[#125, Fragmented Podcast](http://fragmentedpodcast.com/episodes/125/): Why's and How's about Apollo Kotlin and the entire journey.
210
210
-[GraphQL.org](http://graphql.org) for an introduction and reference to GraphQL itself.
211
211
-[apollographql.com](http://www.apollographql.com/) to learn about Apollo open-source and commercial tools.
212
212
-[The Apollo blog](https://www.apollographql.com/blog/) for long-form articles about GraphQL, feature announcements for Apollo, and guest articles from the community.
@@ -218,7 +218,7 @@ If you'd like to contribute, please see [Contributing.md](https://github.com/apo
218
218
219
219
*[Apollo Studio](https://www.apollographql.com/studio/develop/) – A free, end-to-end platform for managing your GraphQL lifecycle. Track your GraphQL schemas in a hosted registry to create a source of truth for everything in your graph. Studio provides an IDE (Apollo Explorer) so you can explore data, collaborate on queries, observe usage, and safely make schema changes.
220
220
*[Apollo Federation](https://www.apollographql.com/apollo-federation) – The industry-standard open architecture for building a distributed graph. Use Apollo’s gateway to compose a unified graph from multiple subgraphs, determine a query plan, and route requests across your services.
221
-
*[Apollo Client](https://www.apollographql.com/apollo-client/) – The most popular GraphQL client for the web. Apollo also builds and maintains [Apollo iOS](https://github.com/apollographql/apollo-ios) and [Apollo Android](https://github.com/apollographql/apollo-android).
221
+
*[Apollo Client](https://www.apollographql.com/apollo-client/) – The most popular GraphQL client for the web. Apollo also builds and maintains [Apollo iOS](https://github.com/apollographql/apollo-ios) and [Apollo Kotlin](https://github.com/apollographql/apollo-android).
222
222
*[Apollo Server](https://www.apollographql.com/docs/apollo-server/) – A production-ready JavaScript GraphQL server that connects to any microservice, API, or database. Compatible with all popular JavaScript frameworks and deployable in serverless environments.
Copy file name to clipboardExpand all lines: ROADMAP.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Roadmap
2
2
3
-
This document is meant to give the community some idea of where we're going with Apollo Android in the short and longer term.
3
+
This document is meant to give the community some idea of where we're going with Apollo Kotlin in the short and longer term.
4
4
5
-
Please open issues or comment/upvote the existing ones for items you'd like to see added here. Feedback is very welcome! We'd love to learn more about how you're using Apollo Android and what you'd like to see in the future.
5
+
Please open issues or comment/upvote the existing ones for items you'd like to see added here. Feedback is very welcome! We'd love to learn more about how you're using Apollo Kotlin and what you'd like to see in the future.
6
6
7
7
This document was last updated on October 25th, 2021.
8
8
@@ -24,9 +24,9 @@ As we move to a stable 3.0 release our priority will be to make sure the feedbac
24
24
25
25
The declarative cache makes working with the cache and defining unique object ids easier. We also want to include helpers to handle with common cases like pagination, garbage collection and eviction.
26
26
27
-
### Make Apollo Android even more multiplatform
27
+
### Make Apollo Kotlin even more multiplatform
28
28
29
-
Apollo Android 3 is multiplatform first with runtime and cache support for the JVM, iOS, macOS and JS. We can do more to make the library even more easy to use:
29
+
Apollo Kotlin 3 is multiplatform first with runtime and cache support for the JVM, iOS, macOS and JS. We can do more to make the library even more easy to use:
Copy file name to clipboardExpand all lines: design-docs/Codegen.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# Codegen Models
2
2
3
-
In order to provide type safety, Apollo Android generates Kotlin models from your queries. The fields you're querying will be accessible in the Kotlin models. Fields that are not queried will not be accessible. For simple queries, the mapping of GraphQL queries to Kotlin models is relatively natural. GraphQL objects are mapped to Kotlin data classes and GraphQL fields to Kotlin properties.
3
+
In order to provide type safety, Apollo Kotlin generates Kotlin models from your queries. The fields you're querying will be accessible in the Kotlin models. Fields that are not queried will not be accessible. For simple queries, the mapping of GraphQL queries to Kotlin models is relatively natural. GraphQL objects are mapped to Kotlin data classes and GraphQL fields to Kotlin properties.
4
4
5
-
For more complex queries, involving [merged fields](https://spec.graphql.org/draft/#sec-Field-Selection-Merging) and/or [fragments](https://spec.graphql.org/draft/#sec-Validation.Fragments) on different interfaces/union types, this mapping becomes more complicated as polymorphic types are needed. In order to accommodate different needs, Apollo Android supports three different codegen modes:
5
+
For more complex queries, involving [merged fields](https://spec.graphql.org/draft/#sec-Field-Selection-Merging) and/or [fragments](https://spec.graphql.org/draft/#sec-Validation.Fragments) on different interfaces/union types, this mapping becomes more complicated as polymorphic types are needed. In order to accommodate different needs, Apollo Kotlin supports three different codegen modes:
6
6
7
7
***responseBased**: the Kotlin models map the received json.
8
8
***operationBased**: the Kotlin models map the sent operation.
9
-
***compat**: for compatibility with Apollo Android 2.x
9
+
***compat**: for compatibility with Apollo Kotlin 2.x
10
10
11
11
`operationBased` will generate less code but will use more memory and expose less type information. `responseBased` will generate interfaces to access the models in a more polymorphic way. It will also store each merged field exactly once and have more efficient json parsing. That comes at the price of more generated code.
This is Apollo Android documentation for how things work under the hood. The user-facing documentation about how to use Apollo Android is available at https://www.apollographql.com/docs/android/.
3
+
This is Apollo Kotlin documentation for how things work under the hood. The user-facing documentation about how to use Apollo Kotlin is available at https://www.apollographql.com/docs/android/.
4
4
5
5
This internal documentation is work in progress. It is used for brainstorming/communication but might be lagging sometimes, feel free to send PRs!
Apollo Android has no concept of "Atomic request". Launching the same request twice in a row will most likely end up in the request being sent to the network twice even if the first one will ultimately cache it (but this is not guaranteed either):
158
+
Apollo Kotlin has no concept of "Atomic request". Launching the same request twice in a row will most likely end up in the request being sent to the network twice even if the first one will ultimately cache it (but this is not guaranteed either):
If you're looking for a specific feature (APQs, Codegen options, `@nonnull`, ...) the [integration-tests](../tests) have a lot of very focused examples of how to use Apollo Android.
1
+
If you're looking for a specific feature (APQs, Codegen options, `@nonnull`, ...) the [integration-tests](../tests) have a lot of very focused examples of how to use Apollo Kotlin.
2
2
3
3
For more general examples demonstrating how to build an App end to end, check:
4
4
5
5
*https://github.com/apollographql/apollo-android-tutorial for an **Android App** example
6
-
*https://github.com/joreilly/MortyComposeKMM for a **Multiplatform App** example
6
+
*https://github.com/joreilly/MortyComposeKMM for a **Multiplatform App** example
0 commit comments