I have read the instructions at both https://github.com/graphaware/neo4j-php-client#installation-and-basic-usage and https://docs.graphenedb.com/docs/php
While this example from the GrapheneDb docs does work, it does not use GraphAware Neo4j PHP Client, it uses Neo4j Bolt PHP:
// Example for Bolt
$config = \GraphAware\Bolt\Configuration::newInstance()
->withCredentials('user', 'pass')
->withTimeout(10)
->withTLSMode(\GraphAware\Bolt\Configuration::TLSMODE_REQUIRED);
$driver = \GraphAware\Bolt\GraphDatabase::driver('bolt://hobby-my-graph-db.dbs.graphenedb.com:24786', $config);
$client = $driver->session();
I can't find a working example anywhere, I have tried all kinds of things; I have double and triple checked the connection strings, I have tried http as well as bolt, I have logged into the database from neo4j browser so I know the credentials must be ok.
This is what my code looks like:
/* GraphAware\Bolt\Configuration */
$config = Configuration::create()
->withCredentials('user', 'pass')
->withTimeout(10)
->withTLSMode(Configuration::TLSMODE_REQUIRED);
/* GraphAware\Neo4j\Client\ClientBuilder */
$client = ClientBuilder::create()
->addConnection('bolt', 'bolt://hobby-my-graph-db.dbs.graphenedb.com:24787', $config)
->build();
$result = $client->run("CREATE (n:Person {name: 'Bob'}) RETURN id(n)");
When I try to run the query I get:
Exception 'GraphAware\Bolt\Exception\HandshakeException' with message 'Error receiving data'
in /path-to-project/vendor/graphaware/neo4j-bolt/src/Driver.php:165
Does anyone have a complete working connection example to GrapheneDb using graphaware/neo4j-php-client?