def mutate(self, info, node_id): exact_node = db_session.query(StructureModel).filter( StructureModel.id == node_id).first() if not exact_node: raise GraphQLError("The specified node does not exist") db_session.delete(exact_node) db_session.commit() return DeleteNode(node=exact_node)
def delete(self): """Function for deleting objects""" db_session.delete(self) db_session.commit()
def delete(self): """Function that deletes objects""" db_session.delete(self) db_session.commit()