File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
packages/graphql/lib/services Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
- import { execute , GraphQLSchema , subscribe } from 'graphql' ;
1
+ import {
2
+ execute as graphqlExecute ,
3
+ GraphQLSchema ,
4
+ subscribe as graphqlSubscribe ,
5
+ } from 'graphql' ;
2
6
import { GRAPHQL_TRANSPORT_WS_PROTOCOL , ServerOptions } from 'graphql-ws' ;
3
7
import { useServer } from 'graphql-ws/lib/use/ws' ;
4
8
import {
@@ -25,7 +29,7 @@ export type GraphQLWsSubscriptionsConfig = Partial<
25
29
export type GraphQLSubscriptionTransportWsConfig = Partial <
26
30
Pick <
27
31
SubscriptionTransportWsServerOptions ,
28
- 'onConnect' | 'onDisconnect' | 'keepAlive'
32
+ 'onConnect' | 'onDisconnect' | 'onOperation' | ' keepAlive'
29
33
>
30
34
> & {
31
35
path ?: string ;
@@ -38,6 +42,8 @@ export type SubscriptionConfig = {
38
42
39
43
export interface GqlSubscriptionServiceOptions extends SubscriptionConfig {
40
44
schema : GraphQLSchema ;
45
+ execute ?: typeof graphqlExecute ;
46
+ subscribe ?: typeof graphqlSubscribe ;
41
47
path ?: string ;
42
48
context ?: ServerOptions [ 'context' ] ;
43
49
}
@@ -70,6 +76,8 @@ export class GqlSubscriptionService {
70
76
71
77
private initialize ( ) {
72
78
const supportedProtocols = [ ] ;
79
+ const { execute = graphqlExecute , subscribe = graphqlSubscribe } =
80
+ this . options ;
73
81
74
82
if ( 'graphql-ws' in this . options ) {
75
83
const graphqlWsOptions =
You can’t perform that action at this time.
0 commit comments