apollo-android v3.2.0 Release Notes

  • 2022-03-29

    ๐Ÿš€ ๐Ÿ’™ Thanks to @undermark5, @demoritas, @rkoron007, @akshay253101, @StylianosGakis, @Goooler, @jeffreydecker, @theBradfo, @anderssandven and @olivierg13 for contributing to this release.

    ๐Ÿ›  This version adds JS WebSocket support, more options to deal with __typename amongst other features and bugfixes.

    ๐Ÿ‘ โœจ๏ธ [new] JS WebSocket support (#3913)

    ๐Ÿ”– Version 3.2.0 now has WebSocket support for Javascript targets courtesy of @undermark5! This is a huge milestone and means the JS target is now even closer to its JVM and iOS counterparts.

    ๐Ÿง | | jvm | Apple | js | linuxX64 | --- | :---: |:-----:|:----:| :---: | | apollo-api (models)|โœ…| โœ… | โœ… |โœ…| | apollo-runtime (network, query batching, apq, ...) |โœ…| โœ… | โœ… |๐Ÿšซ| | apollo-normalized-cache |โœ…| โœ… | โœ… |๐Ÿšซ| | apollo-adapters |โœ…| โœ… | โœ… |๐Ÿšซ| | apollo-normalized-cache-sqlite |โœ…| โœ… | ๐Ÿšซ |๐Ÿšซ| | apollo-http-cache |โœ…| ๐Ÿšซ | ๐Ÿšซ |๐Ÿšซ|

    ๐Ÿ’ป The implementation is based on the ws library on Node and the WebSocket API on the browser and inspired by Ktor.

    โœจ๏ธ [new] Fine grained __typename control (#3939)

    This version generates non-nullable fragments when it knows the fragment is always present:

    {
      cat {
        # Because Animal is a supertype of Cat this condition will always be true
        ... on Animal {
          species
        }
      }
    }
    

    ๐Ÿ‘ In addition, it introduces a addTypename Gradle option to have better control over when to add the __typename field:

    /**
     * When to add __typename. One of "always", "ifFragments", "ifAbstract" or "ifPolymorphic"
     *
     * - "always": Add '__typename' for every compound field
     *
     * - "ifFragments": Add '__typename' for every selection set that contains fragments (inline or named)
     * This is adding a lot more '__typename' than the other solutions and will be certainly removed in
     * a future version. If you require '__typename' explicitly, you can add it to your queries.
     * This causes cache misses when introducing fragments where no fragment was present before and will be certainly removed in
     * a future version.
     *
     * - "ifAbstract": Add '__typename' for abstract fields, i.e. fields that are of union or interface type
     * Note: It also adds '__typename' on fragment definitions that satisfy the same property because fragments
     * could be read from the cache and we don't have a containing field in that case.
     *
     * - "ifPolymorphic": Add '__typename' for polymorphic fields, i.e. fields that contains a subfragment
     * (inline or named) whose type condition isn't a super type of the field type.
     * If a field is monomorphic, no '__typename' will be added.
     * This adds the bare minimum amount of __typename but the logic is substantially more complex and
     * it could cause cache misses when using fragments on monomorphic fields because __typename can be
     * required in some cases.
     *
     * Note: It also adds '__typename' on fragment definitions that satisfy the same property because fragments
     * could be read from the cache and we don't have a containing field in that case.
     *
     * Default value: "ifFragments"
     */
    

    ๐Ÿ“„ You can read more in the corresponding Typename.md design document.

    ๐Ÿ“‡ โœจ๏ธ [new] Maven publishing for multi-module apollo metadata (#3904)

    ๐Ÿ“‡ The Apollo Gradle plugin now creates a new "apollo" publication if maven-publish is found. This means you can now publish the Apollo metadata to a maven repository: