TypeScript library files for Relay Modern Offline
With the release v11.0.2 important changes have been made to the internal relay api.
before:
import { fetchQuery} from 'react-relay-offline';
queryProps = await fetchQuery<any>(
environment,
query,
variables,
)
after:
import { fetchQuery} from 'relay-runtime';
if(!environment.isRehydrated()) {
await environment.hydrate();
}
queryProps = await fetchQuery<any>(
environment,
query,
variables,
).toPromise()
I recommend reading the release notes for relay-hooks and wora / relay-store: https://github.com/relay-tools/relay-hooks/releases/tag/v4.0.0 https://github.com/morrys/wora/releases/tag/relay-store%404.0.0
online
prop to QueryRenderer render function and in hooksProps returned by useQuery, useLazyLoadQuery, usePreloadedQuery #19issues: https://github.com/morrys/react-relay-offline/issues/44 https://github.com/morrys/react-relay-offline/issues/6 https://github.com/morrys/react-relay-offline/issues/30
Improved
- added fetchQuery
- persist cacheConfig in offlineProcess, thanks to this PR facebook/relay#2937, now you can change network behavior directly from mutations
Fixed
- fix retain typing
- fix StoreOptions in EnvironmentIDB
Improved
- added StoreOptions type
- backward compatibility in GC (relay-store 2.x)