Releases: apollographql/apollo-kotlin
v1.4.1
v1.4.0
New Features
Schema Download Timeout
Download Schema feature now support configuring timeout. This is useful if you have a big schema. More info here: https://www.apollographql.com/docs/android/essentials/get-started/#downloading-a-schemajson-file
Added in: config okHttp timeout (#2026)
ApolloClient
API improvements
ApolloClient
now has more getters likegetServerUrl
- Added
newBuilder()
method to be able to create a copy with some properties modified
apolloClient
.newBuilder()
.serverUrl(newUrl)
.build()
Added in:
ApolloClient
API improvements (#2075)
Bug Fixes
Coroutines Support
- catch offer exceptions. See Kotlin/kotlinx.coroutines#974 (#2007)
- wrap more channel.offer calls (#2058)
- fix coroutine documentation (#2092)
Gradle Plugin
- Expose Compilation Units earlier (#2032)
Compiler
- Refactor GraphQL query validation (#2073)
- Fix issue with inlined input object validation (#2081)
- Fix issue with fragment condition type coercing (#2090)
Internal Changes
v1.3.3
v1.3.2
v1.3.1
Deploy apollo-gradle-plugin to plugins.gradle.org (#1932)
Fix licenses overwriting the main url (#1939)
Remove the 1.3.0 warning (#1942)
Remove bintray plugin and upload marker to bintray (#1933)
Allow to override operationIdGenerator from onCompilationUnits (#1949)
Generate default value for __typename field (#1944)
Rename all singular CompilationUnit references to singular (#1951)
Add support for auto persisted subscriptions (#1943)
Field with inline fragment forced to be optional (#1960)
Generate CustomType enum constants ordered by name (#1959)
Avoid field names clash (#1958)
Sanitize yield keyword in Kotlin (#1971)
Use KotlinProjectExtension instead of the reflection magic to get a kotlin sourceDirectorySet (#1978)
Fix Object type name collision (#1979)
Fix compile task naming (#1982)
v1.3.0
Migration guide:
https://github.com/apollographql/apollo-android#migrating-to-13x
BREAKING-CHANGES:
This release introduces breaking changes to generated Kotlin models with inline fragments. Field inlineFragment
is no longer generated, for example:
data class Hero(
val __typename: String,
/**
* The name of the character
*/
val name: String,
val inlineFragment: HeroCharacter?
) {
val asHuman: AsHuman? = inlineFragment as? AsHuman
val asDroid: AsDroid? = inlineFragment as? AsDroid
...
data class Hero(
val __typename: String,
/**
* The name of the character
*/
val name: String,
val asHuman: AsHuman?,
val asDroid: AsDroid?
)
previous version of code generation wasn't quite correct, as there are cases when multiple inline fragments can be resolved for the same type. For example having this GraphQL interface hierarchy Character <- Hero <- Human
and this GraphQL query:
query {
character {
name
... on Hero { ... }
... on Human { ... }
}
}
both inline fragments AsHero
and AsHuman
must be resolved for character field with type Human
(due to the hierarchy Hero <- Human
). Previous version of generated model for character
resolves only first fragment AsHero
. New one - resolves both AsHero
and AsHuman
inline fragments.
Migration:
If you had this code to get access to the inline fragment before:
when (hero.inlineFragment) {
is Hero.AsHuman -> ...
is Hero.AsDroid -> ...
}
you should change it and check all declared inline fragment for nullability, as it's possible to have multiple fragments to be resolved :
if (hero.asHuman != null) {
...
}
if (hero.asDroid != null) {
...
}
Changelog:
toJson kotlin extension (#1922)
Generate Operation.Data toJson implementation (#1916)
Do not take into account sources set on ApolloExtension or Service for Test variants (#1913)
Add support of fragment with directives (#1912)
Promote incubating plugin (#1903)
Add support directives to inline fragments (#1891)
Singularization fixes (#1888)
Move IdlingResources to AndroidX libraries (#1878)
More clear project name for composite build Build Scripts (#1875)
Capitalize class name after singularize irregular word (#1870)
Generate default value for optional variables (#1869)
Remove transformed queries (#1859)
Add customizable persisted query id generation (#1849)
Provide a way to look at query generated operation output. (#1841)
v1.2.3
Address InputFieldJsonWriter.writeCustom ignore encoded value (#1900)
Allow nested classes to have the same name as their parents in kotlin (#1893)
Fix json nesting issue with operation json writer (#1892)
Apollo coroutines are now on jcenter (#1862)
Fix Rx extension configure lambda do not use the returned instance (#1867)
Address callback is skipped for custom decorated okhttp calls (#1828)
v1.2.2
Make okhttp and apollo api deps in http-cache (#1725)
Add proper support for custom JSON object / list scalar types (#1736)
Introduce simple response reader (#1759)
New Kotlin extensions to RxJava2 support and Input API (#1754)
Generate function to parse operation response (#1761)
Made the Transformed queries match exatcly Operation.queryDocument() (#1763)
Generate computed properties to access inline fragment instances (#1780)
Parse generated GraphQL operation models from okio source (#1796)
Provide API to serialize GraphQL operation variables as JSON string (#1802)
Generate parse operation response API with default ScalarTypesAdapters (#1811)
Add support of normalized cache to subscriptions (#1804)
Add configuration to generate Kotlin models with internal modifier (#1818)
Add support for GraphQL extensions (#1817)
Incubating Gradle Plugin:
Fix the deprecation message (#1728)
Hide the extension implementation from kotlin dsl accessors (#1729)
Provide a DSL to change compilation unit settings(0c96772)
Do not allow queries or schema variant overrides (#1739)
Service properties schemaPath
and sourceFolder
can now be absolute paths.(0c96772)
Make compilationUnits private API (28f8185)
Do not support multiple schema.json by default and ask people use service instead (977a885)
Support for no schema.json as before. And also have better error output (b371c1c)
Make java models accessible from kotlin (#1755)
Add ./gradlew downloadApolloSchema (#1777)
v1.2.1
Fix input type field codegen with empty list as default values (#1659)
Fix issue with nested fragments not generated (#1658)
Fix parser don't accept empty input object as an argument (#1660)
Fix possible deadlock with http call execution (#1663)
Fix generated input type fields missing default values. (#1671)
Fix issue with locating root for __schema object (#1680)
Fix issue with generating field mapper for surrogate Fragment class (#1681)
Add default custom scalar type adapter for Object (#1685)
Fix fragment field is not generated with inline fragment (#1684)
Guard subscription manager state transitions (#1687)
Add the way to inject subscription connection params provider (#1688)
Add subscription state listener (#1691)
Include operation directives in document source (#1695)
Minify GraphQL query document (#1705)
Ignore comma GraphQL tokens (#1714)
Incubating plugin: lazy configuration and gradle-y things (#1715)
Lift restriction of having uniqueness of subscription registration (#1720)
v1.2.0
Important: this release removes usage of old code generator (https://www.npmjs.com/package/apollo-codegen) entirely. This is point of no return.
Remove old NPM code generator (#1555)
Resolve null pointer exception on detail screen (#1591)
Supress "UNUSED_ANONYMOUS_PARAMETER" to prevent warnings in generated Kotlin code (#1595)
Coroutines: add ApolloCall.toFlow()
(#1581)
Add option for outputting transformed queries (#1599)
Fix Fragments map function skip possible types check (#1608)
Place directives after arguments in field source (#1615)
fix exception throw due to adding httpBody to get request. (#1598)
Allow shared custom types (#1592)
Fix query duplicated fields by merging them (#1618)
Proper merge fields (#1624)
Fix issue with bad wrapping for EnumType Kotlin code generation (#1625)
Add support for introspection queries (#1626)
Rework transformed query output to include separate fragments (#1631)
Report if fragment can't be spread (#1633)
Fix issue with stack overflow when parsing circle referenced input types (#1643)