Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 1: replicate users.

Error in graphql


BH trying to follow this tutorial but when I enter the exact query they say to with the exact same nodejs code I get the following error [![enter image description here](]( Essentially "expression in call return must be aliased"? Here is the graphql query I made based off of the tutorial, same exact structure:

mutation {
    input: [
        title: "Awtsmoos"
        actors: {
          create: [
              node: {
                name: "Zalman"
  ) {
    movies {
      actors {






And here is the error I get:




  "errors": [
      "message": "Expression in CALL { RETURN ... } must be aliased (use AS) (line 17, column 16 (offset: 580))\n\"        RETURN collect(NULL)\"\n                ^",
      "locations": [
          "line": 2,
          "column": 3
      "path": [
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "code": "Neo.ClientError.Statement.SyntaxError",
          "name": "Neo4jError",
          "retriable": false
  "data": null



Here is the nodejs when the credentials removed




const { gql, ApolloServer } = require("apollo-server"); 
const { Neo4jGraphQL } = require("@neo4j/graphql"); 

const neo4j = require("neo4j-driver"); 

const typeDefs = gql`
  type Movie {
    title: String!
    year: Int
    plot: String
    actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN)
  type Person {
    name: String!
    movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT)

const driver = neo4j.driver(

const neoSchema = new Neo4jGraphQL({ typeDefs, driver });

neoSchema.getSchema().then((schema) => {
    const server = new ApolloServer({
        schema: schema,
       introspection: true, 
       playground: true

    server.listen({port: process. env.PORT}).then(({ url }) => {
        console.log(`GraphQL server ready on ${url}`);


Here is my package.json ```



  "name": "hi",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start":"node index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@neo4j/graphql": "^3.12.0",
    "apollo-server": "^3.11.1",
    "graphql": "^16.6.0",
    "neo4j-driver": "^5.2.0"





I've tried multiple neo4j servers. I have only been able to run nodejs using heroku, and localhost on debian. Tried testing it with a google cloud VM instance but wasn't able to get an https server up.


Community Team
Community Team

Hello @Yaynjeel

Thank you for posting to the Community. I wanted to see if you were able to resolve this issue. If so, can you please post your solution? If you are still having trouble, please let me know!

Community Specialist

  1. B"H


I haven't fully tested anything, but I copied the code from the instructions in AuraDB for graphql, started new folder etc a few days ago and reinstalled all the dependencies, at first I got an error, then I changed a line of the built in cypher in the example that says `MATCH(this)` (for the friend count) and rewrote it without "this", and there is no more error. I tried some other examples from the original page here and there were no more errors.

I think it has to do with selecting the "context" of the database, or maybe at the time I tried this there was a mixture of versions which may have been causing problems(even the official graphql beginner documentation was full of errors at the time, even in their own website, which I see has been fixed soon after the release of version 5)

AuraDB is now running Neo4j 5 by default.

I think you either need to upgrade the neo4j/graphql dependency to the latest version. 3.12.2

or use the Neo4j 4 version on AuraDB

Nodes 2022
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online