-
Notifications
You must be signed in to change notification settings - Fork 41
Add GraphQL introspection and execution commands to CLI #1565
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
Merged
Conversation
This file contains hidden or 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
f348664 to
cb81732
Compare
OCaml Reference Validation ResultsRepository: https://github.com/MinaProtocol/mina.git Click to see full validation output |
✓ Code Reference Verification PassedAll code references in the documentation have been verified successfully! Total references checked: 1 The documentation is in sync with the codebase on the |
36ea01d to
fbcdb57
Compare
directcuteo
approved these changes
Oct 21, 2025
fbcdb57 to
a24d877
Compare
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.
a24d877 to
3ebd954
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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:
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.