Skip to content

display: Support $self meta variable#25481

Merged
amnn merged 3 commits intomainfrom
amnn/disp-self
Mar 4, 2026
Merged

display: Support $self meta variable#25481
amnn merged 3 commits intomainfrom
amnn/disp-self

Conversation

@amnn
Copy link
Copy Markdown
Contributor

@amnn amnn commented Feb 16, 2026

Description

Give users the ability to refer directly to the value being displayed, using $self. This makes it possiblet to write expressions where the $self is used as part of a dynamic field key, rather than part of the parent that that dynamic field is being fetched from. E.g. to use the value as a key to fetch from a registry, @REGISTRY->[$self].

Test plan

New unit tests:

$ cargo nextest run -p sui-display

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:
  • Indexing Framework:

@amnn amnn self-assigned this Feb 16, 2026
@amnn amnn requested a review from a team as a code owner February 16, 2026 19:04
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview, Comment Mar 4, 2026 1:22am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Mar 4, 2026 1:22am
sui-kiosk Ignored Ignored Preview Mar 4, 2026 1:22am

Request Review

Copy link
Copy Markdown
Contributor

@tzakian tzakian left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Base automatically changed from amnn/gql-as-vector to main March 3, 2026 21:12
amnn added 3 commits March 4, 2026 01:17
## Description

Factor out a helper for calculating the relevant range of indices based
on cursors/page information. This was previously part of
`paginate_indices`, but will be used in the implementation of
`MoveValue.asVector` as well, so it makes sense to have it as a separate
function.

## Test plan

New unit tests:

```
$ cargo nextest run -p sui-indexer-alt-graphql
```
## Description

Add the ability to paginate over a vector of Move Values in the GraphQL
API. This addresses a gap that made it more difficult to work with
`vector`, `VecMap, and `VecSet` in GraphQL, compared to working with
dynamic field based types like `Table` and `Bag`.

## Test plan

New E2E tests:

```
$ cargo nextest run -p sui-indexer-alt-e2e-tests \
  --test transactional_tests                     \
  -- graphql/move_value/as_vector
```
## Description

Give users the ability to refer directly to the value being displayed,
using `$self`. This makes it possiblet to write expressions where the
`$self` is used as part of a dynamic field key, rather than part of the
parent that that dynamic field is being fetched from. E.g. to use the
value as a key to fetch from a registry, `@REGISTRY->[$self]`.

## Test plan

New unit tests:

```
$ cargo nextest run -p sui-display
```
@amnn amnn force-pushed the amnn/disp-self branch from 2aaea0a to 7fb3df8 Compare March 4, 2026 01:17
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env March 4, 2026 01:17 — with GitHub Actions Inactive
@amnn amnn merged commit ccd748b into main Mar 4, 2026
58 of 59 checks passed
@amnn amnn deleted the amnn/disp-self branch March 4, 2026 12:04
jessiemongeon1 pushed a commit to jessiemongeon1/sui that referenced this pull request Mar 5, 2026
## Description

Give users the ability to refer directly to the value being displayed,
using `$self`. This makes it possiblet to write expressions where the
`$self` is used as part of a dynamic field key, rather than part of the
parent that that dynamic field is being fetched from. E.g. to use the
value as a key to fetch from a registry, `@REGISTRY->[$self]`.

## Test plan

New unit tests:

```
$ cargo nextest run -p sui-display
```

## Stack

- MystenLabs#25479 

---

## 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:
- [ ] Indexing Framework:
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