(node_id: int)
| 178 | # DELETE node in the graph |
| 179 | @router.post('/delete/{node_id}') |
| 180 | async def delete_node(node_id: int): |
| 181 | |
| 182 | cypher = """ |
| 183 | MATCH (node) |
| 184 | WHERE ID(node) = $node_id |
| 185 | DETACH DELETE node |
| 186 | """ |
| 187 | |
| 188 | with neo4j_driver.session() as session: |
| 189 | result = session.run(query=cypher, |
| 190 | parameters={'node_id': node_id}) |
| 191 | |
| 192 | node_data = result.data() |
| 193 | |
| 194 | # Confirm deletion was completed by empty response |
| 195 | return node_data or { |
| 196 | 'response': f'Node with ID: {node_id} was successfully deleted from the graph.' |
| 197 | } |
| 198 | |
| 199 | |
| 200 | # RELATIONSHIPS |
nothing calls this directly
no outgoing calls
no test coverage detected