Page MenuHomeSoftware Heritage

Add an item cursor to the connection edge
ClosedPublic

Authored by jayeshv on Jun 3 2022, 12:16 PM.

Details

Summary

This will add the possibility to get items in a connection from any
arbitrary position. Generic implementation is using item index along
with the offset (after argument) to generate a cursor

Fixes T4291

Diff Detail

Repository
rDGQL GraphQL API
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D7957 (id=28651)

Rebasing onto e22537ef01...

Current branch diff-target is up to date.
Changes applied before test
commit 54120da78afed7bf5941256f0ea3a6e3b092b801
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Fri Jun 3 11:03:50 2022 +0200

    Add an item cursor to the connection edge
    
    This will add the possibility to get items in a connection from any
    arbitrary position. Generic implementation is using item index along
    with the offset (after argument) to generate a cursor
    
    Fixes T4291

See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/43/ for more details.

vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/graphql/resolvers/base_connection.py
129

for consistent types

This revision is now accepted and ready to land.Jun 3 2022, 12:27 PM
swh/graphql/tests/functional/test_pagination.py
98

why doesn't it work?

Extra test for item cursor

jayeshv added inline comments.
swh/graphql/tests/functional/test_pagination.py
98

@vlorentz It actually works. I was comparing the wrong objects. Thanks
I thought it was an issue with an arbitrary offset used in in-memory DB.

Build is green

Patch application report for D7957 (id=28656)

Rebasing onto e22537ef01...

Current branch diff-target is up to date.
Changes applied before test
commit b7395eff481bfb3e69c67d22b6fa9faaa1a46af4
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Fri Jun 3 11:03:50 2022 +0200

    Add an item cursor to the connection edge
    
    This will add the possibility to get items in a connection from any
    arbitrary position. Generic implementation is using item index along
    with the offset (after argument) to generate a cursor
    
    Fixes T4291

See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/44/ for more details.

This revision was automatically updated to reflect the committed changes.