import RelaySwiftUI

Relay.swift includes the RelaySwiftUI module, which makes it easy to use Relay in SwiftUI views. Relay makes it easy to declare what data your views need without having to manage the flow of where that data is stored or how it gets updated.

Accessing the Relay Environment


relayEnvironment()

Set the current Relay Environment for a tree of SwiftUI views.


@RelayEnvironment

Access the current Relay environment from a view.

Using Relay from SwiftUI views


RelaySwiftUI includes high-level property wrappers to interact with Relay from SwiftUI views.

@Query

Use a GraphQL query to fetch the data needed for a screen in the app.


@Fragment

Request specific data needed for a view, and delegate fetching to a @Query in a parent view.


@RefetchableFragment

Request data for a view, with support for refetching the latest version upon request.