Skip to content

Commit f234233

Browse files
gkorlandCopilot
andcommitted
Add API documentation for graph retrieval, query, and commit history endpoints
Migrated from FalkorDB/code-graph-backend PR #96. Original issue: FalkorDB/code-graph-backend#83 Resolves #534 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f063417 commit f234233

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,38 @@ Have questions or feedback? Reach out via:
214214
If you find this repository helpful, please consider giving it a star!
215215

216216
Knowledge Graph, Code Analysis, Code Visualization, Dead Code Analysis, Graph Database
217+
218+
## API Reference
219+
220+
### Retrieve a graph
221+
222+
Fetch graph entities from a repository:
223+
224+
```bash
225+
curl -X GET "http://127.0.0.1:5000/graph_entities?repo=<REPO_NAME>" -H "Authorization: <.ENV_SECRET_TOKEN>"
226+
```
227+
228+
Example:
229+
```bash
230+
curl -X GET "http://127.0.0.1:5000/graph_entities?repo=GraphRAG-SDK" -H "Authorization: OpenSesame"
231+
```
232+
233+
### Send Query
234+
235+
Query your code graph using natural language:
236+
237+
```bash
238+
curl -X POST http://127.0.0.1:5000/chat -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>", "msg": "<YOUR_QUESTION>"}' -H "Authorization: <.ENV_SECRET_TOKEN>"
239+
```
240+
241+
### History change
242+
243+
List all commits:
244+
```bash
245+
curl -X POST http://127.0.0.1:5000/list_commits -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>"}' -H "Authorization: <.ENV_SECRET_TOKEN>"
246+
```
247+
248+
Switch to a specific commit:
249+
```bash
250+
curl -X POST http://127.0.0.1:5000/switch_commit -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>", "commit": "<COMMIT_HASH>"}' -H "Authorization: <.ENV_SECRET_TOKEN>"
251+
```

0 commit comments

Comments
 (0)