Skip to content

Releases: apollographql/apollo-kotlin

v1.4.1

29 Mar 14:17
Compare
Choose a tag to compare

Bug Fixes

Make apollo-compiler an api dependency of Gradle Plugin (#2010)

v1.4.0

23 Mar 19:23
Compare
Choose a tag to compare

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 like getServerUrl
  • 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

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

  • Remove redundant moshi-kotlin dependency (#2055)
  • Reorganize api-module (#1985)
  • Update CACHE_AND_NETWORK documentation (#2041)

v1.3.3

07 Mar 12:51
Compare
Choose a tag to compare

Fix issue with lowercase enum type names (#2045)
Fix issue when JSON object map to raw String it loses quotes (#2037)
Ignore BOM symbol when parsing GraphQL schema (#2039)

v1.3.2

14 Feb 09:21
Compare
Choose a tag to compare

Make flow extensions be retryable (#1997)
Fix regression issue field indexes messed up for queries with fragments (#1994)
Add a test to check customTypeMapping is working from a service block (#1991)

v1.3.1

12 Feb 05:40
Compare
Choose a tag to compare

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

24 Jan 17:38
Compare
Choose a tag to compare

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:

previous version

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
...

new version

  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

14 Jan 03:32
Compare
Choose a tag to compare

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

03 Dec 15:19
85a92df
Compare
Choose a tag to compare

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

01 Nov 22:04
e6b8091
Compare
Choose a tag to compare

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

02 Oct 23:06
f221726
Compare
Choose a tag to compare

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)