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
* React hook to fetch the result of a computed view from the backend. Returns a standard hook result set with a tuple of the result object with `data`, `fetching`, and `error` keys, and a `refetch` function. `data` will be the shape of the computed view's result.
11
17
*
12
-
* @parammanager Gadget view function to run
18
+
* @paramview Gadget view function to run, like `api.leaderboard` or `api.todos.summary`
13
19
* @param options options for controlling client side execution
14
20
*
15
21
* @example
@@ -58,34 +64,84 @@ export function useView<F extends ViewFunctionWithVariables<any, any>>(
58
64
variables: F["variablesType"],
59
65
options?: Omit<ReadOperationOptions,"live">
60
66
): ReadHookResult<ViewResult<F>>;
67
+
/**
68
+
* React hook to fetch the result of an inline computed view with variables from the backend. Returns a standard hook result set with a tuple of the result object with `data`, `fetching`, and `error` keys, and a `refetch` function. `data` will be the shape of the computed view's result.
69
+
*
70
+
* Does not know the type of the result from the input string -- for type safety, use a named view defined in a .gelly file in the backend.
71
+
*
72
+
* @param view Gelly query string to run, like `{ count(todos) }`
73
+
* @param variables variables to pass to the backend view
74
+
* @param options options for controlling client side execution
// if the view exports the typenames it references, add them to the context so urql will refresh the view when mutations are made against these typenames
0 commit comments