Can't use @authorization directive. Get an apoc error every time.
I can run that APOC command on the database.
Neo4J Database version: 4.4
@neo4j/graphql version: 3.24
Type with the directive:
type User @authorization(validate: [
{ where: { node: { id: "$jwt.sub" } } }
]) {
"""
Database id
"""
id: ID! @id(unique: true)
"""
A unique identifier that represents the user in a 3rd party system
"""
identifier: String
"""
The User Name
"""
name: String!
"""
The email address of the user
"""
email: String! @unique(constraintName: "unique_email")
"""
The avatar src of the user
"""
avatarSrc: String
}
Error:
[GraphQLError: Failed to invoke function `apoc.util.validatePredicate`: Caused by: java.lang.RuntimeException: @neo4j/graphql/FORBIDDEN] {
locations: [ { line: 12, column: 3 } ],
path: [ 'users' ],
extensions: {
code: 'INTERNAL_SERVER_ERROR',
exception: {
constructor: [Function],
code: 'Neo.ClientError.Procedure.ProcedureCallFailed',
name: 'Neo4jError',
retriable: false,
stacktrace: [Array]
}
}
} [
'Neo4jError: Failed to invoke function `apoc.util.validatePredicate`: Caused by: java.lang.RuntimeException: @neo4j/graphql/FORBIDDEN',
'',
' at captureStacktrace (/Users/luisfmnicolau/GitHub/LeanLawLabs/tcn-apollo-server/node_modules/neo4j-driver/node_modules/neo4j-driver-core/lib/result.js:611:17)',
' at new Result (/Users/luisfmnicolau/GitHub/LeanLawLabs/tcn-apollo-server/node_modules/neo4j-driver/node_modules/neo4j-driver-core/lib/result.js:105:23)',
' at newCompletedResult (/Users/luisfmnicolau/GitHub/LeanLawLabs/tcn-apollo-server/node_modules/neo4j-driver/node_modules/neo4j-driver-core/lib/transaction.js:506:12)',
' at Object.run (/Users/luisfmnicolau/GitHub/LeanLawLabs/tcn-apollo-server/node_modules/neo4j-driver/node_modules/neo4j-driver-core/lib/transaction.js:338:20)',
' at TransactionPromise.Transaction.run (/Users/luisfmnicolau/GitHub/LeanLawLabs/tcn-apollo-server/node_modules/neo4j-driver/node_modules/neo4j-driver-core/lib/transaction.js:179:34)',
' at Executor.transactionRun (/Users/luisfmnicolau/GitHub/LeanLawLabs/tcn-apollo-server/node_modules/@neo4j/graphql/src/classes/Executor.ts:233:42)',
' at /Users/luisfmnicolau/GitHub/LeanLawLabs/tcn-apollo-server/node_modules/@neo4j/graphql/src/classes/Executor.ts:215:25',
' at TransactionExecutor._safeExecuteTransactionWork (/Users/luisfmnicolau/GitHub/LeanLawLabs/tcn-apollo-server/node_modules/neo4j-driver/node_modules/neo4j-driver-core/lib/internal/transaction-executor.js:141:26)',
' at TransactionExecutor.<anonymous> (/Users/luisfmnicolau/GitHub/LeanLawLabs/tcn-apollo-server/node_modules/neo4j-driver/node_modules/neo4j-driver-core/lib/internal/transaction-executor.js:128:46)',
' at step (/Users/luisfmnicolau/GitHub/LeanLawLabs/tcn-apollo-server/node_modules/neo4j-driver/node_modules/neo4j-driver-core/lib/internal/transaction-executor.js:52:23)',
' at Object.next (/Users/luisfmnicolau/GitHub/LeanLawLabs/tcn-apollo-server/node_modules/neo4j-driver/node_modules/neo4j-driver-core/lib/internal/transaction-executor.js:33:53)',
' at fulfilled (/Users/luisfmnicolau/GitHub/LeanLawLabs/tcn-apollo-server/node_modules/neo4j-driver/node_modules/neo4j-driver-core/lib/internal/transaction-executor.js:24:58)',
' at processTicksAndRejections (node:internal/process/task_queues:95:5)'