Skip to content
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

[GraphQL] Try to remove objectKeys #21032

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: these are no longer related to pagination -- it's probably worth putting them in their own test for multi_get?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved!

Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,18 @@ module Test::M1 {

//# run-graphql
{
objects_at_version: address(address: "@{A}") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Previously, this query also imposed an ownership constraint -- was that relevant for the test? It seems like from the results, version 3 didn't used to exist in the output and now it does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't follow what is an ownership constraint.

Copy link
Contributor

Choose a reason for hiding this comment

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

The outer query on address(...) means that the inner query only returns objects owned by that address.

objects(
filter: {
type: "@{Test}",
objectKeys: [
{objectId: "@{obj_2_0}", version: 3},
{objectId: "@{obj_3_0}", version: 4},
{objectId: "@{obj_6_0}", version: 5},
{objectId: "@{obj_7_0}", version: 6}
]
}
) {
nodes {
version
objects_at_version:
multiGetObjects(
keys: [
{objectId: "@{obj_2_0}", version: 3},
{objectId: "@{obj_3_0}", version: 4},
{objectId: "@{obj_6_0}", version: 5},
{objectId: "@{obj_7_0}", version: 6}
]
)
{
version
asMoveObject {
contents {
type {
repr
Expand All @@ -140,7 +138,6 @@ module Test::M1 {
}
}
}
}
}

//# programmable --sender A --inputs object(2,0) object(3,0) object(6,0) object(7,0) @B
Expand Down Expand Up @@ -275,20 +272,18 @@ module Test::M1 {
//# run-graphql
# Historical lookups will still return results at version.
{
objects_at_version: address(address: "@{A}") {
objects(
filter: {
type: "@{Test}",
objectKeys: [
{objectId: "@{obj_2_0}", version: 3},
{objectId: "@{obj_3_0}", version: 4},
{objectId: "@{obj_6_0}", version: 5},
{objectId: "@{obj_7_0}", version: 6}
]
}
) {
nodes {
version
objects_at_version:
multiGetObjects(
keys: [
{objectId: "@{obj_2_0}", version: 3},
{objectId: "@{obj_3_0}", version: 4},
{objectId: "@{obj_6_0}", version: 5},
{objectId: "@{obj_7_0}", version: 6}
]
)
{
version
asMoveObject {
contents {
type {
repr
Expand All @@ -297,5 +292,4 @@ module Test::M1 {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,78 +165,82 @@ Response: {
}
}

task 11, lines 119-144:
task 11, lines 119-141:
//# run-graphql
Response: {
"data": {
"objects_at_version": {
"objects": {
"nodes": [
{
"version": 4,
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0x0f2ff2731e04cef60e75403b02f31721406c99cb05eb3029f697de89a3d70a71",
"value": "1"
}
"objects_at_version": [
{
"version": 3,
"asMoveObject": {
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2",
"value": "0"
}
},
{
"version": 6,
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0x44864f8c6cad831f338516aa3ebeacf00c60a13fb4a5a4200b35f376af227cf3",
"value": "3"
}
}
}
},
{
"version": 4,
"asMoveObject": {
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0x0f2ff2731e04cef60e75403b02f31721406c99cb05eb3029f697de89a3d70a71",
"value": "1"
}
},
{
"version": 3,
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2",
"value": "0"
}
}
}
},
{
"version": 5,
"asMoveObject": {
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0xd0a70e7cf1fa823e6bf035f878cc33ee3d221d7f956da78e572bb52574482471",
"value": "2"
}
},
{
"version": 5,
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0xd0a70e7cf1fa823e6bf035f878cc33ee3d221d7f956da78e572bb52574482471",
"value": "2"
}
}
}
},
{
"version": 6,
"asMoveObject": {
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0x44864f8c6cad831f338516aa3ebeacf00c60a13fb4a5a4200b35f376af227cf3",
"value": "3"
}
}
]
}
}
}
]
}
}

task 12, lines 146-147:
task 12, lines 143-144:
//# programmable --sender A --inputs object(2,0) object(3,0) object(6,0) object(7,0) @B
//> TransferObjects([Input(0), Input(1), Input(2), Input(3)], Input(4))
mutated: object(0,0), object(2,0), object(3,0), object(6,0), object(7,0)
gas summary: computation_cost: 1000000, storage_cost: 6247200, storage_rebate: 5206608, non_refundable_storage_fee: 52592

task 13, line 149:
task 13, line 146:
//# create-checkpoint
Checkpoint created: 3

task 14, lines 151-213:
task 14, lines 148-210:
//# run-graphql --cursors @{obj_6_0,2}
Response: {
"data": {
Expand Down Expand Up @@ -504,23 +508,23 @@ Response: {
}
}

task 16, line 217:
task 16, line 214:
//# create-checkpoint
Checkpoint created: 4

task 18, line 221:
task 18, line 218:
//# create-checkpoint
Checkpoint created: 5

task 20, line 225:
task 20, line 222:
//# create-checkpoint
Checkpoint created: 6

task 22, line 229:
task 22, line 226:
//# create-checkpoint
Checkpoint created: 7

task 23, lines 231-255:
task 23, lines 228-252:
//# run-graphql --cursors @{obj_6_0,2}
Response: {
"data": null,
Expand All @@ -543,7 +547,7 @@ Response: {
]
}

task 24, lines 257-273:
task 24, lines 254-270:
//# run-graphql
Response: {
"data": {
Expand Down Expand Up @@ -604,63 +608,67 @@ Response: {
}
}

task 25, lines 275-301:
task 25, lines 272-295:
//# run-graphql
Response: {
"data": {
"objects_at_version": {
"objects": {
"nodes": [
{
"version": 4,
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0x0f2ff2731e04cef60e75403b02f31721406c99cb05eb3029f697de89a3d70a71",
"value": "1"
}
"objects_at_version": [
{
"version": 3,
"asMoveObject": {
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2",
"value": "0"
}
},
{
"version": 6,
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0x44864f8c6cad831f338516aa3ebeacf00c60a13fb4a5a4200b35f376af227cf3",
"value": "3"
}
}
}
},
{
"version": 4,
"asMoveObject": {
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0x0f2ff2731e04cef60e75403b02f31721406c99cb05eb3029f697de89a3d70a71",
"value": "1"
}
},
{
"version": 3,
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0xc4e6c824c72af97ed831b666173a96111e573e0162b205b51c23ae242757e8d2",
"value": "0"
}
}
}
},
{
"version": 5,
"asMoveObject": {
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0xd0a70e7cf1fa823e6bf035f878cc33ee3d221d7f956da78e572bb52574482471",
"value": "2"
}
},
{
"version": 5,
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0xd0a70e7cf1fa823e6bf035f878cc33ee3d221d7f956da78e572bb52574482471",
"value": "2"
}
}
}
},
{
"version": 6,
"asMoveObject": {
"contents": {
"type": {
"repr": "0xf8ecbba416b85769db9b3425d240e9e350c2994bc68d944ac19ebecffb7e0c60::M1::Object"
},
"json": {
"id": "0x44864f8c6cad831f338516aa3ebeacf00c60a13fb4a5a4200b35f376af227cf3",
"value": "3"
}
}
]
}
}
}
]
}
}
Loading
Loading