0.3.0
#
AddedA MockEnvironment is now available to allow for writing tests or SwiftUI previews
The default
ConnectionHandler
has new methods that can be used to update paged result sets in anupdater
function of a mutation. See the ConnectionHandler docs to learn more.Records in the Relay store that are no longer referenced by a visible view will be garbage-collected to free up memory
@Mutation's
commit
function now takes anonComplete
block that will be called once the network has completed the mutationAll four SwiftUI property wrappers now have an experimental
Next
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
):
#
Changed- The Swift types generated for reading fragment data now implement Swift's
Decodable
protocol rather than a customReadable
protocol. The Relay compiler no longer needs to generateinit(from: SelectorData)
methods for all of these types, and in many cases can rely on Swift itself to synthesize an implementation forinit(from: Decoder)
.
#
Fixed- Union and interface types can be used and will generate appropriate Swift types
optimisticUpdater
andupdater
functions are now supported in mutations. Previously, they could be passed in but they did nothing.- The
errors
in a GraphQL response payload are processed and handled correctly.