@trackunit/react-graphql-hooks 1.14.25 → 1.14.26

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 CHANGED
@@ -248,13 +248,19 @@ const useSyncedRef = (value) => {
248
248
  return ref;
249
249
  };
250
250
  /**
251
- * This hook is used to fetch data from a GraphQL query and support pagination, it will help maintain the data and the pagination.
251
+ * `usePaginationQuery` fetches data from a GraphQL query with Relay-style cursor pagination.
252
+ * It manages page accumulation, loading state, and provides `pagination` controls (including `fetchNext`)
253
+ * compatible with the Table component's `pagination` prop.
252
254
  *
253
- * Data will be the combined data from all pages, if you merge in the updateQuery.
255
+ * The `updateQuery` callback merges newly fetched pages into the accumulated dataset. Use
256
+ * `unionEdgesByNodeKey` to deduplicate and merge edges across pages.
254
257
  *
255
- * It will use pagination.fetchNext to fetch next page and call updateQuery where you can merge the data together.
258
+ * ### When to use
259
+ * Use usePaginationQuery for any paginated GraphQL list — for example, loading an asset list
260
+ * or event log with infinite scroll via the Table component.
256
261
  *
257
- * lastFetchedData is used to store the last fetched data, so you can update data according to last page.
262
+ * ### When not to use
263
+ * Do not use usePaginationQuery for single-entity queries without pagination — use `useQuery` from Apollo Client directly.
258
264
  *
259
265
  * @example
260
266
  * const {
package/index.esm.js CHANGED
@@ -246,13 +246,19 @@ const useSyncedRef = (value) => {
246
246
  return ref;
247
247
  };
248
248
  /**
249
- * This hook is used to fetch data from a GraphQL query and support pagination, it will help maintain the data and the pagination.
249
+ * `usePaginationQuery` fetches data from a GraphQL query with Relay-style cursor pagination.
250
+ * It manages page accumulation, loading state, and provides `pagination` controls (including `fetchNext`)
251
+ * compatible with the Table component's `pagination` prop.
250
252
  *
251
- * Data will be the combined data from all pages, if you merge in the updateQuery.
253
+ * The `updateQuery` callback merges newly fetched pages into the accumulated dataset. Use
254
+ * `unionEdgesByNodeKey` to deduplicate and merge edges across pages.
252
255
  *
253
- * It will use pagination.fetchNext to fetch next page and call updateQuery where you can merge the data together.
256
+ * ### When to use
257
+ * Use usePaginationQuery for any paginated GraphQL list — for example, loading an asset list
258
+ * or event log with infinite scroll via the Table component.
254
259
  *
255
- * lastFetchedData is used to store the last fetched data, so you can update data according to last page.
260
+ * ### When not to use
261
+ * Do not use usePaginationQuery for single-entity queries without pagination — use `useQuery` from Apollo Client directly.
256
262
  *
257
263
  * @example
258
264
  * const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-graphql-hooks",
3
- "version": "1.14.25",
3
+ "version": "1.14.26",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -12,7 +12,7 @@
12
12
  "@trackunit/i18n-library-translation": "1.12.28",
13
13
  "@trackunit/shared-utils": "1.13.43",
14
14
  "es-toolkit": "^1.39.10",
15
- "@trackunit/react-components": "1.17.22"
15
+ "@trackunit/react-components": "1.17.23"
16
16
  },
17
17
  "module": "./index.esm.js",
18
18
  "main": "./index.cjs.js",
@@ -36,13 +36,19 @@ export interface PaginationQueryProps<TData, TVariables extends ApolloOperationV
36
36
  skip?: boolean;
37
37
  }
38
38
  /**
39
- * This hook is used to fetch data from a GraphQL query and support pagination, it will help maintain the data and the pagination.
39
+ * `usePaginationQuery` fetches data from a GraphQL query with Relay-style cursor pagination.
40
+ * It manages page accumulation, loading state, and provides `pagination` controls (including `fetchNext`)
41
+ * compatible with the Table component's `pagination` prop.
40
42
  *
41
- * Data will be the combined data from all pages, if you merge in the updateQuery.
43
+ * The `updateQuery` callback merges newly fetched pages into the accumulated dataset. Use
44
+ * `unionEdgesByNodeKey` to deduplicate and merge edges across pages.
42
45
  *
43
- * It will use pagination.fetchNext to fetch next page and call updateQuery where you can merge the data together.
46
+ * ### When to use
47
+ * Use usePaginationQuery for any paginated GraphQL list — for example, loading an asset list
48
+ * or event log with infinite scroll via the Table component.
44
49
  *
45
- * lastFetchedData is used to store the last fetched data, so you can update data according to last page.
50
+ * ### When not to use
51
+ * Do not use usePaginationQuery for single-entity queries without pagination — use `useQuery` from Apollo Client directly.
46
52
  *
47
53
  * @example
48
54
  * const {