0xPlaygrounds / 0xPlaygrounds/kg-node

feat: Neo4j passthrough queries

Aperta
#8 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
10
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Description
Add an additional endpoint to the API to forward queries to the Neo4j database.

### Motivation
Although the GRC20 indexer stack now uses a GraphQL API to serve KG data, there are still uses cases that would benefit from direct access to the underlying Neo4j database (e.g.: GraphRag).

### Implementation
Add an additional route `POST /neo4j` which expects the request bodies of the following form:
```json
{
"query": "MATCH (n) WHERE n.foo = $foo RETURN n",
"params": {
"foo": "bar"
}
}
```
where `"query"` is the cypher query to execute and `"params"` are optional query parameters.

The response body would contain the data returned by Neo4j serialized to JSON without any transformations.

### Alternatives
An alternative would be to add this "passthrough" route to the GraphQL API, however it's unclear what the return type would be (i.e.: how the Neo4j data could be converted to GraphQL entities)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.