Skip to content

graphql-alt: Query.packageVersions #22088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 0 commits into from
May 19, 2025
Merged

graphql-alt: Query.packageVersions #22088

merged 0 commits into from
May 19, 2025

Conversation

amnn
Copy link
Contributor

@amnn amnn commented May 9, 2025

Description

Add support for

  • Query.packageVersions,
  • MovePackage.packageVersionsBefore, and
  • MovePackage.packageVersionsAfter,

similar to the equivalent Object APIs, but using package versioning schemes (and only working for objects that are packages).

Test plan

New E2E tests:

sui$ cargo nextest run -p sui-indexer-alt-e2e-tests

Update schema tests:

sui$ cargo nextest run -p sui-indexer-alt-graphql -- schema

Stack


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@amnn amnn requested review from emmazzz, wlmyng and Copilot May 9, 2025 14:27
@amnn amnn self-assigned this May 9, 2025
Copy link

vercel bot commented May 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 1:54pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 1:54pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 1:54pm

@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 9, 2025 14:27 — with GitHub Actions Inactive
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for package version pagination by introducing new GraphQL query fields (packageVersions, packageVersionsAfter, and packageVersionsBefore) and corresponding pagination logic in the MovePackage API. It also updates the underlying schema and reader to include a new cp_sequence_number field used for version filtering and checkpointing.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/sui-indexer-alt-schema/src/packages.rs Added cp_sequence_number field to StoredPackageOriginalId to enable checkpoint version filtering.
crates/sui-indexer-alt-reader/src/packages.rs Updated the package retrieval query to include cp_sequence_number.
crates/sui-indexer-alt-graphql/staging.graphql, schema.graphql and snapshots Extended GraphQL schema definitions with new pagination fields for package versioning.
crates/sui-indexer-alt-graphql/src/api/types/object.rs & move_package.rs Added and updated methods supporting package version pagination based on package version and cp_sequence_number.
crates/sui-indexer-alt-graphql/src/api/query.rs Introduced the package_versions query resolver invoking pagination by version.
E2E tests Added tests to verify the package version pagination behavior.

@amnn amnn deleted the amnn/gql-pkg-vs branch May 19, 2025 13:45
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:45 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:46 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env May 19, 2025 13:47 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants