langchain/graphs/neo4j_graph.py/Neo4jGraph/query
class Neo4jGraph:    def query(self, query: str, params: dict = {}) -> List[Dict[str, Any]]:
        """Query Neo4j database."""
        from neo4j.exceptions import CypherSyntaxError

        with self._driver.session(database=self._database) as session:
            try:
                data = session.run(query, params)
                # Hard limit of 50 results
                return [r.data() for r in data][:50]
            except CypherSyntaxError as e:
                raise ValueError("Generated Cypher Statement is not valid\n" f"{e}")