Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

Neo4j-driver not generating proper cypher queries

Node Link

EDIT: solved... my database version was 3.0 and it worked when I switched it to 3.2 instead

I'm running the basic neo4j-driver example in node. In my database i'm running the example movie graph provided by the browser console.

this is what my typeDefs look like (autogenerating the resolvers):

const typeDefs = `
type Movie {
	title: String
	released: Int
	id: ID
	tagline: String

When I run the code and the graphql playground starts up, this is what I see in the schema:


When I run this query:

  Movie(title: "A Few Good Men"){

the cypher query that gets auto-generated is:

MATCH (movie:Movie {title:$title}) RETURN movie { .released } AS movie SKIP $offset
{ offset: 0, first: -1, title: 'A Few Good Men' }

and the error response i get back is:

"message": "Invalid input '.': expected whitespace, comment, a property key name, '}', an identifier or UnsignedDecimalInteger (line 1, column 51 (offset: 50))\n\"MATCH (movie:Movie {title:$title}) RETURN movie { .released } AS movie SKIP $offset\"\n 

Any ideas with what could be wrong? Thanks!

EDIT: this is what my index.js looks like:

import {v1 as neo4j } from 'neo4j-driver';
import { ApolloServer } from 'apollo-server';
import { makeAugmentedSchema } from 'neo4j-graphql-js';

const typeDefs = `
type Movie {
	title: String
	released: Int
	id: ID
	tagline: String

const schema = makeAugmentedSchema({ typeDefs });

const driver = neo4j.driver(
    neo4j.auth.basic(process.env.NEO4J_USER, process.env.NEO4J_PASS)

const server = new ApolloServer({ schema, context: { driver } });

server.listen(3003, '').then(({ url }) => {
    console.log(`GraphQL API ready at ${url}`);


Graph Fellow

OK great - I'm glad the issue was resolved by upgrading the version of Neo4j. Our GraphQL integrations use map projections, which are a relatively new Cypher feature introduced in Neo4j v3.1