You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The [react-relay-offline-examples](https://github.com/morrys/react-relay-offline-example) repository contains an integration of react-relay-offline. To try it out:
82
+
The [offline-examples](https://github.com/morrys/offline-examples) repository contains example projects on how to use react-relay-offline:
**For SSR web applications there is a native management in the QueryRenderer to correctly manage the DOM returned by the server and restore the environment**
275
-
276
-
277
280
## fetchQuery
278
281
279
282
```ts
@@ -294,24 +297,76 @@ import { useNetInfo } from "react-relay-offline";
294
297
import { NetInfo } from"react-relay-offline";
295
298
```
296
299
297
-
## Hooks & useQuery
300
+
## Supports Hooks from relay-hooks
298
301
299
302
Now you can use hooks (useFragment, usePagination, useRefetch) from [relay-hooks](https://github.com/relay-tools/relay-hooks)
300
303
301
-
while it is necessary to use `useQuery` of react-relay-offline to manage the offline.
304
+
## render-as-you-fetch & usePreloadedQuery
305
+
306
+
### loadQuery
307
+
308
+
* input parameters
309
+
310
+
same as useQuery + environment
311
+
312
+
* output parameters
313
+
*
314
+
`next: <TOperationTypeextendsOperationType>(
315
+
environment:Environment,
316
+
gqlQuery:GraphQLTaggedNode,
317
+
variables?:TOperationType['variables'],
318
+
options?:QueryOptions,
319
+
) =>Promise<void>`: fetches data. A promise returns to allow the await in case of SSR
320
+
* `dispose: () =>void`: cancel the subscription and dispose of the fetch
321
+
* `subscribe: (callback: (value:any) =>any) => () =>void`: used by the usePreloadedQuery
322
+
* `getValue <TOperationType>(environment?:Environment,) =>OfflineRenderProps<TOperationType> |Promise<any>`: used by the usePreloadedQuery
0 commit comments