I've followed the Gremlin pagination receipe and find it works fine in all scenarios, except when you ask for 1 item against an empty traversal, then it fails with an error:
The provided start does not map to a value: []->[NeptuneMemoryTrackerStep, RangeLocalStep(0,1)]
Asking for one item from a non-empty traversal works fine. Asking for 0 items, 2 items or 10,000 items from an empty traversal is also fine!
Behaviour is as-expected with no errors except when asking for exactly 1 item from an empty traversal.
How can I make pagination resilient and work against queries that find no data when consumers are asking for exactly one item?
g.inject([])
.as('items','count')
.select('items','count')
.by(range(local, 0, 1))
.by(count(local))
.project('count', 'items')
.by(select('count'))
.by(select('items'))
BTW this is running on AWS Neptune.