File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const packageJson = require('../package.json');
10
10
const typeDefs = `
11
11
type Query {
12
12
version: String!
13
+ config: InterceptionConfig!
13
14
interceptors: [Interceptor!]!
14
15
}
15
16
@@ -25,6 +26,10 @@ const typeDefs = `
25
26
): Boolean!
26
27
}
27
28
29
+ type InterceptionConfig {
30
+ certificatePath: String!
31
+ }
32
+
28
33
type Interceptor {
29
34
id: ID!
30
35
version: String!
@@ -37,11 +42,17 @@ const typeDefs = `
37
42
scalar Error
38
43
`
39
44
40
- const buildResolvers = ( interceptors : _ . Dictionary < Interceptor > ) => {
45
+ const buildResolvers = (
46
+ config : HtkConfig ,
47
+ interceptors : _ . Dictionary < Interceptor >
48
+ ) => {
41
49
return {
42
50
Query : {
43
51
version : ( ) => packageJson . version ,
44
52
interceptors : ( ) => _ . values ( interceptors ) ,
53
+ config : ( ) => ( {
54
+ certificatePath : config . https . certPath
55
+ } )
45
56
} ,
46
57
47
58
Mutation : {
@@ -112,7 +123,7 @@ export class HttpToolkitServer {
112
123
113
124
this . graphql = new GraphQLServer ( {
114
125
typeDefs,
115
- resolvers : buildResolvers ( interceptors )
126
+ resolvers : buildResolvers ( config , interceptors )
116
127
} ) ;
117
128
}
118
129
You can’t perform that action at this time.
0 commit comments