These are chat archives for neoxygen/neo4j-neoclient

1st
Jul 2015
gic1be
@gic1be
Jul 01 2015 11:05

Hey guys,
I'd like to do the tutorial using neo4j-neoclient (https://gist.github.com/ikwattro/833feaed137de238475e).
Everything works fine until using a query and a result. If I try to add a new user by using parameters like this:

$query = 'CREATE (user:User {name: {name} }) RETURN user';
$parameters = array('name' => 'Maxime');
$client->sendCypherQuery($query);

There is an "Fatal error: Uncaught exception". I tried to find the reason and I think my version of NeoClient isn't the right one. I tried different versions, but nothing has changed.
So could you please tell me witch is the newest version? Actually I use "dev-master": "2.1-dev".

Christophe Willemsen
@ikwattro
Jul 01 2015 12:45
Hi
first, you shouldn't use dev releases of neoclient, it has stable versions since a long time
just use "neoxygen/neoclient": "^2.2" in your composer.json file
now I suppose there is something else than just Uncaught exception, what is the message of the exception ?
@gic1be
gic1be
@gic1be
Jul 01 2015 13:35

Hi,
the version is not the problem, I tried it with 2.2 .
The whole exception is the following message:

Fatal error: Uncaught exception 'Neoxygen\NeoClient\Exception\Neo4jException' with message 'Neo4j Exception with code "Neo.ClientError.Statement.ParameterMissing" and message "Expected a parameter named name"' in C:...\NeoSocial\src\Extension\AbstractExtension.php:89
Stack trace:

#0 C:...\NeoSocial\src\Extension\AbstractExtension.php(76): Neoxygen\NeoClient\Extension\AbstractExtension->checkResponseErrors(Arr

ay)

#1 C:...\NeoSocial\src\Extension\NeoClientCoreExtension.php(94): Neoxygen\NeoClient\Extension\AbstractExtension->handleHttpResponse

(Object(Neoxygen\NeoClient\Request\Response))

#2 [internal function]: Neoxygen\NeoClient\Extension\NeoClientCoreExtension->sendCypherQuery('CREATE (user:Us...')

#3 C:...\NeoSocial\src\Extension\ExtensionManager.php(49): call_user_func_array(Array, Array)

#4 C:...\NeoSocial\src\Client.php(127): Neoxygen\NeoClient\Extension\ExtensionManager->execute('sendCypherQuery', Array)

#5 C:...\xamp in C:...\NeoSocial\src\Extension\AbstractExtension.php on line 89

Christophe Willemsen
@ikwattro
Jul 01 2015 13:36
Ho ok
I didn't catch it in your code example
you forgot to pass the parameters as second argument to sendCypherQuery
gic1be
@gic1be
Jul 01 2015 13:36
Me neither ;)
Christophe Willemsen
@ikwattro
Jul 01 2015 13:37
exactly what says the error :)
gic1be
@gic1be
Jul 01 2015 13:41

Maybe I'm blind, but I can't get it.

This fits:
$query = 'CREATE (user:User {name:"Maxime"}) RETURN user';
$result = $client->sendCypherQuery($query)->getResult();

This not:
$query = 'CREATE (user:User {name: {name} }) RETURN user';
$parameters = array('name' => 'Maxime');
$client->sendCypherQuery($query);

  • What's missing there?
gic1be
@gic1be
Jul 01 2015 13:48
... The parameters, I get it >.<
So than it would be really nice, if you could update this page (https://gist.github.com/ikwattro/833feaed137de238475e) with both parameters. Maybe there are some other blinds ;) Thanks for help