diff --git a/src/GraphQL/loaders/schemaDirectives.js b/src/GraphQL/loaders/schemaDirectives.js index f354167317..bd4e0d0913 100644 --- a/src/GraphQL/loaders/schemaDirectives.js +++ b/src/GraphQL/loaders/schemaDirectives.js @@ -28,6 +28,10 @@ const load = parseGraphQLSchema => { auth, info, body: args, + parent: { + className: gqlInfo?.parentType, + ..._source, + }, }) ).response.result; } catch (e) { diff --git a/src/Routers/FunctionsRouter.js b/src/Routers/FunctionsRouter.js index d239908103..05fe3f60c7 100644 --- a/src/Routers/FunctionsRouter.js +++ b/src/Routers/FunctionsRouter.js @@ -112,8 +112,11 @@ export class FunctionsRouter extends PromiseRouter { }; } static handleCloudFunction(req) { - const functionName = req.params.functionName; - const applicationId = req.config.applicationId; + const { + params: { functionName }, + config: { applicationId }, + parent, + } = req; const theFunction = triggers.getFunction(functionName, applicationId); if (!theFunction) { @@ -122,7 +125,7 @@ export class FunctionsRouter extends PromiseRouter { let params = Object.assign({}, req.body, req.query); params = parseParams(params); const request = { - params: params, + params, master: req.auth && req.auth.isMaster, user: req.auth && req.auth.user, installationId: req.info.installationId, @@ -131,6 +134,7 @@ export class FunctionsRouter extends PromiseRouter { ip: req.config.ip, functionName, context: req.info.context, + parent, }; return new Promise(function (resolve, reject) {