apollo-kotlin

 A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.

MIT License

Stars
3.7K
Committers
247

Bot releases are visible (Hide)

apollo-kotlin - v1.4.2

Published by tasomaniac over 4 years ago

Note: We had maven publish issue. Please use v1.4.3

apollo-kotlin - v1.4.1

Published by tasomaniac over 4 years ago

Bug Fixes

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

apollo-kotlin - v1.4.0

Published by tasomaniac over 4 years ago

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

  • 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

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

Published by tasomaniac over 4 years ago

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)

apollo-kotlin -

Published by tasomaniac over 4 years ago

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)

apollo-kotlin - v1.3.1

Published by sav007 over 4 years ago

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)

apollo-kotlin - v1.3.0

Published by tasomaniac over 4 years ago

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)

apollo-kotlin - v1.2.3

Published by sav007 almost 5 years ago

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)

apollo-kotlin - v1.2.2

Published by sav007 almost 5 years ago

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(https://github.com/apollographql/apollo-android/commit/0c967722eb014ec8d07788c431538fc242caed87)
Do not allow queries or schema variant overrides (#1739)
Service properties schemaPath and sourceFolder can now be absolute paths.(https://github.com/apollographql/apollo-android/commit/0c967722eb014ec8d07788c431538fc242caed87)
Make compilationUnits private API (https://github.com/apollographql/apollo-android/commit/28f81856e5f61b2fe004fb9db0674df56944d620)
Do not support multiple schema.json by default and ask people use service instead (https://github.com/apollographql/apollo-android/commit/977a8857ab9d7fb33fe6f704a6550c818ac96e0b)
Support for no schema.json as before. And also have better error output (https://github.com/apollographql/apollo-android/commit/b371c1c6eaa34f1ca0d4d24be9aa4bf48da8bbe2)
Make java models accessible from kotlin (#1755)
Add ./gradlew downloadApolloSchema (#1777)

apollo-kotlin - v1.2.1

Published by sav007 almost 5 years ago

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)

apollo-kotlin - v1.2.0

Published by sav007 about 5 years ago

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)

apollo-kotlin - v1.1.3

Published by sav007 about 5 years ago

Fix issue with checking if one type is assignable from another (#1570)

apollo-kotlin - v1.1.2

Published by sav007 about 5 years ago

Fix issue with reference to variable from array argument (#1561)
Fix issue with missing fragment specification for top level inline fragment (#1562)
Add validation for inline fragment type condition (#1565)

apollo-kotlin - v1.1.1

Published by sav007 about 5 years ago

Fix issue with deep nested referenced fragments (#1530)
Make Data wrapper node to be optional for schema introspection json (#1531)
Update ANTLR grammar to make separator optional in inline input values (#1532)
Fix issue with deep transitive referenced input types not generated (#1535)
Fix issue with duplicated fragment definition in query (#1536)
Fix 1522 package name regression (#1544)
Add more descriptive message for non supported anonymous operations (#1546)

apollo-kotlin - v1.1.0

Published by sav007 about 5 years ago

Importent: there 2 major changes introduced by this release:

  • minimum supported Gradle version is bumped up to 5.1.1
  • new code generation engine (enabled by default) that doesn't depend on Node JS Apollo codegen module. If you run into any issues with new engine and want to switch back to old one, set system build property apollographql.useExperimentalCodegen to false: apollographql.useExperimentalCodegen=false.

In next release old code generation engine will be removed completely.

New code generation engine (#1482, #1484, #1488, #1491, #1493, #1499, #1500, #1505, #1512)
Modernize build and fix deprecated gradle API usages (#1476)
Drop Rx1 support (#1508)
Enable new code gen by default (#1515)

apollo-kotlin - v1.0.2

Published by sav007 about 5 years ago

Breaking Changes: Having systemProp.apollographql.useGlobalApolloCodegen=true will require you to have apollo-codegen globally installed and will not fallback to local installation anymore.

Avoid possible types verification generation for non optional fragments (#1410)
Generate Java annotation to suppress unchecked warnings for marshaller (#1422)
Generate Kotlin input type models as data classes (#1421)
Fix issue with Kotlin code generation to read optional enum type (#1428)
Add visitor spec to generate visitor interface and compatible visitor method for Java (#1414)
Don't send content type JSON for GET requests (#1431)
Add types to prevent warnings in the IDE (#1450)
Fix NPE with httpcall been released before execution (#1442)
Fix: Speed up build configuration time (#1451)

apollo-kotlin - Release 1.0.1

Published by sav007 over 5 years ago

Support graphql file upload (#1286)
Fix bad line wrapping for enum safeValueOf Kotlin model generation (#1304)
Fix operation wrapData to accept optional argument for Kotlin models (#1303)
Fix issue with wrong operation name generated for Kotlin models (#1308)
Fix code generation for input list fields marshaling (#1310)
Use Any instead of Object in unmapped custom scalar types (#1309)
Enable file upload in nested object (#1313)
Make npm install and code gen tasks cacheable (#1338)
Add support of .gql file extension (#1341)
Propagate network error for CacheAndNetworkFetcher (#1342)
Don't send extensions in query payload when auto persistence disabled (#1340)
Fix usages of internal OkHttp APIs (#1357)
Fix issue with Kotlin model generation for non nullable lists (#1361)
do not try to compile java files if we don't generate any (#1353)
Add support to exclude GraphQL files (#1374)
Support send HttpGetMethod for Persisted Queries (#1376)
Move after evaluate down to the place where it really needed (#1396)

apollo-kotlin - v1.0.0

Published by sav007 over 5 years ago

Notify subscription server connection open (#1212)
Use separate packageNames for separate modules. (#1208)
Fix the name of the artifact (#1199)
Fix the ConcurrentModificationException in RealSubscriptionManager#stop (#1214)
Updated compile to implementation in gradle (#1220)
Updated "Downloading a Schema" (#1225)
Preserve null list items when parsing the response (#1211)
Added null check for response 'data' field before parsing payload (#1216)
Add support of Kotlin model generation (#1102)
Update gradle version + fix issue with enum (#1266)
Fix optional input type description (#1269)
Fix Input type marshalling Kotlin code gen (#1270)
Replace JSR250 dependency annotation with plain comment. (#1279)
Provide configuration to send query as HTTP GET (#1291)
Try to fix issue with local Apollo codegen CLI not found error (#1294)

apollo-kotlin - v1.0.0-alpha5

Published by sav007 over 5 years ago

Fix issue with operation id doesn't match the SHA of query (#1185)
Notify subscription listener when connection is terminated (#1175)
Coroutines extensions (#1169)
Stop subscriptions (#1025)

apollo-kotlin - v1.0.0-alpha4

Published by sav007 almost 6 years ago

Fix issue operation constructor argument with NotNull annotation (#1117)
Address warnings for apollo configuration extension (#1121)
Skip out-of-date directories/folders, process files only (#1125)
Make plugin resistant to applying order (#1120)
Fix issue with warnings for extension properties access right (#1128)
Fix clash of names when GraphQL schema defines own Operation object (#1129)
Fix for Input class equal method (#1138)
Capitalize generated class name for GraphQL enum type (#1148)
Add support for Auto Persisted Queries (#1137)
Fix issue with operation id doesn't match query document (#1167)
Remove forcing fragments with inline fragments to be always nullable (#1168)