@zenstackhq/tanstack-query 3.0.0-beta.21 → 3.0.0-beta.23

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/src/react.ts CHANGED
@@ -31,13 +31,13 @@ import type {
31
31
  CreateManyArgs,
32
32
  DeleteArgs,
33
33
  DeleteManyArgs,
34
- FindArgs,
34
+ FindFirstArgs,
35
+ FindManyArgs,
35
36
  FindUniqueArgs,
36
37
  GroupByArgs,
37
38
  GroupByResult,
38
- ModelResult,
39
- SelectIncludeOmit,
40
39
  SelectSubset,
40
+ SimplifiedModelResult,
41
41
  Subset,
42
42
  UpdateArgs,
43
43
  UpdateManyAndReturnArgs,
@@ -126,13 +126,13 @@ export type ModelMutationResult<T, TArgs> = UseMutationResult<T, DefaultError, T
126
126
  export type ModelMutationModelResult<
127
127
  Schema extends SchemaDef,
128
128
  Model extends GetModels<Schema>,
129
- TArgs extends SelectIncludeOmit<Schema, Model, boolean>,
129
+ TArgs,
130
130
  Array extends boolean = false,
131
- > = Omit<ModelMutationResult<ModelResult<Schema, Model, TArgs>, TArgs>, 'mutateAsync'> & {
131
+ > = Omit<ModelMutationResult<SimplifiedModelResult<Schema, Model, TArgs, false, Array>, TArgs>, 'mutateAsync'> & {
132
132
  mutateAsync<T extends TArgs>(
133
133
  args: T,
134
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
135
- ): Promise<Array extends true ? ModelResult<Schema, Model, T>[] : ModelResult<Schema, Model, T>>;
134
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T, false, Array>, T>,
135
+ ): Promise<SimplifiedModelResult<Schema, Model, T, false, Array>>;
136
136
  };
137
137
 
138
138
  export type ClientHooks<Schema extends SchemaDef> = {
@@ -147,46 +147,46 @@ export type ModelQueryHooks<Schema extends SchemaDef, Model extends GetModels<Sc
147
147
  {
148
148
  useFindUnique<T extends FindUniqueArgs<Schema, Model>>(
149
149
  args: SelectSubset<T, FindUniqueArgs<Schema, Model>>,
150
- options?: ModelQueryOptions<ModelResult<Schema, Model, T> | null>,
151
- ): ModelQueryResult<ModelResult<Schema, Model, T> | null>;
150
+ options?: ModelQueryOptions<SimplifiedModelResult<Schema, Model, T> | null>,
151
+ ): ModelQueryResult<SimplifiedModelResult<Schema, Model, T> | null>;
152
152
 
153
153
  useSuspenseFindUnique<T extends FindUniqueArgs<Schema, Model>>(
154
154
  args: SelectSubset<T, FindUniqueArgs<Schema, Model>>,
155
- options?: ModelSuspenseQueryOptions<ModelResult<Schema, Model, T> | null>,
156
- ): ModelSuspenseQueryResult<ModelResult<Schema, Model, T> | null>;
157
-
158
- useFindFirst<T extends FindArgs<Schema, Model, false>>(
159
- args?: SelectSubset<T, FindArgs<Schema, Model, false>>,
160
- options?: ModelQueryOptions<ModelResult<Schema, Model, T> | null>,
161
- ): ModelQueryResult<ModelResult<Schema, Model, T> | null>;
162
-
163
- useSuspenseFindFirst<T extends FindArgs<Schema, Model, false>>(
164
- args?: SelectSubset<T, FindArgs<Schema, Model, false>>,
165
- options?: ModelSuspenseQueryOptions<ModelResult<Schema, Model, T> | null>,
166
- ): ModelSuspenseQueryResult<ModelResult<Schema, Model, T> | null>;
167
-
168
- useFindMany<T extends FindArgs<Schema, Model, true>>(
169
- args?: SelectSubset<T, FindArgs<Schema, Model, true>>,
170
- options?: ModelQueryOptions<ModelResult<Schema, Model, T>[]>,
171
- ): ModelQueryResult<ModelResult<Schema, Model, T>[]>;
172
-
173
- useSuspenseFindMany<T extends FindArgs<Schema, Model, true>>(
174
- args?: SelectSubset<T, FindArgs<Schema, Model, true>>,
175
- options?: ModelSuspenseQueryOptions<ModelResult<Schema, Model, T>[]>,
176
- ): ModelSuspenseQueryResult<ModelResult<Schema, Model, T>[]>;
177
-
178
- useInfiniteFindMany<T extends FindArgs<Schema, Model, true>>(
179
- args?: SelectSubset<T, FindArgs<Schema, Model, true>>,
180
- options?: ModelInfiniteQueryOptions<ModelResult<Schema, Model, T>[]>,
181
- ): ModelInfiniteQueryResult<InfiniteData<ModelResult<Schema, Model, T>[]>>;
182
-
183
- useSuspenseInfiniteFindMany<T extends FindArgs<Schema, Model, true>>(
184
- args?: SelectSubset<T, FindArgs<Schema, Model, true>>,
185
- options?: ModelSuspenseInfiniteQueryOptions<ModelResult<Schema, Model, T>[]>,
186
- ): ModelSuspenseInfiniteQueryResult<InfiniteData<ModelResult<Schema, Model, T>[]>>;
155
+ options?: ModelSuspenseQueryOptions<SimplifiedModelResult<Schema, Model, T> | null>,
156
+ ): ModelSuspenseQueryResult<SimplifiedModelResult<Schema, Model, T> | null>;
157
+
158
+ useFindFirst<T extends FindFirstArgs<Schema, Model>>(
159
+ args?: SelectSubset<T, FindFirstArgs<Schema, Model>>,
160
+ options?: ModelQueryOptions<SimplifiedModelResult<Schema, Model, T> | null>,
161
+ ): ModelQueryResult<SimplifiedModelResult<Schema, Model, T> | null>;
162
+
163
+ useSuspenseFindFirst<T extends FindFirstArgs<Schema, Model>>(
164
+ args?: SelectSubset<T, FindFirstArgs<Schema, Model>>,
165
+ options?: ModelSuspenseQueryOptions<SimplifiedModelResult<Schema, Model, T> | null>,
166
+ ): ModelSuspenseQueryResult<SimplifiedModelResult<Schema, Model, T> | null>;
167
+
168
+ useFindMany<T extends FindManyArgs<Schema, Model>>(
169
+ args?: SelectSubset<T, FindManyArgs<Schema, Model>>,
170
+ options?: ModelQueryOptions<SimplifiedModelResult<Schema, Model, T>[]>,
171
+ ): ModelQueryResult<SimplifiedModelResult<Schema, Model, T>[]>;
172
+
173
+ useSuspenseFindMany<T extends FindManyArgs<Schema, Model>>(
174
+ args?: SelectSubset<T, FindManyArgs<Schema, Model>>,
175
+ options?: ModelSuspenseQueryOptions<SimplifiedModelResult<Schema, Model, T>[]>,
176
+ ): ModelSuspenseQueryResult<SimplifiedModelResult<Schema, Model, T>[]>;
177
+
178
+ useInfiniteFindMany<T extends FindManyArgs<Schema, Model>>(
179
+ args?: SelectSubset<T, FindManyArgs<Schema, Model>>,
180
+ options?: ModelInfiniteQueryOptions<SimplifiedModelResult<Schema, Model, T>[]>,
181
+ ): ModelInfiniteQueryResult<InfiniteData<SimplifiedModelResult<Schema, Model, T>[]>>;
182
+
183
+ useSuspenseInfiniteFindMany<T extends FindManyArgs<Schema, Model>>(
184
+ args?: SelectSubset<T, FindManyArgs<Schema, Model>>,
185
+ options?: ModelSuspenseInfiniteQueryOptions<SimplifiedModelResult<Schema, Model, T>[]>,
186
+ ): ModelSuspenseInfiniteQueryResult<InfiniteData<SimplifiedModelResult<Schema, Model, T>[]>>;
187
187
 
188
188
  useCreate<T extends CreateArgs<Schema, Model>>(
189
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
189
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>, T>,
190
190
  ): ModelMutationModelResult<Schema, Model, T>;
191
191
 
192
192
  useCreateMany<T extends CreateManyArgs<Schema, Model>>(
@@ -194,11 +194,11 @@ export type ModelQueryHooks<Schema extends SchemaDef, Model extends GetModels<Sc
194
194
  ): ModelMutationResult<BatchResult, T>;
195
195
 
196
196
  useCreateManyAndReturn<T extends CreateManyAndReturnArgs<Schema, Model>>(
197
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>[], T>,
197
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>[], T>,
198
198
  ): ModelMutationModelResult<Schema, Model, T, true>;
199
199
 
200
200
  useUpdate<T extends UpdateArgs<Schema, Model>>(
201
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
201
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>, T>,
202
202
  ): ModelMutationModelResult<Schema, Model, T>;
203
203
 
204
204
  useUpdateMany<T extends UpdateManyArgs<Schema, Model>>(
@@ -206,15 +206,15 @@ export type ModelQueryHooks<Schema extends SchemaDef, Model extends GetModels<Sc
206
206
  ): ModelMutationResult<BatchResult, T>;
207
207
 
208
208
  useUpdateManyAndReturn<T extends UpdateManyAndReturnArgs<Schema, Model>>(
209
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>[], T>,
209
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>[], T>,
210
210
  ): ModelMutationModelResult<Schema, Model, T, true>;
211
211
 
212
212
  useUpsert<T extends UpsertArgs<Schema, Model>>(
213
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
213
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>, T>,
214
214
  ): ModelMutationModelResult<Schema, Model, T>;
215
215
 
216
216
  useDelete<T extends DeleteArgs<Schema, Model>>(
217
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
217
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>, T>,
218
218
  ): ModelMutationModelResult<Schema, Model, T>;
219
219
 
220
220
  useDeleteMany<T extends DeleteManyArgs<Schema, Model>>(
package/src/svelte.ts CHANGED
@@ -27,13 +27,13 @@ import type {
27
27
  CreateManyArgs,
28
28
  DeleteArgs,
29
29
  DeleteManyArgs,
30
- FindArgs,
30
+ FindFirstArgs,
31
+ FindManyArgs,
31
32
  FindUniqueArgs,
32
33
  GroupByArgs,
33
34
  GroupByResult,
34
- ModelResult,
35
- SelectIncludeOmit,
36
35
  SelectSubset,
36
+ SimplifiedModelResult,
37
37
  Subset,
38
38
  UpdateArgs,
39
39
  UpdateManyAndReturnArgs,
@@ -114,14 +114,17 @@ export type ModelMutationResult<T, TArgs> = CreateMutationResult<T, DefaultError
114
114
  export type ModelMutationModelResult<
115
115
  Schema extends SchemaDef,
116
116
  Model extends GetModels<Schema>,
117
- TArgs extends SelectIncludeOmit<Schema, Model, boolean>,
117
+ TArgs,
118
118
  Array extends boolean = false,
119
119
  > = Readable<
120
- Omit<UnwrapStore<ModelMutationResult<ModelResult<Schema, Model, TArgs>, TArgs>>, 'mutateAsync'> & {
120
+ Omit<
121
+ UnwrapStore<ModelMutationResult<SimplifiedModelResult<Schema, Model, TArgs, false, Array>, TArgs>>,
122
+ 'mutateAsync'
123
+ > & {
121
124
  mutateAsync<T extends TArgs>(
122
125
  args: T,
123
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
124
- ): Promise<Array extends true ? ModelResult<Schema, Model, T>[] : ModelResult<Schema, Model, T>>;
126
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T, false, Array>, T>,
127
+ ): Promise<SimplifiedModelResult<Schema, Model, T, false, Array>>;
125
128
  }
126
129
  >;
127
130
 
@@ -137,26 +140,26 @@ export type ModelQueryHooks<Schema extends SchemaDef, Model extends GetModels<Sc
137
140
  {
138
141
  useFindUnique<T extends FindUniqueArgs<Schema, Model>>(
139
142
  args: SelectSubset<T, FindUniqueArgs<Schema, Model>>,
140
- options?: ModelQueryOptions<ModelResult<Schema, Model, T> | null>,
141
- ): ModelQueryResult<ModelResult<Schema, Model, T> | null>;
143
+ options?: ModelQueryOptions<SimplifiedModelResult<Schema, Model, T> | null>,
144
+ ): ModelQueryResult<SimplifiedModelResult<Schema, Model, T> | null>;
142
145
 
143
- useFindFirst<T extends FindArgs<Schema, Model, false>>(
144
- args?: SelectSubset<T, FindArgs<Schema, Model, false>>,
145
- options?: ModelQueryOptions<ModelResult<Schema, Model, T> | null>,
146
- ): ModelQueryResult<ModelResult<Schema, Model, T> | null>;
146
+ useFindFirst<T extends FindFirstArgs<Schema, Model>>(
147
+ args?: SelectSubset<T, FindFirstArgs<Schema, Model>>,
148
+ options?: ModelQueryOptions<SimplifiedModelResult<Schema, Model, T> | null>,
149
+ ): ModelQueryResult<SimplifiedModelResult<Schema, Model, T> | null>;
147
150
 
148
- useFindMany<T extends FindArgs<Schema, Model, true>>(
149
- args?: SelectSubset<T, FindArgs<Schema, Model, true>>,
150
- options?: ModelQueryOptions<ModelResult<Schema, Model, T>[]>,
151
- ): ModelQueryResult<ModelResult<Schema, Model, T>[]>;
151
+ useFindMany<T extends FindManyArgs<Schema, Model>>(
152
+ args?: SelectSubset<T, FindManyArgs<Schema, Model>>,
153
+ options?: ModelQueryOptions<SimplifiedModelResult<Schema, Model, T>[]>,
154
+ ): ModelQueryResult<SimplifiedModelResult<Schema, Model, T>[]>;
152
155
 
153
- useInfiniteFindMany<T extends FindArgs<Schema, Model, true>>(
154
- args?: SelectSubset<T, FindArgs<Schema, Model, true>>,
155
- options?: ModelInfiniteQueryOptions<ModelResult<Schema, Model, T>[]>,
156
- ): ModelInfiniteQueryResult<InfiniteData<ModelResult<Schema, Model, T>[]>>;
156
+ useInfiniteFindMany<T extends FindManyArgs<Schema, Model>>(
157
+ args?: SelectSubset<T, FindManyArgs<Schema, Model>>,
158
+ options?: ModelInfiniteQueryOptions<SimplifiedModelResult<Schema, Model, T>[]>,
159
+ ): ModelInfiniteQueryResult<InfiniteData<SimplifiedModelResult<Schema, Model, T>[]>>;
157
160
 
158
161
  useCreate<T extends CreateArgs<Schema, Model>>(
159
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
162
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>, T>,
160
163
  ): ModelMutationModelResult<Schema, Model, T>;
161
164
 
162
165
  useCreateMany<T extends CreateManyArgs<Schema, Model>>(
@@ -164,11 +167,11 @@ export type ModelQueryHooks<Schema extends SchemaDef, Model extends GetModels<Sc
164
167
  ): ModelMutationResult<BatchResult, T>;
165
168
 
166
169
  useCreateManyAndReturn<T extends CreateManyAndReturnArgs<Schema, Model>>(
167
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>[], T>,
170
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>[], T>,
168
171
  ): ModelMutationModelResult<Schema, Model, T, true>;
169
172
 
170
173
  useUpdate<T extends UpdateArgs<Schema, Model>>(
171
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
174
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>, T>,
172
175
  ): ModelMutationModelResult<Schema, Model, T>;
173
176
 
174
177
  useUpdateMany<T extends UpdateManyArgs<Schema, Model>>(
@@ -176,15 +179,15 @@ export type ModelQueryHooks<Schema extends SchemaDef, Model extends GetModels<Sc
176
179
  ): ModelMutationResult<BatchResult, T>;
177
180
 
178
181
  useUpdateManyAndReturn<T extends UpdateManyAndReturnArgs<Schema, Model>>(
179
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>[], T>,
182
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>[], T>,
180
183
  ): ModelMutationModelResult<Schema, Model, T, true>;
181
184
 
182
185
  useUpsert<T extends UpsertArgs<Schema, Model>>(
183
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
186
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>, T>,
184
187
  ): ModelMutationModelResult<Schema, Model, T>;
185
188
 
186
189
  useDelete<T extends DeleteArgs<Schema, Model>>(
187
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
190
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>, T>,
188
191
  ): ModelMutationModelResult<Schema, Model, T>;
189
192
 
190
193
  useDeleteMany<T extends DeleteManyArgs<Schema, Model>>(
package/src/vue.ts CHANGED
@@ -25,13 +25,13 @@ import type {
25
25
  CreateManyArgs,
26
26
  DeleteArgs,
27
27
  DeleteManyArgs,
28
- FindArgs,
28
+ FindFirstArgs,
29
+ FindManyArgs,
29
30
  FindUniqueArgs,
30
31
  GroupByArgs,
31
32
  GroupByResult,
32
- ModelResult,
33
- SelectIncludeOmit,
34
33
  SelectSubset,
34
+ SimplifiedModelResult,
35
35
  Subset,
36
36
  UpdateArgs,
37
37
  UpdateManyAndReturnArgs,
@@ -103,13 +103,13 @@ export type ModelMutationResult<T, TArgs> = UseMutationReturnType<T, DefaultErro
103
103
  export type ModelMutationModelResult<
104
104
  Schema extends SchemaDef,
105
105
  Model extends GetModels<Schema>,
106
- TArgs extends SelectIncludeOmit<Schema, Model, boolean>,
106
+ TArgs,
107
107
  Array extends boolean = false,
108
- > = Omit<ModelMutationResult<ModelResult<Schema, Model, TArgs>, TArgs>, 'mutateAsync'> & {
108
+ > = Omit<ModelMutationResult<SimplifiedModelResult<Schema, Model, TArgs, false, Array>, TArgs>, 'mutateAsync'> & {
109
109
  mutateAsync<T extends TArgs>(
110
110
  args: T,
111
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
112
- ): Promise<Array extends true ? ModelResult<Schema, Model, T>[] : ModelResult<Schema, Model, T>>;
111
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T, false, Array>, T>,
112
+ ): Promise<SimplifiedModelResult<Schema, Model, T, false, Array>>;
113
113
  };
114
114
 
115
115
  export type ClientHooks<Schema extends SchemaDef> = {
@@ -124,26 +124,26 @@ export type ModelQueryHooks<Schema extends SchemaDef, Model extends GetModels<Sc
124
124
  {
125
125
  useFindUnique<T extends FindUniqueArgs<Schema, Model>>(
126
126
  args: SelectSubset<T, FindUniqueArgs<Schema, Model>>,
127
- options?: ModelQueryOptions<ModelResult<Schema, Model, T> | null>,
128
- ): ModelQueryResult<ModelResult<Schema, Model, T> | null>;
127
+ options?: ModelQueryOptions<SimplifiedModelResult<Schema, Model, T> | null>,
128
+ ): ModelQueryResult<SimplifiedModelResult<Schema, Model, T> | null>;
129
129
 
130
- useFindFirst<T extends FindArgs<Schema, Model, false>>(
131
- args?: SelectSubset<T, FindArgs<Schema, Model, false>>,
132
- options?: ModelQueryOptions<ModelResult<Schema, Model, T> | null>,
133
- ): ModelQueryResult<ModelResult<Schema, Model, T> | null>;
130
+ useFindFirst<T extends FindFirstArgs<Schema, Model>>(
131
+ args?: SelectSubset<T, FindFirstArgs<Schema, Model>>,
132
+ options?: ModelQueryOptions<SimplifiedModelResult<Schema, Model, T> | null>,
133
+ ): ModelQueryResult<SimplifiedModelResult<Schema, Model, T> | null>;
134
134
 
135
- useFindMany<T extends FindArgs<Schema, Model, true>>(
136
- args?: SelectSubset<T, FindArgs<Schema, Model, true>>,
137
- options?: ModelQueryOptions<ModelResult<Schema, Model, T>[]>,
138
- ): ModelQueryResult<ModelResult<Schema, Model, T>[]>;
135
+ useFindMany<T extends FindManyArgs<Schema, Model>>(
136
+ args?: SelectSubset<T, FindManyArgs<Schema, Model>>,
137
+ options?: ModelQueryOptions<SimplifiedModelResult<Schema, Model, T>[]>,
138
+ ): ModelQueryResult<SimplifiedModelResult<Schema, Model, T>[]>;
139
139
 
140
- useInfiniteFindMany<T extends FindArgs<Schema, Model, true>>(
141
- args?: SelectSubset<T, FindArgs<Schema, Model, true>>,
142
- options?: ModelInfiniteQueryOptions<ModelResult<Schema, Model, T>[]>,
143
- ): ModelInfiniteQueryResult<InfiniteData<ModelResult<Schema, Model, T>[]>>;
140
+ useInfiniteFindMany<T extends FindManyArgs<Schema, Model>>(
141
+ args?: SelectSubset<T, FindManyArgs<Schema, Model>>,
142
+ options?: ModelInfiniteQueryOptions<SimplifiedModelResult<Schema, Model, T>[]>,
143
+ ): ModelInfiniteQueryResult<InfiniteData<SimplifiedModelResult<Schema, Model, T>[]>>;
144
144
 
145
145
  useCreate<T extends CreateArgs<Schema, Model>>(
146
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
146
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>, T>,
147
147
  ): ModelMutationModelResult<Schema, Model, T>;
148
148
 
149
149
  useCreateMany<T extends CreateManyArgs<Schema, Model>>(
@@ -151,11 +151,11 @@ export type ModelQueryHooks<Schema extends SchemaDef, Model extends GetModels<Sc
151
151
  ): ModelMutationResult<BatchResult, T>;
152
152
 
153
153
  useCreateManyAndReturn<T extends CreateManyAndReturnArgs<Schema, Model>>(
154
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>[], T>,
154
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>[], T>,
155
155
  ): ModelMutationModelResult<Schema, Model, T, true>;
156
156
 
157
157
  useUpdate<T extends UpdateArgs<Schema, Model>>(
158
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
158
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>, T>,
159
159
  ): ModelMutationModelResult<Schema, Model, T>;
160
160
 
161
161
  useUpdateMany<T extends UpdateManyArgs<Schema, Model>>(
@@ -163,15 +163,15 @@ export type ModelQueryHooks<Schema extends SchemaDef, Model extends GetModels<Sc
163
163
  ): ModelMutationResult<BatchResult, T>;
164
164
 
165
165
  useUpdateManyAndReturn<T extends UpdateManyAndReturnArgs<Schema, Model>>(
166
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>[], T>,
166
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>[], T>,
167
167
  ): ModelMutationModelResult<Schema, Model, T, true>;
168
168
 
169
169
  useUpsert<T extends UpsertArgs<Schema, Model>>(
170
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
170
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>, T>,
171
171
  ): ModelMutationModelResult<Schema, Model, T>;
172
172
 
173
173
  useDelete<T extends DeleteArgs<Schema, Model>>(
174
- options?: ModelMutationOptions<ModelResult<Schema, Model, T>, T>,
174
+ options?: ModelMutationOptions<SimplifiedModelResult<Schema, Model, T>, T>,
175
175
  ): ModelMutationModelResult<Schema, Model, T>;
176
176
 
177
177
  useDeleteMany<T extends DeleteManyArgs<Schema, Model>>(
@@ -25,7 +25,7 @@ describe('React Query Test', () => {
25
25
  const Provider = QuerySettingsProvider;
26
26
  const wrapper = ({ children }: { children: React.ReactNode }) => (
27
27
  <QueryClientProvider client={queryClient}>
28
- <Provider value={{ endpoint: `${BASE_URL}/api/model`, logging: true }}>{children}</Provider>
28
+ <Provider value={{ endpoint: `${BASE_URL}/api/model` }}>{children}</Provider>
29
29
  </QueryClientProvider>
30
30
  );
31
31
  return { queryClient, wrapper };
@@ -6,7 +6,7 @@
6
6
  /* eslint-disable */
7
7
 
8
8
  import { type SchemaDef, ExpressionUtils } from "@zenstackhq/orm/schema";
9
- export const schema = {
9
+ const _schema = {
10
10
  provider: {
11
11
  type: "sqlite"
12
12
  },
@@ -169,4 +169,8 @@ export const schema = {
169
169
  authType: "User",
170
170
  plugins: {}
171
171
  } as const satisfies SchemaDef;
172
- export type SchemaType = typeof schema;
172
+ type Schema = typeof _schema & {
173
+ __brand?: "schema";
174
+ };
175
+ export const schema: Schema = _schema;
176
+ export type SchemaType = Schema;