apollo-kotlin
apollo-kotlin copied to clipboard
🧹 4.0 cleanups
This is a list of changes that we can't do right now but should do in the next major release. This list is mostly a braindump and is missing a lot of context. This is not about new features but rather a list of small cleanups to do.
If you see anything that doesn't make any sense, it's probably because it doesn't. Feel free to comment and we'll dive into it.
Potential Breaking Changes/cleanups
- [x] ~Remove
suspendfrom theApolloStoreAPIs~ Offer a non-suspend version - [x] Validation of operation directives #4518
- [x] Switch jvm-defaults to "all" (thus requiring Java8, which we require already anyways)
- [x] Remove antlr
- [x] move deferredMergedFragments and variables outside of
CustomScalarAdapter - [x] Make apollo-ast's
com.apollographql.apollo3.ast.introspection.*classes non public to reduce the API surface (including the json serializers) as they are probably not useful to end-users - [x] Enable KDoc again
- [x] Add schemaPackageName/packageName to the Gradle configuration.
- [x] ApolloCall execute / toFlow / exception handling improvements
- [x] introduce
HasDirectiveinterface - [x] Rename
disposetocloseand implementokio.CloseableonNetworkTransport,HttpEngine,ApolloStore- That makes it difficult as it is a breaking change to add methods on interfaces. - [x] Remove
Fragment.readDataFromCache - [x] Capitalize the generated class name for enums, to be consistent with other generated types
- [x] Validate operation directives https://github.com/apollographql/apollo-kotlin/issues/2673
- [x] Deprecate ApolloCompositeException with Error level and use suppressed exceptions instead
- [x] ~Make
ApolloMetadatainternal~ (it's ultimately not internal because needed by plugins) - [ ] Enforce opt-in the
kotlin_labslinking - [ ] Rename
Foo.typetoFoo.__typeto avoid nameclashes (or just leave it like this because we can detect the case. See https://github.com/apollographql/apollo-kotlin/issues/4293) - [ ] Rewrite the buffered adapters to not use JsonReader anymore
- [ ] Cleanup the
JsonReaderAPI and distinguish between the buffer/non buffered case. - [ ] Generate the customScalarAdapters?
- [ ] Make the field merging validation more strict (see https://github.com/apollographql/apollo-kotlin/pull/4342#pullrequestreview-1083903524)
- [ ] Use scalar instead of customScalar https://github.com/apollographql/apollo-kotlin/issues/3815
- [ ] Refactor
shapes() - [ ] Move httpInfo and others outside of executionContext
- [ ] Improve the Java ergonomics of
HttpKt - [ ] (To be considered): pass the variant name to the lambda for
createAllAndroidVariantServices(see this comment) (or deprecate the function?) - [ ] Rename
WsProtocol.FactorytoWsProtocol.Builder - [ ] Remove IdlingResource. See this comment from OkHttp for instance, and this article about how to avoid them with Compose.
- [ ] Remove circular dependencies between Gradle projects
- [ ] extract HttpEngine and WebSocketEngine to a common module
- [x] Remove our own
runTest - [ ] Remove Gradle defaultService
Just saw this, and "Remove Fragment.readDataFromCache" from the list grabbed my attention. Would this also imply removing ApolloStore.readFragment()? I am interested in this because our app relies heavily on being able to query for fragments from the store (and watch them, but that's its own can of worms 😁). Thanks!
It's a technicality mostly. Fragment.readDataFromCache will be removed but all the functionality will be exposed as Executable.readDataFromCache. If you take a look at the source, both of them are present already, but one is deprecated because not really needed.
AFAIK, it should be source compatible so you shouldn't need to change anything.