cli/commands/internal/graphql/
mod.rs

1pub mod inspect;
2pub mod list;
3pub mod run;
4
5#[derive(Debug, clap::Args)]
6pub struct Graphql {
7    #[command(subcommand)]
8    pub command: GraphqlCommand,
9}
10
11#[derive(Debug, clap::Subcommand)]
12pub enum GraphqlCommand {
13    /// List all available GraphQL endpoints.
14    List(list::List),
15    /// Inspect a GraphQL endpoint and display its schema.
16    Inspect(inspect::Inspect),
17    /// Execute a GraphQL query against the node.
18    Run(run::Run),
19}
20
21impl Graphql {
22    pub fn run(self) -> anyhow::Result<()> {
23        match self.command {
24            GraphqlCommand::List(v) => v.run(),
25            GraphqlCommand::Inspect(v) => v.run(),
26            GraphqlCommand::Run(v) => v.run(),
27        }
28    }
29}