@@ -12,7 +12,7 @@ import type { MaybePromise } from '../utils/type-utils';
12
12
import type { QueryContext } from './query-executor' ;
13
13
14
14
/**
15
- * The result of the lifecycle interception filter.
15
+ * The result of the hooks interception filter.
16
16
*/
17
17
export type MutationInterceptionFilterResult = {
18
18
/**
@@ -36,7 +36,7 @@ export type MutationInterceptionFilterResult = {
36
36
loadAfterMutationEntity ?: boolean ;
37
37
} ;
38
38
39
- type MutationLifecycleEventArgs < Schema extends SchemaDef > = {
39
+ type MutationHooksArgs < Schema extends SchemaDef > = {
40
40
/**
41
41
* The model that is being mutated.
42
42
*/
@@ -71,12 +71,12 @@ export type PluginTransformKyselyResultArgs<Schema extends SchemaDef> = {
71
71
} ;
72
72
73
73
export type PluginBeforeEntityMutationArgs < Schema extends SchemaDef > =
74
- MutationLifecycleEventArgs < Schema > & {
74
+ MutationHooksArgs < Schema > & {
75
75
entities ?: Record < string , unknown > [ ] ;
76
76
} ;
77
77
78
78
export type PluginAfterEntityMutationArgs < Schema extends SchemaDef > =
79
- MutationLifecycleEventArgs < Schema > & {
79
+ MutationHooksArgs < Schema > & {
80
80
beforeMutationEntities ?: Record < string , unknown > [ ] ;
81
81
afterMutationEntities ?: Record < string , unknown > [ ] ;
82
82
} ;
@@ -100,20 +100,6 @@ export interface RuntimePlugin<Schema extends SchemaDef = SchemaDef> {
100
100
*/
101
101
description ?: string ;
102
102
103
- /**
104
- * Kysely query transformation. See {@link KyselyPlugin.transformQuery}.
105
- */
106
- transformKyselyQuery ?: (
107
- args : PluginTransformKyselyQueryArgs < Schema >
108
- ) => RootOperationNode ;
109
-
110
- /**
111
- * Kysely query result transformation. See {@link KyselyPlugin.transformResult}.
112
- */
113
- transformKyselyResult ?: (
114
- args : PluginTransformKyselyResultArgs < Schema >
115
- ) => Promise < QueryResult < UnknownRow > > ;
116
-
117
103
/**
118
104
* Called before an ORM query is executed.
119
105
*/
@@ -129,12 +115,26 @@ export interface RuntimePlugin<Schema extends SchemaDef = SchemaDef> {
129
115
} & PluginContext < Schema >
130
116
) => MaybePromise < void > ;
131
117
118
+ /**
119
+ * Kysely query transformation. See {@link KyselyPlugin.transformQuery}.
120
+ */
121
+ transformKyselyQuery ?: (
122
+ args : PluginTransformKyselyQueryArgs < Schema >
123
+ ) => RootOperationNode ;
124
+
125
+ /**
126
+ * Kysely query result transformation. See {@link KyselyPlugin.transformResult}.
127
+ */
128
+ transformKyselyResult ?: (
129
+ args : PluginTransformKyselyResultArgs < Schema >
130
+ ) => Promise < QueryResult < UnknownRow > > ;
131
+
132
132
/**
133
133
* This callback determines whether a mutation should be intercepted, and if so,
134
134
* what data should be loaded before and after the mutation.
135
135
*/
136
136
mutationInterceptionFilter ?: (
137
- args : MutationLifecycleEventArgs < Schema >
137
+ args : MutationHooksArgs < Schema >
138
138
) => MaybePromise < MutationInterceptionFilterResult > ;
139
139
140
140
/**
0 commit comments