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');
1010const typeDefs = `
1111 type Query {
1212 version: String!
13+ config: InterceptionConfig!
1314 interceptors: [Interceptor!]!
1415 }
1516
@@ -25,6 +26,10 @@ const typeDefs = `
2526 ): Boolean!
2627 }
2728
29+ type InterceptionConfig {
30+ certificatePath: String!
31+ }
32+
2833 type Interceptor {
2934 id: ID!
3035 version: String!
@@ -37,11 +42,17 @@ const typeDefs = `
3742 scalar Error
3843`
3944
40- const buildResolvers = ( interceptors : _ . Dictionary < Interceptor > ) => {
45+ const buildResolvers = (
46+ config : HtkConfig ,
47+ interceptors : _ . Dictionary < Interceptor >
48+ ) => {
4149 return {
4250 Query : {
4351 version : ( ) => packageJson . version ,
4452 interceptors : ( ) => _ . values ( interceptors ) ,
53+ config : ( ) => ( {
54+ certificatePath : config . https . certPath
55+ } )
4556 } ,
4657
4758 Mutation : {
@@ -112,7 +123,7 @@ export class HttpToolkitServer {
112123
113124 this . graphql = new GraphQLServer ( {
114125 typeDefs,
115- resolvers : buildResolvers ( interceptors )
126+ resolvers : buildResolvers ( config , interceptors )
116127 } ) ;
117128 }
118129
You can’t perform that action at this time.
0 commit comments