@@ -39,7 +39,7 @@ const makeFunction = (code: string) => {
39
39
return fn ;
40
40
}
41
41
42
- const makeDeepClient = ( token : string , secret ?: string ) => {
42
+ const makeDeepClient = ( token : string , path ?: string , ssl ?: boolean , secret ?: string ) => {
43
43
if ( ! token ) throw new Error ( 'No token provided' ) ;
44
44
const decoded = parseJwt ( token ) ;
45
45
const linkId = decoded ?. userId ;
@@ -52,9 +52,9 @@ const makeDeepClient = (token: string, secret?: string) => {
52
52
const unsafe : any = { } ;
53
53
if ( secret ) {
54
54
unsafe . hasura = new HasuraApi ( {
55
- path : DEEPLINKS_HASURA_PATH ,
56
- ssl : DEEPLINKS_HASURA_SSL ,
57
- secret : secret ,
55
+ path,
56
+ ssl,
57
+ secret,
58
58
} ) ;
59
59
}
60
60
@@ -63,9 +63,9 @@ const makeDeepClient = (token: string, secret?: string) => {
63
63
}
64
64
65
65
const execute = async ( args , options ) => {
66
- const { jwt, secret, code, data } = options ;
66
+ const { jwt, secret, code, data, path , ssl } = options ;
67
67
const fn = makeFunction ( code ) ;
68
- const deep = makeDeepClient ( jwt , secret ) ;
68
+ const deep = makeDeepClient ( jwt , path , ssl , secret ) ;
69
69
// await supports both sync and async functions the same way
70
70
const result = await fn ( ...args , { data, deep, gql, require : requireWrapper } ) ;
71
71
return result ;
0 commit comments