ConnectionHandler
has new methods that can be used to update paged result sets in an updater
function of a mutation. See the ConnectionHandler docs to learn more.commit
function now takes an onComplete
block that will be called once the network has completed the mutationNext
variant (e.g. QueryNext
) that's only available on iOS 14 or later (and equivalent versions of other Apple platforms). These versions use the new @StateObject
wrapper to let SwiftUI manage the storage of their internal state and tie it to the lifetime of the view. This is more correct than the existing property wrappers, which can sometimes get recreated unnecessarily when other view state changes.The API for these new wrappers is experimental and may change. In some future release after these platform versions are no longer in beta, support for iOS 13 will be dropped and these new wrappers will replace the existing ones.
If you're targeting a minimum of iOS 14 (or equivalent), you can use the new wrappers in your app. You may find it handy to make type aliases to the existing names (which will override the names imported from RelaySwiftUI
):
import RelaySwiftUI
typealias Fragment = RelaySwiftUI.FragmentNext
typealias PaginationFragment = RelaySwiftUI.PaginationFragmentNext
typealias Query = RelaySwiftUI.QueryNext
typealias Mutation = RelaySwiftUI.MutationNext
Decodable
protocol rather than a custom Readable
protocol. The Relay compiler no longer needs to generate init(from: SelectorData)
methods for all of these types, and in many cases can rely on Swift itself to synthesize an implementation for init(from: Decoder)
.optimisticUpdater
and updater
functions are now supported in mutations. Previously, they could be passed in but they did nothing.errors
in a GraphQL response payload are processed and handled correctly.