forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[graphql/rpc] testing infra: capture addrs variables (MystenLabs#14957)
## Description Maps resolved named addresses and published packages to graphql variables so they can be used in graphql queries. Two variables are made for each mapping. One for the required `SuiAddress!` type, and another for optional `SuiAddress` type (variable name is suffixed with `_opt`). To declare a variable for use in a query, one must add `--variables {space separated list of var names}` e.g Note: publishing `Test` as done below changes its address from 0x0. This new address is what shows up in graphql variable value. ``` //# init --addresses Test=0x0 A=0x42 --simulator //# publish module Test::M1 {} // Do some stuff //# run-graphql --variables Test A { address(address: $Test) { objectConnection{ edges { node { location digest kind } } } } second: address(address: $A) { objectConnection{ edges { node { location digest kind } } } } } ``` One can also list all the variable mappings with `view-graphql-variables`: ``` Name: A Type: SuiAddress! Value: "0x42" Name: A_opt Type: SuiAddress Value: "0x42" Name: Test Type: SuiAddress! Value: "0xB214F63E7E7CEA32DC57EDBA9C924524F44A7BB50E72D0E102265219D4DE7D0E" Name: Test_opt Type: SuiAddress Value: "0xB214F63E7E7CEA32DC57EDBA9C924524F44A7BB50E72D0E102265219D4DE7D0E" ``` ## Test Plan Included --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes
- Loading branch information
Showing
7 changed files
with
220 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters