@izumisy-tailor/tailor-data-viewer 0.2.3 → 0.2.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@izumisy-tailor/tailor-data-viewer",
3
3
  "private": false,
4
- "version": "0.2.3",
4
+ "version": "0.2.4",
5
5
  "type": "module",
6
6
  "description": "Flexible data viewer component for Tailor Platform",
7
7
  "files": [
@@ -110,10 +110,16 @@ export interface PageInfo {
110
110
 
111
111
  /**
112
112
  * GraphQL query variables in Tailor Platform format.
113
+ *
114
+ * @typeParam TFieldName - Union of allowed field name strings (default: `string`).
115
+ * When metadata is provided to `useCollectionParams`, this
116
+ * narrows `order[].field` to match the table's field names,
117
+ * making the output directly compatible with gql-tada's
118
+ * `VariablesOf<>` types.
113
119
  */
114
- export interface QueryVariables {
120
+ export interface QueryVariables<TFieldName extends string = string> {
115
121
  query?: Record<string, unknown>;
116
- order?: { field: string; direction: "Asc" | "Desc" }[];
122
+ order?: { field: TFieldName; direction: "Asc" | "Desc" }[];
117
123
  first: number;
118
124
  after?: string | null;
119
125
  }
@@ -287,7 +293,7 @@ export interface UseCollectionParamsOptions<
287
293
  */
288
294
  export interface UseCollectionParamsReturn<TFieldName extends string = string> {
289
295
  /** Query variables in Tailor Platform format */
290
- variables: QueryVariables;
296
+ variables: QueryVariables<TFieldName>;
291
297
 
292
298
  // Filter operations
293
299
  /** Current active filters */