Please keep the following things in mind:
code :
import { ApolloServer } from '@apollo/server';
import { startStandaloneServer } from '@apollo/server/standalone';
import { Neo4jGraphQL } from "@neo4j/graphql";
import neo4j from "neo4j-driver";
const typeDefs = `#graphql
type User @node {
name : String
age : Int
isManger : Boolean
doj : DateTime
}
`;
const driver = neo4j.driver(
"neo4j://localhost:7687/{dbname}",
neo4j.auth.basic("*********", "*********)
);
const neoSchema = new Neo4jGraphQL({ typeDefs, driver });
const server = new ApolloServer({
schema: await neoSchema.getSchema(),
});
const { url } = await startStandaloneServer(server, {
listen: { port: 4000 },
});
console.log(`🚀 Server ready at ${url}`);
mutation {
createUsers(
input: [{name: "siva", age: 34, isManger: false, doj: "2025-05-15T06:26:36.106Z"}]
) {
users {
name
age
isManger
doj
}
}
}
Please provide the following information if you ran into a more serious issue:
-
neo4j version, desktop version, browser version
neo4j version -
neo4j desktop version - 1.6.1
brower version - 5.26.2 -
what kind of API / driver do you use
graphql / neo4j-driver -
neo4j.log and debug.log
{
"errors": [
{
"message": "Invalid input '5': expected\n \"ALTER\"\n \"CALL\"\n \"CREATE\"\n \"DEALLOCATE\"\n \"DELETE\"\n \"DENY\"\n \"DETACH\"\n \"DROP\"\n \"DRYRUN\"\n \"ENABLE\"\n \"FOREACH\"\n \"GRANT\"\n \"LOAD\"\n \"MATCH\"\n \"MERGE\"\n \"OPTIONAL\"\n \"REALLOCATE\"\n \"REMOVE\"\n \"RENAME\"\n \"RETURN\"\n \"REVOKE\"\n \"SET\"\n \"SHOW\"\n \"START\"\n \"STOP\"\n \"TERMINATE\"\n \"UNWIND\"\n \"USE\"\n \"USING\"\n \"WITH\" (line 1, column 8 (offset: 7))\n\"CYPHER 5\"\n ^",
"locations": [
{
"line": 2,
"column": 2
}
],
"path": [
"createUsers"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"stacktrace": [
"Neo4jError: Invalid input '5': expected",
" \"ALTER\"",
" \"CALL\"",
" \"CREATE\"",
" \"DEALLOCATE\"",
" \"DELETE\"",
" \"DENY\"",
" \"DETACH\"",
" \"DROP\"",
" \"DRYRUN\"",
" \"ENABLE\"",
" \"FOREACH\"",
" \"GRANT\"",
" \"LOAD\"",
" \"MATCH\"",
" \"MERGE\"",
" \"OPTIONAL\"",
" \"REALLOCATE\"",
" \"REMOVE\"",
" \"RENAME\"",
" \"RETURN\"",
" \"REVOKE\"",
" \"SET\"",
" \"SHOW\"",
" \"START\"",
" \"STOP\"",
" \"TERMINATE\"",
" \"UNWIND\"",
" \"USE\"",
" \"USING\"",
" \"WITH\" (line 1, column 8 (offset: 7))",
"\"CYPHER 5\"",
" ^",
"",
" at captureStacktrace (/Users/sshanm224/Edith/neo4j_project/graphql_neo4j_proj/node_modules/neo4j-driver-core/lib/result.js:624:17)",
" at new Result (/Users/sshanm224/Edith/neo4j_project/graphql_neo4j_proj/node_modules/neo4j-driver-core/lib/result.js:112:23)",
" at newCompletedResult (/Users/sshanm224/Edith/neo4j_project/graphql_neo4j_proj/node_modules/neo4j-driver-core/lib/transaction.js:531:12)",
" at Object.run (/Users/sshanm224/Edith/neo4j_project/graphql_neo4j_proj/node_modules/neo4j-driver-core/lib/transaction.js:363:20)",
" at Transaction.run (/Users/sshanm224/Edith/neo4j_project/graphql_neo4j_proj/node_modules/neo4j-driver-core/lib/transaction.js:184:34)",
" at ManagedTransaction.run (/Users/sshanm224/Edith/neo4j_project/graphql_neo4j_proj/node_modules/neo4j-driver-core/lib/transaction-managed.js:54:21)",
" at Executor.transactionRun (/Users/sshanm224/Edith/neo4j_project/graphql_neo4j_proj/node_modules/@neo4j/graphql/dist/classes/Executor.js:174:28)",
" at /Users/sshanm224/Edith/neo4j_project/graphql_neo4j_proj/node_modules/@neo4j/graphql/dist/classes/Executor.js:160:33",
" at TransactionExecutor._safeExecuteTransactionWork (/Users/sshanm224/Edith/neo4j_project/graphql_neo4j_proj/node_modules/neo4j-driver-core/lib/internal/transaction-executor.js:211:26)",
" at TransactionExecutor.<anonymous> (/Users/sshanm224/Edith/neo4j_project/graphql_neo4j_proj/node_modules/neo4j-driver-core/lib/internal/transaction-executor.js:198:46)"
]
}
}
],
"data": null
}