@constructive-io/react 0.10.3 → 0.10.5
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/esm/public/hooks/index.d.ts +1 -1
- package/esm/public/hooks/index.js +1 -1
- package/esm/public/hooks/invalidation.d.ts +11 -11
- package/esm/public/hooks/invalidation.js +26 -26
- package/esm/public/hooks/mutation-keys.d.ts +22 -22
- package/esm/public/hooks/mutation-keys.js +13 -13
- package/esm/public/hooks/mutations/index.d.ts +2 -4
- package/esm/public/hooks/mutations/index.js +2 -4
- package/esm/public/hooks/mutations/useCreateMigrateFileMutation.d.ts +34 -0
- package/esm/public/hooks/mutations/{useCreateFieldModuleMutation.js → useCreateMigrateFileMutation.js} +7 -7
- package/esm/public/hooks/mutations/useCreateSqlActionMutation.d.ts +34 -0
- package/esm/public/hooks/mutations/{useCreateSqlMigrationMutation.js → useCreateSqlActionMutation.js} +7 -7
- package/esm/public/hooks/queries/index.d.ts +4 -4
- package/esm/public/hooks/queries/index.js +4 -4
- package/esm/public/hooks/queries/useMigrateFileQuery.d.ts +65 -0
- package/esm/public/hooks/queries/{useFieldModuleQuery.js → useMigrateFileQuery.js} +11 -11
- package/esm/public/hooks/queries/useMigrateFilesQuery.d.ts +69 -0
- package/esm/public/hooks/queries/{useFieldModulesQuery.js → useMigrateFilesQuery.js} +11 -11
- package/esm/public/hooks/queries/useSqlActionQuery.d.ts +65 -0
- package/esm/public/hooks/queries/{useSqlMigrationQuery.js → useSqlActionQuery.js} +11 -11
- package/esm/public/hooks/queries/useSqlActionsQuery.d.ts +69 -0
- package/esm/public/hooks/queries/{useSqlMigrationsQuery.js → useSqlActionsQuery.js} +11 -11
- package/esm/public/hooks/query-keys.d.ts +26 -26
- package/esm/public/hooks/query-keys.js +15 -15
- package/esm/public/orm/index.d.ts +4 -4
- package/esm/public/orm/index.js +4 -4
- package/esm/public/orm/input-types.d.ts +118 -247
- package/esm/public/orm/input-types.js +0 -1
- package/esm/public/orm/models/index.d.ts +2 -2
- package/esm/public/orm/models/index.js +2 -2
- package/esm/public/orm/models/migrateFile.d.ts +38 -0
- package/esm/public/orm/models/migrateFile.js +72 -0
- package/esm/public/orm/models/sqlAction.d.ts +38 -0
- package/esm/public/orm/models/{sqlMigration.js → sqlAction.js} +17 -17
- package/esm/public/schema-types.d.ts +112 -150
- package/esm/public/types.d.ts +7 -12
- package/package.json +3 -3
- package/public/hooks/index.d.ts +1 -1
- package/public/hooks/index.js +1 -1
- package/public/hooks/invalidation.d.ts +11 -11
- package/public/hooks/invalidation.js +25 -25
- package/public/hooks/mutation-keys.d.ts +22 -22
- package/public/hooks/mutation-keys.js +16 -16
- package/public/hooks/mutations/index.d.ts +2 -4
- package/public/hooks/mutations/index.js +2 -4
- package/public/hooks/mutations/useCreateMigrateFileMutation.d.ts +34 -0
- package/public/hooks/mutations/{useCreateFieldModuleMutation.js → useCreateMigrateFileMutation.js} +6 -6
- package/public/hooks/mutations/useCreateSqlActionMutation.d.ts +34 -0
- package/public/hooks/mutations/{useCreateSqlMigrationMutation.js → useCreateSqlActionMutation.js} +6 -6
- package/public/hooks/queries/index.d.ts +4 -4
- package/public/hooks/queries/index.js +4 -4
- package/public/hooks/queries/useMigrateFileQuery.d.ts +65 -0
- package/public/hooks/queries/{useFieldModuleQuery.js → useMigrateFileQuery.js} +14 -14
- package/public/hooks/queries/useMigrateFilesQuery.d.ts +69 -0
- package/public/hooks/queries/{useFieldModulesQuery.js → useMigrateFilesQuery.js} +14 -14
- package/public/hooks/queries/useSqlActionQuery.d.ts +65 -0
- package/public/hooks/queries/{useSqlMigrationQuery.js → useSqlActionQuery.js} +14 -14
- package/public/hooks/queries/useSqlActionsQuery.d.ts +69 -0
- package/public/hooks/queries/{useSqlMigrationsQuery.js → useSqlActionsQuery.js} +14 -14
- package/public/hooks/query-keys.d.ts +26 -26
- package/public/hooks/query-keys.js +18 -18
- package/public/orm/index.d.ts +4 -4
- package/public/orm/index.js +4 -4
- package/public/orm/input-types.d.ts +118 -247
- package/public/orm/input-types.js +0 -1
- package/public/orm/models/index.d.ts +2 -2
- package/public/orm/models/index.js +7 -7
- package/public/orm/models/migrateFile.d.ts +38 -0
- package/public/orm/models/{sqlMigration.js → migrateFile.js} +19 -19
- package/public/orm/models/sqlAction.d.ts +38 -0
- package/public/orm/models/sqlAction.js +76 -0
- package/public/schema-types.d.ts +112 -150
- package/public/types.d.ts +7 -12
- package/esm/public/hooks/mutations/useCreateFieldModuleMutation.d.ts +0 -34
- package/esm/public/hooks/mutations/useCreateSqlMigrationMutation.d.ts +0 -34
- package/esm/public/hooks/mutations/useDeleteFieldModuleMutation.d.ts +0 -38
- package/esm/public/hooks/mutations/useDeleteFieldModuleMutation.js +0 -36
- package/esm/public/hooks/mutations/useUpdateFieldModuleMutation.d.ts +0 -40
- package/esm/public/hooks/mutations/useUpdateFieldModuleMutation.js +0 -37
- package/esm/public/hooks/queries/useFieldModuleQuery.d.ts +0 -65
- package/esm/public/hooks/queries/useFieldModulesQuery.d.ts +0 -69
- package/esm/public/hooks/queries/useSqlMigrationQuery.d.ts +0 -65
- package/esm/public/hooks/queries/useSqlMigrationsQuery.d.ts +0 -69
- package/esm/public/orm/models/fieldModule.d.ts +0 -56
- package/esm/public/orm/models/fieldModule.js +0 -96
- package/esm/public/orm/models/sqlMigration.d.ts +0 -38
- package/public/hooks/mutations/useCreateFieldModuleMutation.d.ts +0 -34
- package/public/hooks/mutations/useCreateSqlMigrationMutation.d.ts +0 -34
- package/public/hooks/mutations/useDeleteFieldModuleMutation.d.ts +0 -38
- package/public/hooks/mutations/useDeleteFieldModuleMutation.js +0 -39
- package/public/hooks/mutations/useUpdateFieldModuleMutation.d.ts +0 -40
- package/public/hooks/mutations/useUpdateFieldModuleMutation.js +0 -40
- package/public/hooks/queries/useFieldModuleQuery.d.ts +0 -65
- package/public/hooks/queries/useFieldModulesQuery.d.ts +0 -69
- package/public/hooks/queries/useSqlMigrationQuery.d.ts +0 -65
- package/public/hooks/queries/useSqlMigrationsQuery.d.ts +0 -69
- package/public/orm/models/fieldModule.d.ts +0 -56
- package/public/orm/models/fieldModule.js +0 -100
- package/public/orm/models/sqlMigration.d.ts +0 -38
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Delete mutation hook for FieldModule
|
|
4
|
-
* @generated by @constructive-io/graphql-codegen
|
|
5
|
-
* DO NOT EDIT - changes will be overwritten
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.useDeleteFieldModuleMutation = useDeleteFieldModuleMutation;
|
|
9
|
-
const react_query_1 = require("@tanstack/react-query");
|
|
10
|
-
const client_1 = require("../client");
|
|
11
|
-
const selection_1 = require("../selection");
|
|
12
|
-
const query_keys_1 = require("../query-keys");
|
|
13
|
-
const mutation_keys_1 = require("../mutation-keys");
|
|
14
|
-
function useDeleteFieldModuleMutation(params) {
|
|
15
|
-
const args = (0, selection_1.buildSelectionArgs)(params.selection);
|
|
16
|
-
const { selection: _selection, ...mutationOptions } = params ?? {};
|
|
17
|
-
void _selection;
|
|
18
|
-
const queryClient = (0, react_query_1.useQueryClient)();
|
|
19
|
-
return (0, react_query_1.useMutation)({
|
|
20
|
-
mutationKey: mutation_keys_1.fieldModuleMutationKeys.all,
|
|
21
|
-
mutationFn: ({ id }) => (0, client_1.getClient)()
|
|
22
|
-
.fieldModule.delete({
|
|
23
|
-
where: {
|
|
24
|
-
id,
|
|
25
|
-
},
|
|
26
|
-
select: args.select,
|
|
27
|
-
})
|
|
28
|
-
.unwrap(),
|
|
29
|
-
onSuccess: (_, variables) => {
|
|
30
|
-
queryClient.removeQueries({
|
|
31
|
-
queryKey: query_keys_1.fieldModuleKeys.detail(variables.id),
|
|
32
|
-
});
|
|
33
|
-
queryClient.invalidateQueries({
|
|
34
|
-
queryKey: query_keys_1.fieldModuleKeys.lists(),
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
...mutationOptions,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Update mutation hook for FieldModule
|
|
3
|
-
* @generated by @constructive-io/graphql-codegen
|
|
4
|
-
* DO NOT EDIT - changes will be overwritten
|
|
5
|
-
*/
|
|
6
|
-
import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
|
|
7
|
-
import type { FieldModuleSelect, FieldModuleWithRelations, FieldModulePatch } from '../../orm/input-types';
|
|
8
|
-
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
-
export type { FieldModuleSelect, FieldModuleWithRelations, FieldModulePatch, } from '../../orm/input-types';
|
|
10
|
-
/**
|
|
11
|
-
* Mutation hook for updating a FieldModule
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```tsx
|
|
15
|
-
* const { mutate, isPending } = useUpdateFieldModuleMutation({
|
|
16
|
-
* selection: { fields: { id: true, name: true } },
|
|
17
|
-
* });
|
|
18
|
-
*
|
|
19
|
-
* mutate({ id: 'value-here', fieldModulePatch: { name: 'Updated' } });
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare function useUpdateFieldModuleMutation<S extends FieldModuleSelect>(params: {
|
|
23
|
-
selection: {
|
|
24
|
-
fields: S & FieldModuleSelect;
|
|
25
|
-
} & HookStrictSelect<NoInfer<S>, FieldModuleSelect>;
|
|
26
|
-
} & Omit<UseMutationOptions<{
|
|
27
|
-
updateFieldModule: {
|
|
28
|
-
fieldModule: InferSelectResult<FieldModuleWithRelations, S>;
|
|
29
|
-
};
|
|
30
|
-
}, Error, {
|
|
31
|
-
id: string;
|
|
32
|
-
fieldModulePatch: FieldModulePatch;
|
|
33
|
-
}>, 'mutationFn'>): UseMutationResult<{
|
|
34
|
-
updateFieldModule: {
|
|
35
|
-
fieldModule: InferSelectResult<FieldModuleWithRelations, S>;
|
|
36
|
-
};
|
|
37
|
-
}, Error, {
|
|
38
|
-
id: string;
|
|
39
|
-
fieldModulePatch: FieldModulePatch;
|
|
40
|
-
}>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Update mutation hook for FieldModule
|
|
4
|
-
* @generated by @constructive-io/graphql-codegen
|
|
5
|
-
* DO NOT EDIT - changes will be overwritten
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.useUpdateFieldModuleMutation = useUpdateFieldModuleMutation;
|
|
9
|
-
const react_query_1 = require("@tanstack/react-query");
|
|
10
|
-
const client_1 = require("../client");
|
|
11
|
-
const selection_1 = require("../selection");
|
|
12
|
-
const query_keys_1 = require("../query-keys");
|
|
13
|
-
const mutation_keys_1 = require("../mutation-keys");
|
|
14
|
-
function useUpdateFieldModuleMutation(params) {
|
|
15
|
-
const args = (0, selection_1.buildSelectionArgs)(params.selection);
|
|
16
|
-
const { selection: _selection, ...mutationOptions } = params ?? {};
|
|
17
|
-
void _selection;
|
|
18
|
-
const queryClient = (0, react_query_1.useQueryClient)();
|
|
19
|
-
return (0, react_query_1.useMutation)({
|
|
20
|
-
mutationKey: mutation_keys_1.fieldModuleMutationKeys.all,
|
|
21
|
-
mutationFn: ({ id, fieldModulePatch }) => (0, client_1.getClient)()
|
|
22
|
-
.fieldModule.update({
|
|
23
|
-
where: {
|
|
24
|
-
id,
|
|
25
|
-
},
|
|
26
|
-
data: fieldModulePatch,
|
|
27
|
-
select: args.select,
|
|
28
|
-
})
|
|
29
|
-
.unwrap(),
|
|
30
|
-
onSuccess: (_, variables) => {
|
|
31
|
-
queryClient.invalidateQueries({
|
|
32
|
-
queryKey: query_keys_1.fieldModuleKeys.detail(variables.id),
|
|
33
|
-
});
|
|
34
|
-
queryClient.invalidateQueries({
|
|
35
|
-
queryKey: query_keys_1.fieldModuleKeys.lists(),
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
...mutationOptions,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Single item query hook for FieldModule
|
|
3
|
-
* @generated by @constructive-io/graphql-codegen
|
|
4
|
-
* DO NOT EDIT - changes will be overwritten
|
|
5
|
-
*/
|
|
6
|
-
import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query';
|
|
7
|
-
import type { FieldModuleSelect, FieldModuleWithRelations } from '../../orm/input-types';
|
|
8
|
-
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
-
export type { FieldModuleSelect, FieldModuleWithRelations } from '../../orm/input-types';
|
|
10
|
-
/** Query key factory - re-exported from query-keys.ts */
|
|
11
|
-
export declare const fieldModuleQueryKey: (id: string | number) => readonly ["fieldmodule", "detail", string | number];
|
|
12
|
-
/**
|
|
13
|
-
* Query hook for fetching a single FieldModule
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```tsx
|
|
17
|
-
* const { data, isLoading } = useFieldModuleQuery({
|
|
18
|
-
* id: 'some-id',
|
|
19
|
-
* selection: { fields: { id: true, name: true } },
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare function useFieldModuleQuery<S extends FieldModuleSelect, TData = {
|
|
24
|
-
fieldModule: InferSelectResult<FieldModuleWithRelations, S> | null;
|
|
25
|
-
}>(params: {
|
|
26
|
-
id: string;
|
|
27
|
-
selection: {
|
|
28
|
-
fields: S;
|
|
29
|
-
} & HookStrictSelect<NoInfer<S>, FieldModuleSelect>;
|
|
30
|
-
} & Omit<UseQueryOptions<{
|
|
31
|
-
fieldModule: InferSelectResult<FieldModuleWithRelations, S> | null;
|
|
32
|
-
}, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
|
|
33
|
-
/**
|
|
34
|
-
* Fetch a single FieldModule without React hooks
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* const data = await fetchFieldModuleQuery({
|
|
39
|
-
* id: 'some-id',
|
|
40
|
-
* selection: { fields: { id: true } },
|
|
41
|
-
* });
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export declare function fetchFieldModuleQuery<S extends FieldModuleSelect>(params: {
|
|
45
|
-
id: string;
|
|
46
|
-
selection: {
|
|
47
|
-
fields: S;
|
|
48
|
-
} & HookStrictSelect<NoInfer<S>, FieldModuleSelect>;
|
|
49
|
-
}): Promise<{
|
|
50
|
-
fieldModule: InferSelectResult<FieldModuleWithRelations, S> | null;
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* Prefetch a single FieldModule for SSR or cache warming
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```ts
|
|
57
|
-
* await prefetchFieldModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } });
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
export declare function prefetchFieldModuleQuery<S extends FieldModuleSelect>(queryClient: QueryClient, params: {
|
|
61
|
-
id: string;
|
|
62
|
-
selection: {
|
|
63
|
-
fields: S;
|
|
64
|
-
} & HookStrictSelect<NoInfer<S>, FieldModuleSelect>;
|
|
65
|
-
}): Promise<void>;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* List query hook for FieldModule
|
|
3
|
-
* @generated by @constructive-io/graphql-codegen
|
|
4
|
-
* DO NOT EDIT - changes will be overwritten
|
|
5
|
-
*/
|
|
6
|
-
import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query';
|
|
7
|
-
import type { ListSelectionConfig } from '../selection';
|
|
8
|
-
import type { FieldModuleSelect, FieldModuleWithRelations, FieldModuleFilter, FieldModuleOrderBy } from '../../orm/input-types';
|
|
9
|
-
import type { InferSelectResult, ConnectionResult, HookStrictSelect } from '../../orm/select-types';
|
|
10
|
-
export type { FieldModuleSelect, FieldModuleWithRelations, FieldModuleFilter, FieldModuleOrderBy, } from '../../orm/input-types';
|
|
11
|
-
/** Query key factory - re-exported from query-keys.ts */
|
|
12
|
-
export declare const fieldModulesQueryKey: (variables?: object) => readonly ["fieldmodule", "list", object];
|
|
13
|
-
/**
|
|
14
|
-
* Query hook for fetching FieldModule list
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* const { data, isLoading } = useFieldModulesQuery({
|
|
19
|
-
* selection: {
|
|
20
|
-
* fields: { id: true, name: true },
|
|
21
|
-
* where: { name: { equalTo: "example" } },
|
|
22
|
-
* orderBy: ['CREATED_AT_DESC'],
|
|
23
|
-
* first: 10,
|
|
24
|
-
* },
|
|
25
|
-
* });
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare function useFieldModulesQuery<S extends FieldModuleSelect, TData = {
|
|
29
|
-
fieldModules: ConnectionResult<InferSelectResult<FieldModuleWithRelations, S>>;
|
|
30
|
-
}>(params: {
|
|
31
|
-
selection: {
|
|
32
|
-
fields: S;
|
|
33
|
-
} & Omit<ListSelectionConfig<S, FieldModuleFilter, FieldModuleOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, FieldModuleSelect>;
|
|
34
|
-
} & Omit<UseQueryOptions<{
|
|
35
|
-
fieldModules: ConnectionResult<InferSelectResult<FieldModuleWithRelations, S>>;
|
|
36
|
-
}, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
|
|
37
|
-
/**
|
|
38
|
-
* Fetch FieldModule list without React hooks
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```ts
|
|
42
|
-
* const data = await fetchFieldModulesQuery({
|
|
43
|
-
* selection: {
|
|
44
|
-
* fields: { id: true },
|
|
45
|
-
* first: 10,
|
|
46
|
-
* },
|
|
47
|
-
* });
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
export declare function fetchFieldModulesQuery<S extends FieldModuleSelect>(params: {
|
|
51
|
-
selection: {
|
|
52
|
-
fields: S;
|
|
53
|
-
} & Omit<ListSelectionConfig<S, FieldModuleFilter, FieldModuleOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, FieldModuleSelect>;
|
|
54
|
-
}): Promise<{
|
|
55
|
-
fieldModules: ConnectionResult<InferSelectResult<FieldModuleWithRelations, S>>;
|
|
56
|
-
}>;
|
|
57
|
-
/**
|
|
58
|
-
* Prefetch FieldModule list for SSR or cache warming
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* await prefetchFieldModulesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } });
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
export declare function prefetchFieldModulesQuery<S extends FieldModuleSelect>(queryClient: QueryClient, params: {
|
|
66
|
-
selection: {
|
|
67
|
-
fields: S;
|
|
68
|
-
} & Omit<ListSelectionConfig<S, FieldModuleFilter, FieldModuleOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, FieldModuleSelect>;
|
|
69
|
-
}): Promise<void>;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Single item query hook for SqlMigration
|
|
3
|
-
* @generated by @constructive-io/graphql-codegen
|
|
4
|
-
* DO NOT EDIT - changes will be overwritten
|
|
5
|
-
*/
|
|
6
|
-
import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query';
|
|
7
|
-
import type { SqlMigrationSelect, SqlMigrationWithRelations } from '../../orm/input-types';
|
|
8
|
-
import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
|
|
9
|
-
export type { SqlMigrationSelect, SqlMigrationWithRelations } from '../../orm/input-types';
|
|
10
|
-
/** Query key factory - re-exported from query-keys.ts */
|
|
11
|
-
export declare const sqlMigrationQueryKey: (id: string | number) => readonly ["sqlmigration", "detail", string | number];
|
|
12
|
-
/**
|
|
13
|
-
* Query hook for fetching a single SqlMigration
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```tsx
|
|
17
|
-
* const { data, isLoading } = useSqlMigrationQuery({
|
|
18
|
-
* id: 'some-id',
|
|
19
|
-
* selection: { fields: { id: true, name: true } },
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare function useSqlMigrationQuery<S extends SqlMigrationSelect, TData = {
|
|
24
|
-
sqlMigration: InferSelectResult<SqlMigrationWithRelations, S> | null;
|
|
25
|
-
}>(params: {
|
|
26
|
-
id: number;
|
|
27
|
-
selection: {
|
|
28
|
-
fields: S;
|
|
29
|
-
} & HookStrictSelect<NoInfer<S>, SqlMigrationSelect>;
|
|
30
|
-
} & Omit<UseQueryOptions<{
|
|
31
|
-
sqlMigration: InferSelectResult<SqlMigrationWithRelations, S> | null;
|
|
32
|
-
}, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
|
|
33
|
-
/**
|
|
34
|
-
* Fetch a single SqlMigration without React hooks
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* const data = await fetchSqlMigrationQuery({
|
|
39
|
-
* id: 'some-id',
|
|
40
|
-
* selection: { fields: { id: true } },
|
|
41
|
-
* });
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export declare function fetchSqlMigrationQuery<S extends SqlMigrationSelect>(params: {
|
|
45
|
-
id: number;
|
|
46
|
-
selection: {
|
|
47
|
-
fields: S;
|
|
48
|
-
} & HookStrictSelect<NoInfer<S>, SqlMigrationSelect>;
|
|
49
|
-
}): Promise<{
|
|
50
|
-
sqlMigration: InferSelectResult<SqlMigrationWithRelations, S> | null;
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* Prefetch a single SqlMigration for SSR or cache warming
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```ts
|
|
57
|
-
* await prefetchSqlMigrationQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } });
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
export declare function prefetchSqlMigrationQuery<S extends SqlMigrationSelect>(queryClient: QueryClient, params: {
|
|
61
|
-
id: number;
|
|
62
|
-
selection: {
|
|
63
|
-
fields: S;
|
|
64
|
-
} & HookStrictSelect<NoInfer<S>, SqlMigrationSelect>;
|
|
65
|
-
}): Promise<void>;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* List query hook for SqlMigration
|
|
3
|
-
* @generated by @constructive-io/graphql-codegen
|
|
4
|
-
* DO NOT EDIT - changes will be overwritten
|
|
5
|
-
*/
|
|
6
|
-
import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query';
|
|
7
|
-
import type { ListSelectionConfig } from '../selection';
|
|
8
|
-
import type { SqlMigrationSelect, SqlMigrationWithRelations, SqlMigrationFilter, SqlMigrationOrderBy } from '../../orm/input-types';
|
|
9
|
-
import type { InferSelectResult, ConnectionResult, HookStrictSelect } from '../../orm/select-types';
|
|
10
|
-
export type { SqlMigrationSelect, SqlMigrationWithRelations, SqlMigrationFilter, SqlMigrationOrderBy, } from '../../orm/input-types';
|
|
11
|
-
/** Query key factory - re-exported from query-keys.ts */
|
|
12
|
-
export declare const sqlMigrationsQueryKey: (variables?: object) => readonly ["sqlmigration", "list", object];
|
|
13
|
-
/**
|
|
14
|
-
* Query hook for fetching SqlMigration list
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* const { data, isLoading } = useSqlMigrationsQuery({
|
|
19
|
-
* selection: {
|
|
20
|
-
* fields: { id: true, name: true },
|
|
21
|
-
* where: { name: { equalTo: "example" } },
|
|
22
|
-
* orderBy: ['CREATED_AT_DESC'],
|
|
23
|
-
* first: 10,
|
|
24
|
-
* },
|
|
25
|
-
* });
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare function useSqlMigrationsQuery<S extends SqlMigrationSelect, TData = {
|
|
29
|
-
sqlMigrations: ConnectionResult<InferSelectResult<SqlMigrationWithRelations, S>>;
|
|
30
|
-
}>(params: {
|
|
31
|
-
selection: {
|
|
32
|
-
fields: S;
|
|
33
|
-
} & Omit<ListSelectionConfig<S, SqlMigrationFilter, SqlMigrationOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, SqlMigrationSelect>;
|
|
34
|
-
} & Omit<UseQueryOptions<{
|
|
35
|
-
sqlMigrations: ConnectionResult<InferSelectResult<SqlMigrationWithRelations, S>>;
|
|
36
|
-
}, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
|
|
37
|
-
/**
|
|
38
|
-
* Fetch SqlMigration list without React hooks
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```ts
|
|
42
|
-
* const data = await fetchSqlMigrationsQuery({
|
|
43
|
-
* selection: {
|
|
44
|
-
* fields: { id: true },
|
|
45
|
-
* first: 10,
|
|
46
|
-
* },
|
|
47
|
-
* });
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
export declare function fetchSqlMigrationsQuery<S extends SqlMigrationSelect>(params: {
|
|
51
|
-
selection: {
|
|
52
|
-
fields: S;
|
|
53
|
-
} & Omit<ListSelectionConfig<S, SqlMigrationFilter, SqlMigrationOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, SqlMigrationSelect>;
|
|
54
|
-
}): Promise<{
|
|
55
|
-
sqlMigrations: ConnectionResult<InferSelectResult<SqlMigrationWithRelations, S>>;
|
|
56
|
-
}>;
|
|
57
|
-
/**
|
|
58
|
-
* Prefetch SqlMigration list for SSR or cache warming
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* await prefetchSqlMigrationsQuery(queryClient, { selection: { fields: { id: true }, first: 10 } });
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
export declare function prefetchSqlMigrationsQuery<S extends SqlMigrationSelect>(queryClient: QueryClient, params: {
|
|
66
|
-
selection: {
|
|
67
|
-
fields: S;
|
|
68
|
-
} & Omit<ListSelectionConfig<S, SqlMigrationFilter, SqlMigrationOrderBy>, 'fields'> & HookStrictSelect<NoInfer<S>, SqlMigrationSelect>;
|
|
69
|
-
}): Promise<void>;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FieldModule model for ORM client
|
|
3
|
-
* @generated by @constructive-io/graphql-codegen
|
|
4
|
-
* DO NOT EDIT - changes will be overwritten
|
|
5
|
-
*/
|
|
6
|
-
import { OrmClient } from '../client';
|
|
7
|
-
import { QueryBuilder } from '../query-builder';
|
|
8
|
-
import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from '../select-types';
|
|
9
|
-
import type { FieldModuleWithRelations, FieldModuleSelect, FieldModuleFilter, FieldModuleOrderBy, CreateFieldModuleInput, FieldModulePatch } from '../input-types';
|
|
10
|
-
export declare class FieldModuleModel {
|
|
11
|
-
private client;
|
|
12
|
-
constructor(client: OrmClient);
|
|
13
|
-
findMany<S extends FieldModuleSelect>(args: FindManyArgs<S, FieldModuleFilter, never, FieldModuleOrderBy> & {
|
|
14
|
-
select: S;
|
|
15
|
-
} & StrictSelect<S, FieldModuleSelect>): QueryBuilder<{
|
|
16
|
-
fieldModules: ConnectionResult<InferSelectResult<FieldModuleWithRelations, S>>;
|
|
17
|
-
}>;
|
|
18
|
-
findFirst<S extends FieldModuleSelect>(args: FindFirstArgs<S, FieldModuleFilter> & {
|
|
19
|
-
select: S;
|
|
20
|
-
} & StrictSelect<S, FieldModuleSelect>): QueryBuilder<{
|
|
21
|
-
fieldModules: {
|
|
22
|
-
nodes: InferSelectResult<FieldModuleWithRelations, S>[];
|
|
23
|
-
};
|
|
24
|
-
}>;
|
|
25
|
-
findOne<S extends FieldModuleSelect>(args: {
|
|
26
|
-
id: string;
|
|
27
|
-
select: S;
|
|
28
|
-
} & StrictSelect<S, FieldModuleSelect>): QueryBuilder<{
|
|
29
|
-
fieldModule: InferSelectResult<FieldModuleWithRelations, S> | null;
|
|
30
|
-
}>;
|
|
31
|
-
create<S extends FieldModuleSelect>(args: CreateArgs<S, CreateFieldModuleInput['fieldModule']> & {
|
|
32
|
-
select: S;
|
|
33
|
-
} & StrictSelect<S, FieldModuleSelect>): QueryBuilder<{
|
|
34
|
-
createFieldModule: {
|
|
35
|
-
fieldModule: InferSelectResult<FieldModuleWithRelations, S>;
|
|
36
|
-
};
|
|
37
|
-
}>;
|
|
38
|
-
update<S extends FieldModuleSelect>(args: UpdateArgs<S, {
|
|
39
|
-
id: string;
|
|
40
|
-
}, FieldModulePatch> & {
|
|
41
|
-
select: S;
|
|
42
|
-
} & StrictSelect<S, FieldModuleSelect>): QueryBuilder<{
|
|
43
|
-
updateFieldModule: {
|
|
44
|
-
fieldModule: InferSelectResult<FieldModuleWithRelations, S>;
|
|
45
|
-
};
|
|
46
|
-
}>;
|
|
47
|
-
delete<S extends FieldModuleSelect>(args: DeleteArgs<{
|
|
48
|
-
id: string;
|
|
49
|
-
}, S> & {
|
|
50
|
-
select: S;
|
|
51
|
-
} & StrictSelect<S, FieldModuleSelect>): QueryBuilder<{
|
|
52
|
-
deleteFieldModule: {
|
|
53
|
-
fieldModule: InferSelectResult<FieldModuleWithRelations, S>;
|
|
54
|
-
};
|
|
55
|
-
}>;
|
|
56
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FieldModuleModel = void 0;
|
|
4
|
-
const query_builder_1 = require("../query-builder");
|
|
5
|
-
const input_types_1 = require("../input-types");
|
|
6
|
-
class FieldModuleModel {
|
|
7
|
-
client;
|
|
8
|
-
constructor(client) {
|
|
9
|
-
this.client = client;
|
|
10
|
-
}
|
|
11
|
-
findMany(args) {
|
|
12
|
-
const { document, variables } = (0, query_builder_1.buildFindManyDocument)('FieldModule', 'fieldModules', args.select, {
|
|
13
|
-
where: args?.where,
|
|
14
|
-
orderBy: args?.orderBy,
|
|
15
|
-
first: args?.first,
|
|
16
|
-
last: args?.last,
|
|
17
|
-
after: args?.after,
|
|
18
|
-
before: args?.before,
|
|
19
|
-
offset: args?.offset,
|
|
20
|
-
}, 'FieldModuleFilter', 'FieldModuleOrderBy', input_types_1.connectionFieldsMap);
|
|
21
|
-
return new query_builder_1.QueryBuilder({
|
|
22
|
-
client: this.client,
|
|
23
|
-
operation: 'query',
|
|
24
|
-
operationName: 'FieldModule',
|
|
25
|
-
fieldName: 'fieldModules',
|
|
26
|
-
document,
|
|
27
|
-
variables,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
findFirst(args) {
|
|
31
|
-
const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('FieldModule', 'fieldModules', args.select, {
|
|
32
|
-
where: args?.where,
|
|
33
|
-
}, 'FieldModuleFilter', input_types_1.connectionFieldsMap);
|
|
34
|
-
return new query_builder_1.QueryBuilder({
|
|
35
|
-
client: this.client,
|
|
36
|
-
operation: 'query',
|
|
37
|
-
operationName: 'FieldModule',
|
|
38
|
-
fieldName: 'fieldModules',
|
|
39
|
-
document,
|
|
40
|
-
variables,
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
findOne(args) {
|
|
44
|
-
const { document, variables } = (0, query_builder_1.buildFindManyDocument)('FieldModule', 'fieldModules', args.select, {
|
|
45
|
-
where: {
|
|
46
|
-
id: {
|
|
47
|
-
equalTo: args.id,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
first: 1,
|
|
51
|
-
}, 'FieldModuleFilter', 'FieldModuleOrderBy', input_types_1.connectionFieldsMap);
|
|
52
|
-
return new query_builder_1.QueryBuilder({
|
|
53
|
-
client: this.client,
|
|
54
|
-
operation: 'query',
|
|
55
|
-
operationName: 'FieldModule',
|
|
56
|
-
fieldName: 'fieldModule',
|
|
57
|
-
document,
|
|
58
|
-
variables,
|
|
59
|
-
transform: (data) => ({
|
|
60
|
-
fieldModule: data.fieldModules?.nodes?.[0] ?? null,
|
|
61
|
-
}),
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
create(args) {
|
|
65
|
-
const { document, variables } = (0, query_builder_1.buildCreateDocument)('FieldModule', 'createFieldModule', 'fieldModule', args.select, args.data, 'CreateFieldModuleInput', input_types_1.connectionFieldsMap);
|
|
66
|
-
return new query_builder_1.QueryBuilder({
|
|
67
|
-
client: this.client,
|
|
68
|
-
operation: 'mutation',
|
|
69
|
-
operationName: 'FieldModule',
|
|
70
|
-
fieldName: 'createFieldModule',
|
|
71
|
-
document,
|
|
72
|
-
variables,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
update(args) {
|
|
76
|
-
const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('FieldModule', 'updateFieldModule', 'fieldModule', args.select, args.where.id, args.data, 'UpdateFieldModuleInput', 'id', 'fieldModulePatch', input_types_1.connectionFieldsMap);
|
|
77
|
-
return new query_builder_1.QueryBuilder({
|
|
78
|
-
client: this.client,
|
|
79
|
-
operation: 'mutation',
|
|
80
|
-
operationName: 'FieldModule',
|
|
81
|
-
fieldName: 'updateFieldModule',
|
|
82
|
-
document,
|
|
83
|
-
variables,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
delete(args) {
|
|
87
|
-
const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('FieldModule', 'deleteFieldModule', 'fieldModule', {
|
|
88
|
-
id: args.where.id,
|
|
89
|
-
}, 'DeleteFieldModuleInput', args.select, input_types_1.connectionFieldsMap);
|
|
90
|
-
return new query_builder_1.QueryBuilder({
|
|
91
|
-
client: this.client,
|
|
92
|
-
operation: 'mutation',
|
|
93
|
-
operationName: 'FieldModule',
|
|
94
|
-
fieldName: 'deleteFieldModule',
|
|
95
|
-
document,
|
|
96
|
-
variables,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
exports.FieldModuleModel = FieldModuleModel;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SqlMigration model for ORM client
|
|
3
|
-
* @generated by @constructive-io/graphql-codegen
|
|
4
|
-
* DO NOT EDIT - changes will be overwritten
|
|
5
|
-
*/
|
|
6
|
-
import { OrmClient } from '../client';
|
|
7
|
-
import { QueryBuilder } from '../query-builder';
|
|
8
|
-
import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, InferSelectResult, StrictSelect } from '../select-types';
|
|
9
|
-
import type { SqlMigrationWithRelations, SqlMigrationSelect, SqlMigrationFilter, SqlMigrationOrderBy, CreateSqlMigrationInput } from '../input-types';
|
|
10
|
-
export declare class SqlMigrationModel {
|
|
11
|
-
private client;
|
|
12
|
-
constructor(client: OrmClient);
|
|
13
|
-
findMany<S extends SqlMigrationSelect>(args: FindManyArgs<S, SqlMigrationFilter, never, SqlMigrationOrderBy> & {
|
|
14
|
-
select: S;
|
|
15
|
-
} & StrictSelect<S, SqlMigrationSelect>): QueryBuilder<{
|
|
16
|
-
sqlMigrations: ConnectionResult<InferSelectResult<SqlMigrationWithRelations, S>>;
|
|
17
|
-
}>;
|
|
18
|
-
findFirst<S extends SqlMigrationSelect>(args: FindFirstArgs<S, SqlMigrationFilter> & {
|
|
19
|
-
select: S;
|
|
20
|
-
} & StrictSelect<S, SqlMigrationSelect>): QueryBuilder<{
|
|
21
|
-
sqlMigrations: {
|
|
22
|
-
nodes: InferSelectResult<SqlMigrationWithRelations, S>[];
|
|
23
|
-
};
|
|
24
|
-
}>;
|
|
25
|
-
findOne<S extends SqlMigrationSelect>(args: {
|
|
26
|
-
id: number;
|
|
27
|
-
select: S;
|
|
28
|
-
} & StrictSelect<S, SqlMigrationSelect>): QueryBuilder<{
|
|
29
|
-
sqlMigration: InferSelectResult<SqlMigrationWithRelations, S> | null;
|
|
30
|
-
}>;
|
|
31
|
-
create<S extends SqlMigrationSelect>(args: CreateArgs<S, CreateSqlMigrationInput['sqlMigration']> & {
|
|
32
|
-
select: S;
|
|
33
|
-
} & StrictSelect<S, SqlMigrationSelect>): QueryBuilder<{
|
|
34
|
-
createSqlMigration: {
|
|
35
|
-
sqlMigration: InferSelectResult<SqlMigrationWithRelations, S>;
|
|
36
|
-
};
|
|
37
|
-
}>;
|
|
38
|
-
}
|