Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix(graphql): add root object version for dynamic field queries #17934
fix(graphql): add root object version for dynamic field queries #17934
Changes from 16 commits
8adafa1
c045af6
c61cbe8
5afe7a4
8cbe505
52527c9
592ffbb
dedad22
bc4d3af
886cbd5
3b74764
1f41206
1ea31c2
cda0593
fecea0c
03124cf
538ccff
4f74c5f
a0a9f12
f6fe4a7
dfda753
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment still needs updating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think I accidentally undid it because I committed your suggestion directly on the schema file instead of on the source code and then running tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might make more sense as a doc comment for
fn value
ofDynamicField
, something like "If thevalue
is a child object, its contents come from the latest version that is at most equal to its parent object's version."There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that makes sense, you'll need to run
snapshot_tests.rs
to regenerate the schema and update the snapshot testThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I came up for
DynamicField.value
:Good to go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies in advance for bikeshedding 😅 but it's possible for someone to access the child object directly off-chain via its address and at any version, so this is not entirely accurate. Proposing...
The returned dynamic field is an object if its return type is
MoveObject
, and its contents will be from the latest version that is at most equal to its parent object's version. Otherwise, it is also accessible off-chain via its address.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this comment needs to updated as well now, right? Because we'll always set to the object's own version if this is
None
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch