Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Commit

Permalink
Fix issue #502 (#503)
Browse files Browse the repository at this point in the history
* pass context through createNode use cypherParams in buildCypherSelection

* Also pass cypherParms in to buildCypherSelection when updating node
  • Loading branch information
wworrall committed Sep 7, 2020
1 parent 34125ba commit 74ace77
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1481,6 +1481,7 @@ export const translateMutation = ({
schemaType,
selections,
params,
context,
variableName,
typeName,
additionalLabels
Expand Down Expand Up @@ -1525,7 +1526,8 @@ export const translateMutation = ({
selections,
schemaType,
additionalLabels,
params
params,
context
});
}
} else if (isRemoveMutation(resolveInfo)) {
Expand Down Expand Up @@ -1652,7 +1654,8 @@ const nodeCreate = ({
schemaType,
resolveInfo,
additionalLabels,
params
params,
context
}) => {
const safeVariableName = safeVar(variableName);
const safeLabelName = safeLabel([typeName, ...additionalLabels]);
Expand All @@ -1679,7 +1682,8 @@ const nodeCreate = ({
selections,
variableName,
schemaType,
resolveInfo
resolveInfo,
cypherParams: getCypherParams(context)
});

params = { ...preparedParams, ...subParams };
Expand Down Expand Up @@ -2137,7 +2141,8 @@ const nodeMergeOrUpdate = ({
selections,
schemaType,
additionalLabels,
params
params,
context
}) => {
const safeVariableName = safeVar(variableName);
const args = getMutationArguments(resolveInfo);
Expand Down Expand Up @@ -2165,7 +2170,8 @@ const nodeMergeOrUpdate = ({
args,
params: updateParams,
paramKey: 'params',
resolveInfo
resolveInfo,
cypherParams: getCypherParams(context)
});
let cypherOperation = '';
let safeLabelName = safeLabel(typeName);
Expand All @@ -2188,7 +2194,8 @@ const nodeMergeOrUpdate = ({
selections,
variableName,
schemaType,
resolveInfo
resolveInfo,
cypherParams: getCypherParams(context)
});
if (!preparedParams.params) preparedParams.params = {};
preparedParams.params[primaryKeyArgName] = primaryKeyParam[primaryKeyArgName];
Expand Down

0 comments on commit 74ace77

Please sign in to comment.