I have an upsert query to insert vertices in the graph like this:
V().coalesce(
__.V().hasLabel("Person").has(id, "ABC"),
__.addV(_a).property(id, "ABC")
).limit(1)
However, it doesn't work when the graph has 0 vertices to start with.
How can I adjust this query so that it will succeed when the graph is empty?