cosmos db graph api how to check if exist and update edge?

Ho to check if edge already exist before create one with gremlin query? How to update existing edge instead of deleting and recreating?