@@ -54,15 +54,15 @@ model Foo {
54
54
import { useFindFirstpost_Item, useInfiniteFindManypost_Item, useCreatepost_Item } from './hooks';
55
55
56
56
function query() {
57
- const { data } = useFindFirstpost_Item({include: { author: true }});
57
+ const { data } = useFindFirstpost_Item({include: { author: true }}, { enabled: true, optimisticUpdate: false } );
58
58
console.log(data?.viewCount);
59
59
console.log(data?.author?.email);
60
60
}
61
61
62
62
function infiniteQuery() {
63
63
const { data, fetchNextPage, hasNextPage } = useInfiniteFindManypost_Item();
64
64
useInfiniteFindManypost_Item({ where: { published: true } });
65
- useInfiniteFindManypost_Item(undefined, { getNextPageParam: () => null });
65
+ useInfiniteFindManypost_Item(undefined, { enabled: true, getNextPageParam: () => null });
66
66
console.log(data?.pages[0][0].published);
67
67
console.log(data?.pageParams[0]);
68
68
}
@@ -143,14 +143,14 @@ ${sharedModel}
143
143
import { useFindFirstpost_Item, useInfiniteFindManypost_Item, useCreatepost_Item } from './hooks';
144
144
145
145
function query() {
146
- const { data } = useFindFirstpost_Item({include: { author: true }});
146
+ const { data } = useFindFirstpost_Item({include: { author: true }}, { enabled: true, optimisticUpdate: false } );
147
147
console.log(data.value?.viewCount);
148
148
console.log(data.value?.author?.email);
149
149
}
150
150
151
151
function infiniteQuery() {
152
152
const { data, fetchNextPage, hasNextPage } = useInfiniteFindManypost_Item();
153
- useInfiniteFindManypost_Item({ where: { published: true } });
153
+ useInfiniteFindManypost_Item({ where: { published: true } }, { enabled: true, getNextPageParam: () => null } );
154
154
useInfiniteFindManypost_Item(undefined, { getNextPageParam: () => null });
155
155
console.log(data.value?.pages[0][0].published);
156
156
console.log(data.value?.pageParams[0]);
@@ -217,15 +217,15 @@ ${sharedModel}
217
217
import { useFindFirstpost_Item, useInfiniteFindManypost_Item, useCreatepost_Item } from './hooks';
218
218
219
219
function query() {
220
- const { data } = get(useFindFirstpost_Item({include: { author: true }}));
220
+ const { data } = get(useFindFirstpost_Item({include: { author: true }}, { enabled: true, optimisticUpdate: false } ));
221
221
console.log(data?.viewCount);
222
222
console.log(data?.author?.email);
223
223
}
224
224
225
225
function infiniteQuery() {
226
226
const { data, fetchNextPage, hasNextPage } = get(useInfiniteFindManypost_Item());
227
227
useInfiniteFindManypost_Item({ where: { published: true } });
228
- useInfiniteFindManypost_Item(undefined, { getNextPageParam: () => null });
228
+ useInfiniteFindManypost_Item(undefined, { enabled: true, getNextPageParam: () => null });
229
229
console.log(data?.pages[0][0].published);
230
230
console.log(data?.pageParams[0]);
231
231
}
0 commit comments