fix(api): /api/nodes, /api/edges 가 존재하지 않는 run_query() 를 호출한다 - #12
Open
epruseal wants to merge 1 commit into
Open
fix(api): /api/nodes, /api/edges 가 존재하지 않는 run_query() 를 호출한다#12epruseal wants to merge 1 commit into
epruseal wants to merge 1 commit into
Conversation
그래프 시각화용 두 엔드포인트가 항상 500 을 반환한다.
GET /api/nodes -> 500 {"detail": "'LocalGraphStore' object has no attribute 'run_query'"}
GET /api/edges -> 500 (동일)
run_query 는 이 저장소의 어떤 스토어에도 정의되어 있지 않다 - 정의 0곳,
호출 2곳(apps/api/main.py:759, :792). 같은 파일의 _resolve_node_types 는
:422, :432 에서 올바른 이름 run_cypher 를 이미 쓰고 있다. 단순 오타다.
LocalGraphStore.run_query : MISSING
LocalGraphStore.run_cypher : exists
실측 (d34352c 대비, 노드 2개·엣지 1개를 적재한 뒤 TestClient 로 직접 호출):
[수정 전] GET /api/nodes -> 500 {"detail": "'LocalGraphStore' object has no
attribute 'run_query'"}
GET /api/edges -> 500 (동일)
[수정 후] GET /api/nodes -> 200 {"nodes":[],"total":0}
GET /api/edges -> 200 {"edges":[],"total":0}
(WARNING run_cypher() is not supported in local mode; returning [].)
즉 이 PR 의 효과는 500 제거까지다. 그래프 데이터가 실제로 나오지는 않는다 -
LocalGraphStore.run_cypher 가 문서대로 [] 를 돌려주는 no-op 스텁이기 때문이다.
Neo4j 백엔드에서는 어떻게 되는지는 이 PR 로 확인하지 않았다. 애초에 API 는
Neo4j 를 쓸 수 없다: make_graph_store() 는 분기 없이 항상 LocalGraphStore 를
반환하고(opencrab/stores/factory.py:21-26), Settings.is_local 은 상수 True 이며
(opencrab/config.py:84-85), apps/api 에서 Neo4jStore 를 생성하는 경로는 0곳이다.
따라서 두 엔드포인트가 실제 데이터를 반환하려면 Cypher 가 아닌 store-agnostic
벌크 조회(노드/엣지 export)가 필요하고, 그건 스토어 프로토콜을 넓히는 별건이라
이 PR 에는 넣지 않았다.
전체 스위트 회귀 없음: 131 passed, 3 skipped (base 와 동일 - 테스트 추가 없음).
epruseal
force-pushed
the
fix/graph-endpoints-run-cypher
branch
from
July 30, 2026 01:54
2fbcd35 to
1fc5b13
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
현상
그래프 시각화용 두 엔드포인트가 항상 500 을 반환합니다.
원인
run_query는 이 저장소의 어떤 스토어에도 정의되어 있지 않습니다.같은 파일의
_resolve_node_types는:422,:432에서 올바른 이름run_cypher를 이미 쓰고 있습니다. 단순 오타입니다.수정
run_query->run_cypher(2줄). 의도된 이름이 무엇인지는 같은 파일이 이미 증명합니다.결과 (실측)
d34352c대비, 노드 2개,엣지 1개를 적재한 뒤 TestClient 로 직접 호출:즉 이 PR 의 효과는 500 제거까지입니다. 그래프 데이터가 실제로 나오지는
않습니다 -
LocalGraphStore.run_cypher가 문서대로[]를 돌려주는 no-op스텁이기 때문입니다.
Neo4j 백엔드에 대해 (검증하지 않았습니다)
처음 이 PR 을 쓸 때 "docker/Neo4j 모드에서는 정상 동작하게 된다"고 적었는데,
확인해 보니 이 저장소에서 API 는 Neo4j 를 쓸 수 없습니다.
따라서 수정 후에도 두 엔드포인트는 모든 설정에서 빈 그래프를 반환합니다. 실제
데이터를 반환하려면 Cypher 가 아닌 store-agnostic 벌크 조회(노드/엣지 export)가
필요하고, 그건 스토어 프로토콜을 넓히는 별건이라 이 PR 에는 넣지 않았습니다.
전체 스위트 회귀 없음:
131 passed, 3 skipped(base 와 동일 - 테스트 추가 없음).