This error occured first with @neo4j/graphql v4.4.6 and is still present in v5.1.0.
- Up to v4.4.5 there was no problem.
I have a mutation defined like this (abbreviated):
mutate_TopicContent_Update(
contentOid: ID!
content: String!
authorId: ID!
workProject: [WorkProjectInput]
workProjectDetails: String
isSectionHeadline: Int
firstMainHeading: String
learningCardTitle: String
updated: String
): TopicContent
@cypher(
statement: """
MATCH ( u:User { oid: $authorId } )
MATCH ( tc:TopicContent { oid: $contentOid } )
OPTIONAL MATCH ( tc ) -[r:WORK_PROJECT]-> ( wp_old )
DELETE r
FOREACH ( elem IN $workProject |
MERGE ( wp:WorkProject { oid: elem.oid, ref: elem.ref } )
MERGE (wp) -[:OWNER]-> (u)
MERGE (tc)-[:WORK_PROJECT {projectDetails: $workProjectDetails}]-> (wp) )
SET tc.content = $content, tc.isSectionHeadline = $isSectionHeadline, tc.firstMainHeading = $firstMainHeading, tc.learningCardTitle = $learningCardTitle, tc.updated = $updated
WITH tc
RETURN tc as result
"""
columnName: "result"
)
Now I call the mutation like this:
mutation Mutate_TopicContent_Update($contentOid: ID!, $content: String!, $authorId: ID!) {
mutate_TopicContent_Update(contentOid: $contentOid, content: $content, authorId: $authorId) {
oid
}
}
(There's no difference in whether I provide the optional parameter or not.)
I get an error like this:
"errors": [
{
"message": "Variable `NULLDetails` not defined (line 9, column 56 (offset: 355))\n\" MERGE (tc)-[:WORK_PROJECT {projectDetails: NULLDetails}]-> (wp) )\"\n ^",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"mutate_TopicContent_Update"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"stacktrace": [
"Neo4jError: Variable `NULLDetails` not defined (line 9, column 56 (offset: 355))",
"\" MERGE (tc)-[:WORK_PROJECT {projectDetails: NULLDetails}]-> (wp) )\"",
" ^",
"",
" at captureStacktrace (/Users/svenho/Projekte/Meteor_2022/graphql_server_neo4j_2024/node_modules/neo4j-driver-core/lib/result.js:620:17)",
" at new Result (/Users/svenho/Projekte/Meteor_2022/graphql_server_neo4j_2024/node_modules/neo4j-driver-core/lib/result.js:112:23)",
" at newCompletedResult (/Users/svenho/Projekte/Meteor_2022/graphql_server_neo4j_2024/node_modules/neo4j-driver-core/lib/transaction.js:523:12)",
" at Object.run (/Users/svenho/Projekte/Meteor_2022/graphql_server_neo4j_2024/node_modules/neo4j-driver-core/lib/transaction.js:355:20)",
" at Transaction.run (/Users/svenho/Projekte/Meteor_2022/graphql_server_neo4j_2024/node_modules/neo4j-driver-core/lib/transaction.js:181:34)",
" at ManagedTransaction.run (/Users/svenho/Projekte/Meteor_2022/graphql_server_neo4j_2024/node_modules/neo4j-driver-core/lib/transaction-managed.js:54:21)",
" at Executor.transactionRun (/Users/svenho/Projekte/Meteor_2022/graphql_server_neo4j_2024/node_modules/@neo4j/graphql/dist/classes/Executor.js:165:28)",
" at /Users/svenho/Projekte/Meteor_2022/graphql_server_neo4j_2024/node_modules/@neo4j/graphql/dist/classes/Executor.js:151:33",
" at TransactionExecutor._safeExecuteTransactionWork (/Users/svenho/Projekte/Meteor_2022/graphql_server_neo4j_2024/node_modules/neo4j-driver-core/lib/internal/transaction-executor.js:211:26)",
" at TransactionExecutor.<anonymous> (/Users/svenho/Projekte/Meteor_2022/graphql_server_neo4j_2024/node_modules/neo4j-driver-core/lib/internal/transaction-executor.js:198:46)"
]
}
}
]
It's interesting that the parameter within the error appears as NULLDetails
.
Moreover if I call the same mutation from my UI application I get an Expected parameter(s)
error where the parameter now is called something like param6Details
.
I would appreciate some help because I do not understand what's happening here and why it suddenly occurred with v4.4.6.