89
89
90
90
### onOperation
91
91
92
- • ` Optional ` ** onOperation** : (` req ` : [ ` Request ` ] ( Request.md ) <` RawRequest ` \> , ` args ` : ` ExecutionArgs ` , ` result ` : ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\> ) => ` void ` \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\> \| ` Promise ` < ` void ` \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\>\>
92
+ • ` Optional ` ** onOperation** : (` req ` : [ ` Request ` ] ( Request.md ) <` RawRequest ` \> , ` args ` : ` ExecutionArgs ` , ` result ` : ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\> ) => ` void ` \| ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\> \| [ ` Response ` ] ( ../README.md#response ) \| ` Promise ` < ` void ` \| ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\> \| [ ` Response ` ] ( ../README.md#response ) \>
93
93
94
94
#### Type declaration
95
95
96
- ▸ (` req ` , ` args ` , ` result ` ): ` void ` \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\> \| ` Promise ` < ` void ` \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\>\>
96
+ ▸ (` req ` , ` args ` , ` result ` ): ` void ` \| ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\> \| [ ` Response ` ] ( ../README.md#response ) \| ` Promise ` < ` void ` \| ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\> \| [ ` Response ` ] ( ../README.md#response ) \>
97
97
98
98
Executed after the operation call resolves.
99
99
@@ -117,21 +117,25 @@ further execution.
117
117
118
118
##### Returns
119
119
120
- ` void ` \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\> \| ` Promise ` < ` void ` \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\>\>
120
+ ` void ` \| ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\> \| [ ` Response ` ] ( ../README.md#response ) \| ` Promise ` < ` void ` \| ` ExecutionResult ` <` ObjMap ` <` unknown ` \> , ` ObjMap ` <` unknown ` \>\> \| [ ` Response ` ] ( ../README.md#response ) \>
121
121
122
122
___
123
123
124
124
### onSubscribe
125
125
126
- • ` Optional ` ** onSubscribe** : (` req ` : [ ` Request ` ] ( Request.md ) <` RawRequest ` \> , ` params ` : [ ` RequestParams ` ] ( RequestParams.md ) ) => ` void ` \| readonly ` GraphQLError ` [ ] \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionArgs ` \| ` Promise ` <` void ` \| readonly ` GraphQLError ` [ ] \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionArgs ` \>
126
+ • ` Optional ` ** onSubscribe** : (` req ` : [ ` Request ` ] ( Request.md ) <` RawRequest ` \> , ` params ` : [ ` RequestParams ` ] ( RequestParams.md ) ) => ` void ` \| readonly ` GraphQLError ` [ ] \| ` ExecutionResult ` < ` ObjMap ` < ` unknown ` \> , ` ObjMap ` < ` unknown ` \>\> \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionArgs ` \| ` Promise ` <` void ` \| readonly ` GraphQLError ` [ ] \| ` ExecutionResult ` < ` ObjMap ` < ` unknown ` \> , ` ObjMap ` < ` unknown ` \>\> \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionArgs ` \>
127
127
128
128
#### Type declaration
129
129
130
- ▸ (` req ` , ` params ` ): ` void ` \| readonly ` GraphQLError ` [ ] \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionArgs ` \| ` Promise ` <` void ` \| readonly ` GraphQLError ` [ ] \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionArgs ` \>
130
+ ▸ (` req ` , ` params ` ): ` void ` \| readonly ` GraphQLError ` [ ] \| ` ExecutionResult ` < ` ObjMap ` < ` unknown ` \> , ` ObjMap ` < ` unknown ` \>\> \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionArgs ` \| ` Promise ` <` void ` \| readonly ` GraphQLError ` [ ] \| ` ExecutionResult ` < ` ObjMap ` < ` unknown ` \> , ` ObjMap ` < ` unknown ` \>\> \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionArgs ` \>
131
131
132
132
The subscribe callback executed right after processing the request
133
133
before proceeding with the GraphQL operation execution.
134
134
135
+ If you return ` ExecutionResult ` from the callback, it will be used
136
+ directly for responding to the request. Useful for implementing a response
137
+ cache.
138
+
135
139
If you return ` ExecutionArgs ` from the callback, it will be used instead of
136
140
trying to build one internally. In this case, you are responsible for providing
137
141
a ready set of arguments which will be directly plugged in the operation execution.
@@ -159,7 +163,7 @@ further execution.
159
163
160
164
##### Returns
161
165
162
- ` void ` \| readonly ` GraphQLError ` [ ] \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionArgs ` \| ` Promise ` <` void ` \| readonly ` GraphQLError ` [ ] \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionArgs ` \>
166
+ ` void ` \| readonly ` GraphQLError ` [ ] \| ` ExecutionResult ` < ` ObjMap ` < ` unknown ` \> , ` ObjMap ` < ` unknown ` \>\> \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionArgs ` \| ` Promise ` <` void ` \| readonly ` GraphQLError ` [ ] \| ` ExecutionResult ` < ` ObjMap ` < ` unknown ` \> , ` ObjMap ` < ` unknown ` \>\> \| [ ` Response ` ] ( ../README.md#response ) \| ` ExecutionArgs ` \>
163
167
164
168
___
165
169
0 commit comments