Skip to content

Conversation

@dannywillems
Copy link
Member

This adds three new commands under 'mina internal graphql' for exploring and interacting with the GraphQL API:

Commands:

  • list: Dynamically discovers and lists all available GraphQL endpoints by querying the server's introspection API. Endpoints are sorted alphabetically with descriptions and argument information.

  • inspect : Shows detailed schema information for a specific endpoint with user-friendly formatting. Arguments are marked as (required)/(optional) instead of GraphQL type notation. Includes actual curl command examples and live JSON response output.

  • run [query]: Executes arbitrary GraphQL queries against the node. Supports three input methods (command line argument, stdin, file via -f flag) and variables via -v flag with JSON. Allows querying both local and remote nodes via --node flag.

Implementation:

All commands use dynamic discovery via GraphQL introspection rather than hardcoded endpoint lists. The implementation includes comprehensive error handling and user-friendly output formatting.

Documentation:

The documentation includes 10 importable bash scripts demonstrating different use cases:

  • Basic list and inspect operations
  • Query execution from command line, stdin, and file
  • Parameterized queries with variables
  • Remote node querying

All scripts follow the importable pattern using raw-loader for consistency between documentation and tested code.

Testing:

CI tests verify all commands are available and their help functions work correctly. The test script is integrated into the main tests.yaml workflow to run on every build.

@github-actions
Copy link

github-actions bot commented Oct 21, 2025

OCaml Reference Validation Results

Repository: https://github.com/MinaProtocol/mina.git
Branch: compatible
Status: ✓ Validation passed

Click to see full validation output
Checking OCaml references against https://github.com/MinaProtocol/mina.git (branch: compatible)
Fetching current commit from compatible...
Current OCaml commit: 86e41e40b54623fbc300c1433dc41ba77c2d98c9

Validating references...
========================
✓ VALID: ledger/src/account/account.rs -> src/lib/mina_base/account.ml L:201-224
  ⚠ STALE COMMIT: fc6be4c58091c761f827c858229c2edf9519e941 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/for_tests.rs -> src/lib/transaction_logic/mina_transaction_logic.ml L:2285-2285
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/for_tests.rs -> src/lib/transaction_logic/mina_transaction_logic.ml L:2351-2356
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/for_tests.rs -> src/lib/transaction_logic/mina_transaction_logic.ml L:2407
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/transaction_status.ml L:9-51
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/transaction_status.ml L:452-454
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/with_status.ml L:6-10
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/fee_transfer.ml L:76-80
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/fee_transfer.ml L:68-69
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/mina_base/coinbase.ml L:17-21
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/mod.rs -> src/lib/transaction/transaction.ml L:8-11
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/signed_command_payload.ml L:34-48
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/stake_delegation.ml L:11-13
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/signed_command_payload.ml L:179-181
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/signed_command_payload.ml L:239-243
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)
✓ VALID: ledger/src/scan_state/transaction_logic/signed_command.rs -> src/lib/mina_base/signed_command_payload.ml L:352-362
  ⚠ STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 86e41e40b54623fbc300c1433dc41ba77c2d98c9)

Summary
=======
Total references found: 16
Valid references: 16
Invalid references: 0
Stale commits: 16

⚠ Warning: 16 reference(s) have stale commits
Run with --update to update them automatically

@dannywillems dannywillems self-assigned this Oct 21, 2025
@github-actions
Copy link

github-actions bot commented Oct 21, 2025

✓ Code Reference Verification Passed

All code references in the documentation have been verified successfully!

Total references checked: 1
Valid references: 1

The documentation is in sync with the codebase on the develop branch.

@dannywillems dannywillems force-pushed the dw/mina-cli-graphql-endpoints branch 5 times, most recently from 36ea01d to fbcdb57 Compare October 21, 2025 12:20
@dannywillems dannywillems force-pushed the dw/mina-cli-graphql-endpoints branch from fbcdb57 to a24d877 Compare October 21, 2025 13:01
This adds three new commands under 'mina internal graphql' for
exploring and interacting with the GraphQL API:

Commands:

- list: Dynamically discovers and lists all available GraphQL endpoints
  by querying the server's introspection API. Endpoints are sorted
  alphabetically with descriptions and argument information.

- inspect <endpoint>: Shows detailed schema information for a specific
  endpoint with user-friendly formatting. Arguments are marked as
  (required)/(optional) instead of GraphQL type notation. Includes
  actual curl command examples and live JSON response output.

- run [query]: Executes arbitrary GraphQL queries against the node.
  Supports three input methods (command line argument, stdin, file via
  -f flag) and variables via -v flag with JSON. Allows querying both
  local and remote nodes via --node flag.

Implementation:

All commands use dynamic discovery via GraphQL introspection rather
than hardcoded endpoint lists. The implementation includes comprehensive
error handling and user-friendly output formatting.

Documentation:

The documentation includes 10 importable bash scripts demonstrating
different use cases:
- Basic list and inspect operations
- Query execution from command line, stdin, and file
- Parameterized queries with variables
- Remote node querying

All scripts follow the importable pattern using raw-loader for
consistency between documentation and tested code.

Testing:

CI tests verify all commands are available and their help functions
work correctly. The test script is integrated into the main tests.yaml
workflow to run on every build.
@dannywillems dannywillems force-pushed the dw/mina-cli-graphql-endpoints branch from a24d877 to 3ebd954 Compare October 21, 2025 14:48
@dannywillems dannywillems merged commit e11aad6 into develop Oct 22, 2025
72 of 74 checks passed
@yamimaio yamimaio moved this to In Progress in Rust node Oct 22, 2025
@yamimaio yamimaio moved this from In Progress to Done in Rust node Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants