-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_graph_api.py
More file actions
36 lines (29 loc) · 1.3 KB
/
check_graph_api.py
File metadata and controls
36 lines (29 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import requests
import json
try:
response = requests.get('http://localhost:8000/api/ast/graph/')
print(f'Status: {response.status_code}')
if response.status_code == 200:
data = response.json()
print(f'Total nodes: {len(data.get("nodes", []))}')
print(f'Total edges: {len(data.get("edges", []))}')
# Check node types
node_types = {}
for node in data.get('nodes', []):
node_type = node.get('type', 'unknown')
node_types[node_type] = node_types.get(node_type, 0) + 1
print('\nNode types breakdown:')
for node_type, count in sorted(node_types.items()):
print(f' {node_type}: {count}')
# Check for LWC nodes specifically
lwc_nodes = [n for n in data.get('nodes', []) if n.get('type') in ['LWCComponent', 'JavaScriptClass', 'JavaScriptMethod']]
print(f'\nLWC-related nodes: {len(lwc_nodes)}')
if lwc_nodes:
print('LWC nodes found:')
for node in lwc_nodes[:5]: # Show first 5
print(f' - {node.get("id")}: {node.get("type")} ({node.get("name", "no name")})')
else:
print(f'Error: {response.status_code}')
print(response.text)
except Exception as e:
print(f'Request failed: {e}')