0xPlaygrounds / 0xPlaygrounds/kg-node
feat: Neo4j passthrough queries
- Ngôn ngữ chính
- Rust
- Star
- 10
- Fork
- 5
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### 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)
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Look for the existing API routes in the codebase, likely in a module like src/api or src/routes. Understand how the current GraphQL endpoint is set up. The new POST /neo4j route needs to be added, which will involve parsing the JSON request, executing the Cypher query against a Neo4j driver (check for existing database connection setup), and returning the raw Neo4j response as JSON. Testing will require a running Neo4j instance or a mock.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- neo4j, rust
- Lĩnh vực
- api, backend, databases
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 45/100