title: jsonify bolt statementresult
body: <p>My first question here!</p>
  
  <p>I am developing webservices using python and flask. Neo4j is my backend which I would like to APIfy.</p>
  
  <p>I run a match query on the graph db and wants to return a json object. Below is the code.</p>
  
  <pre><code>from flask import Flask, jsonify
  from neo4j.v1 import GraphDatabase
  
  app = Flask(__name__)
  
  uri = "bolt://localhost:7687"
  driver = GraphDatabase.driver(uri, auth=(user, pass))
  
  @app.route('/')
  def com_relations():
      with driver.session() as session:
          with session.begin_transaction() as tx:
              return jsonify(tx.run("MATCH (company:Company)-[]-&gt;(c) where c.name is not null "
                               "RETURN company.name, c.name"))
  
          session.close() 
  </code></pre>
  
  <p>But I get an error while running the app.</p>
  
  <pre><code>TypeError: Object of type 'BoltStatementResult' is not JSON serializable
  </code></pre>
  
  <p>I understand the error and I would like to know how to jsonify my statement result from neo4j. Please help.</p>