@trackunit/react-graphql-hooks 1.22.17 → 1.22.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +15 -0
- package/index.esm.js +15 -0
- package/package.json +4 -4
- package/src/useLazyQuery.d.ts +8 -0
- package/src/useQuery.d.ts +7 -0
package/index.cjs.js
CHANGED
|
@@ -56,6 +56,14 @@ const setupLibraryTranslations = () => {
|
|
|
56
56
|
* This hook prevents UI flickering during refetches by returning the previous data
|
|
57
57
|
* when new data is loading, unless stableData is set to false.
|
|
58
58
|
*
|
|
59
|
+
* ### When to use
|
|
60
|
+
* Use `useLazyQuery` when the query should fire on a user action (button click, form
|
|
61
|
+
* submit, or after a precondition is met), not on mount.
|
|
62
|
+
*
|
|
63
|
+
* ### When not to use
|
|
64
|
+
* - When data should load immediately on render — use `useQuery`.
|
|
65
|
+
* - For Relay-style cursor-paginated lists — use `usePaginationQuery`.
|
|
66
|
+
*
|
|
59
67
|
* @example
|
|
60
68
|
* ```tsx
|
|
61
69
|
* // Basic usage with stable data and polling loading (both are defaults)
|
|
@@ -541,6 +549,13 @@ const usePaginationQuery = (document, props) => {
|
|
|
541
549
|
* This hook prevents UI flickering during refetches by returning the previous data
|
|
542
550
|
* when new data is loading, unless stableData is set to false.
|
|
543
551
|
*
|
|
552
|
+
* ### When to use
|
|
553
|
+
* Use `useQuery` for any GraphQL query that should execute on mount and render data.
|
|
554
|
+
*
|
|
555
|
+
* ### When not to use
|
|
556
|
+
* - When the query should fire on a user action — use `useLazyQuery`.
|
|
557
|
+
* - For Relay-style cursor-paginated lists — use `usePaginationQuery`.
|
|
558
|
+
*
|
|
544
559
|
* @example
|
|
545
560
|
* ```tsx
|
|
546
561
|
* // Basic usage with stable data and polling loading (both are defaults)
|
package/index.esm.js
CHANGED
|
@@ -54,6 +54,14 @@ const setupLibraryTranslations = () => {
|
|
|
54
54
|
* This hook prevents UI flickering during refetches by returning the previous data
|
|
55
55
|
* when new data is loading, unless stableData is set to false.
|
|
56
56
|
*
|
|
57
|
+
* ### When to use
|
|
58
|
+
* Use `useLazyQuery` when the query should fire on a user action (button click, form
|
|
59
|
+
* submit, or after a precondition is met), not on mount.
|
|
60
|
+
*
|
|
61
|
+
* ### When not to use
|
|
62
|
+
* - When data should load immediately on render — use `useQuery`.
|
|
63
|
+
* - For Relay-style cursor-paginated lists — use `usePaginationQuery`.
|
|
64
|
+
*
|
|
57
65
|
* @example
|
|
58
66
|
* ```tsx
|
|
59
67
|
* // Basic usage with stable data and polling loading (both are defaults)
|
|
@@ -539,6 +547,13 @@ const usePaginationQuery = (document, props) => {
|
|
|
539
547
|
* This hook prevents UI flickering during refetches by returning the previous data
|
|
540
548
|
* when new data is loading, unless stableData is set to false.
|
|
541
549
|
*
|
|
550
|
+
* ### When to use
|
|
551
|
+
* Use `useQuery` for any GraphQL query that should execute on mount and render data.
|
|
552
|
+
*
|
|
553
|
+
* ### When not to use
|
|
554
|
+
* - When the query should fire on a user action — use `useLazyQuery`.
|
|
555
|
+
* - For Relay-style cursor-paginated lists — use `usePaginationQuery`.
|
|
556
|
+
*
|
|
542
557
|
* @example
|
|
543
558
|
* ```tsx
|
|
544
559
|
* // Basic usage with stable data and polling loading (both are defaults)
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-graphql-hooks",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.19",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=24.x"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@trackunit/i18n-library-translation": "1.18.
|
|
11
|
-
"@trackunit/shared-utils": "1.13.
|
|
10
|
+
"@trackunit/i18n-library-translation": "1.18.19",
|
|
11
|
+
"@trackunit/shared-utils": "1.13.113",
|
|
12
12
|
"es-toolkit": "^1.39.10",
|
|
13
|
-
"@trackunit/react-components": "1.22.
|
|
13
|
+
"@trackunit/react-components": "1.22.19"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@apollo/client": "^3.13.8",
|
package/src/useLazyQuery.d.ts
CHANGED
|
@@ -22,6 +22,14 @@ export interface LazyQueryProps<TData, TVariables extends ApolloOperationVariabl
|
|
|
22
22
|
* This hook prevents UI flickering during refetches by returning the previous data
|
|
23
23
|
* when new data is loading, unless stableData is set to false.
|
|
24
24
|
*
|
|
25
|
+
* ### When to use
|
|
26
|
+
* Use `useLazyQuery` when the query should fire on a user action (button click, form
|
|
27
|
+
* submit, or after a precondition is met), not on mount.
|
|
28
|
+
*
|
|
29
|
+
* ### When not to use
|
|
30
|
+
* - When data should load immediately on render — use `useQuery`.
|
|
31
|
+
* - For Relay-style cursor-paginated lists — use `usePaginationQuery`.
|
|
32
|
+
*
|
|
25
33
|
* @example
|
|
26
34
|
* ```tsx
|
|
27
35
|
* // Basic usage with stable data and polling loading (both are defaults)
|
package/src/useQuery.d.ts
CHANGED
|
@@ -23,6 +23,13 @@ export interface QueryProps<TData, TVariables extends ApolloOperationVariables =
|
|
|
23
23
|
* This hook prevents UI flickering during refetches by returning the previous data
|
|
24
24
|
* when new data is loading, unless stableData is set to false.
|
|
25
25
|
*
|
|
26
|
+
* ### When to use
|
|
27
|
+
* Use `useQuery` for any GraphQL query that should execute on mount and render data.
|
|
28
|
+
*
|
|
29
|
+
* ### When not to use
|
|
30
|
+
* - When the query should fire on a user action — use `useLazyQuery`.
|
|
31
|
+
* - For Relay-style cursor-paginated lists — use `usePaginationQuery`.
|
|
32
|
+
*
|
|
26
33
|
* @example
|
|
27
34
|
* ```tsx
|
|
28
35
|
* // Basic usage with stable data and polling loading (both are defaults)
|