@drizzle-graphql-suite/query 0.8.2 → 0.8.3
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 +1 -1
- package/useEntity.d.ts +2 -2
- package/useEntityInfiniteQuery.d.ts +3 -3
- package/useEntityList.d.ts +2 -2
- package/useEntityMutation.d.ts +5 -5
- package/useEntityQuery.d.ts +2 -2
package/package.json
CHANGED
package/useEntity.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AnyEntityDefs, EntityClient,
|
|
2
|
-
export declare function useEntity<TSchema extends SchemaDescriptor, TDefs extends AnyEntityDefs, TEntityName extends string & keyof TSchema>(entityName: TEntityName):
|
|
1
|
+
import type { AnyEntityDefs, EntityClient, EntityDefsRef, SchemaDescriptor } from '@drizzle-graphql-suite/client';
|
|
2
|
+
export declare function useEntity<TSchema extends SchemaDescriptor, TDefs extends AnyEntityDefs, TEntityName extends string & keyof TSchema & keyof TDefs>(entityName: TEntityName): EntityClient<EntityDefsRef<TDefs>, TEntityName>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyEntityDefs, EntityClient, EntityDef, InferResult } from '@drizzle-graphql-suite/client';
|
|
1
|
+
import type { AnyEntityDefs, EntityClient, EntityDef, EntityDefsRef, InferResult } from '@drizzle-graphql-suite/client';
|
|
2
2
|
import { type UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
3
3
|
type EntityInfiniteParams<TEntity extends EntityDef, TSelect extends Record<string, unknown>> = {
|
|
4
4
|
select: TSelect;
|
|
@@ -20,7 +20,7 @@ type PageData<T> = {
|
|
|
20
20
|
items: T[];
|
|
21
21
|
count: number;
|
|
22
22
|
};
|
|
23
|
-
export declare function useEntityInfiniteQuery<TDefs extends AnyEntityDefs,
|
|
24
|
-
pages: PageData<InferResult<TDefs,
|
|
23
|
+
export declare function useEntityInfiniteQuery<TDefs extends AnyEntityDefs, TEntityName extends string, TSelect extends Record<string, unknown>>(entity: EntityClient<EntityDefsRef<TDefs>, TEntityName>, params: EntityInfiniteParams<TDefs[TEntityName] & EntityDef, TSelect>, options?: EntityInfiniteOptions): UseInfiniteQueryResult<{
|
|
24
|
+
pages: PageData<InferResult<TDefs, TDefs[TEntityName] & EntityDef, TSelect>>[];
|
|
25
25
|
}>;
|
|
26
26
|
export {};
|
package/useEntityList.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyEntityDefs, EntityClient, EntityDef, InferResult } from '@drizzle-graphql-suite/client';
|
|
1
|
+
import type { AnyEntityDefs, EntityClient, EntityDef, EntityDefsRef, InferResult } from '@drizzle-graphql-suite/client';
|
|
2
2
|
import { type UseQueryResult } from '@tanstack/react-query';
|
|
3
3
|
type EntityListParams<TEntity extends EntityDef, TSelect extends Record<string, unknown>> = {
|
|
4
4
|
select: TSelect;
|
|
@@ -18,5 +18,5 @@ type EntityListOptions = {
|
|
|
18
18
|
refetchOnWindowFocus?: boolean;
|
|
19
19
|
queryKey?: unknown[];
|
|
20
20
|
};
|
|
21
|
-
export declare function useEntityList<TDefs extends AnyEntityDefs,
|
|
21
|
+
export declare function useEntityList<TDefs extends AnyEntityDefs, TEntityName extends string, TSelect extends Record<string, unknown>>(entity: EntityClient<EntityDefsRef<TDefs>, TEntityName>, params: EntityListParams<TDefs[TEntityName] & EntityDef, TSelect>, options?: EntityListOptions): UseQueryResult<InferResult<TDefs, TDefs[TEntityName] & EntityDef, TSelect>[]>;
|
|
22
22
|
export {};
|
package/useEntityMutation.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyEntityDefs, EntityClient, EntityDef, InferResult } from '@drizzle-graphql-suite/client';
|
|
1
|
+
import type { AnyEntityDefs, EntityClient, EntityDef, EntityDefsRef, InferResult } from '@drizzle-graphql-suite/client';
|
|
2
2
|
import { type UseMutationResult } from '@tanstack/react-query';
|
|
3
3
|
type InsertOptions<TResult> = {
|
|
4
4
|
invalidate?: boolean;
|
|
@@ -6,8 +6,8 @@ type InsertOptions<TResult> = {
|
|
|
6
6
|
onSuccess?: (data: TResult) => void;
|
|
7
7
|
onError?: (error: Error) => void;
|
|
8
8
|
};
|
|
9
|
-
export declare function useEntityInsert<TDefs extends AnyEntityDefs,
|
|
10
|
-
values:
|
|
9
|
+
export declare function useEntityInsert<TDefs extends AnyEntityDefs, TEntityName extends string, TSelect extends Record<string, unknown>>(entity: EntityClient<EntityDefsRef<TDefs>, TEntityName>, returning?: TSelect, options?: InsertOptions<InferResult<TDefs, TDefs[TEntityName] & EntityDef, TSelect>[]>): UseMutationResult<InferResult<TDefs, TDefs[TEntityName] & EntityDef, TSelect>[], Error, {
|
|
10
|
+
values: TDefs[TEntityName] & EntityDef extends {
|
|
11
11
|
insertInput: infer I;
|
|
12
12
|
} ? I[] : never;
|
|
13
13
|
}>;
|
|
@@ -25,7 +25,7 @@ type UpdateOptions<TResult> = {
|
|
|
25
25
|
onSuccess?: (data: TResult) => void;
|
|
26
26
|
onError?: (error: Error) => void;
|
|
27
27
|
};
|
|
28
|
-
export declare function useEntityUpdate<TDefs extends AnyEntityDefs,
|
|
28
|
+
export declare function useEntityUpdate<TDefs extends AnyEntityDefs, TEntityName extends string, TSelect extends Record<string, unknown>>(entity: EntityClient<EntityDefsRef<TDefs>, TEntityName>, returning?: TSelect, options?: UpdateOptions<InferResult<TDefs, TDefs[TEntityName] & EntityDef, TSelect>[]>): UseMutationResult<InferResult<TDefs, TDefs[TEntityName] & EntityDef, TSelect>[], Error, UpdateParams<TDefs[TEntityName] & EntityDef>>;
|
|
29
29
|
type DeleteParams<TEntity extends EntityDef> = {
|
|
30
30
|
where?: TEntity extends {
|
|
31
31
|
filters: infer F;
|
|
@@ -37,5 +37,5 @@ type DeleteOptions<TResult> = {
|
|
|
37
37
|
onSuccess?: (data: TResult) => void;
|
|
38
38
|
onError?: (error: Error) => void;
|
|
39
39
|
};
|
|
40
|
-
export declare function useEntityDelete<TDefs extends AnyEntityDefs,
|
|
40
|
+
export declare function useEntityDelete<TDefs extends AnyEntityDefs, TEntityName extends string, TSelect extends Record<string, unknown>>(entity: EntityClient<EntityDefsRef<TDefs>, TEntityName>, returning?: TSelect, options?: DeleteOptions<InferResult<TDefs, TDefs[TEntityName] & EntityDef, TSelect>[]>): UseMutationResult<InferResult<TDefs, TDefs[TEntityName] & EntityDef, TSelect>[], Error, DeleteParams<TDefs[TEntityName] & EntityDef>>;
|
|
41
41
|
export {};
|
package/useEntityQuery.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyEntityDefs, EntityClient, EntityDef, InferResult } from '@drizzle-graphql-suite/client';
|
|
1
|
+
import type { AnyEntityDefs, EntityClient, EntityDef, EntityDefsRef, InferResult } from '@drizzle-graphql-suite/client';
|
|
2
2
|
import { type UseQueryResult } from '@tanstack/react-query';
|
|
3
3
|
type EntityQueryParams<TEntity extends EntityDef, TSelect extends Record<string, unknown>> = {
|
|
4
4
|
select: TSelect;
|
|
@@ -17,5 +17,5 @@ type EntityQueryOptions = {
|
|
|
17
17
|
refetchOnWindowFocus?: boolean;
|
|
18
18
|
queryKey?: unknown[];
|
|
19
19
|
};
|
|
20
|
-
export declare function useEntityQuery<TDefs extends AnyEntityDefs,
|
|
20
|
+
export declare function useEntityQuery<TDefs extends AnyEntityDefs, TEntityName extends string, TSelect extends Record<string, unknown>>(entity: EntityClient<EntityDefsRef<TDefs>, TEntityName>, params: EntityQueryParams<TDefs[TEntityName] & EntityDef, TSelect>, options?: EntityQueryOptions): UseQueryResult<InferResult<TDefs, TDefs[TEntityName] & EntityDef, TSelect> | null>;
|
|
21
21
|
export {};
|