Skip to content

Commit d360a35

Browse files
authored
fix env args with requires (#140)
* fix env args * remove requires for explorer key
1 parent 71ea7c2 commit d360a35

File tree

1 file changed

+11
-6
lines changed
  • crates/apollo-mcp-server/src

1 file changed

+11
-6
lines changed

crates/apollo-mcp-server/src/main.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,16 @@ struct Args {
7373
introspection: bool,
7474

7575
/// Enable use of uplink to get the schema and persisted queries (requires APOLLO_KEY and APOLLO_GRAPH_REF)
76-
#[arg(long, short = 'u')]
76+
#[arg(
77+
long,
78+
short = 'u',
79+
requires = "apollo_key",
80+
requires = "apollo_graph_ref"
81+
)]
7782
uplink: bool,
7883

79-
/// Expose a tool to open queries in Apollo Explorer (requires APOLLO_KEY and APOLLO_GRAPH_REF)
80-
#[arg(long, short = 'x')]
84+
/// Expose a tool to open queries in Apollo Explorer (requires APOLLO_GRAPH_REF)
85+
#[arg(long, short = 'x', requires = "apollo_graph_ref")]
8186
explorer: bool,
8287

8388
/// Operation files to expose as MCP tools
@@ -117,7 +122,7 @@ struct Args {
117122
http_port: Option<u16>,
118123

119124
/// collection id to expose as MCP tools (requires APOLLO_KEY)
120-
#[arg(long, conflicts_with_all(["operations", "manifest"]))]
125+
#[arg(long, conflicts_with_all(["operations", "manifest"]), requires = "apollo_key")]
121126
collection: Option<String>,
122127

123128
/// The endpoints (comma separated) polled to fetch the latest supergraph schema.
@@ -129,11 +134,11 @@ struct Args {
129134
apollo_registry_url: Option<String>,
130135

131136
/// Your Apollo key.
132-
#[clap(skip = std::env::var("APOLLO_KEY").ok())]
137+
#[clap(env = "APOLLO_KEY", long)]
133138
apollo_key: Option<String>,
134139

135140
/// Your Apollo graph reference.
136-
#[clap(skip = std::env::var("APOLLO_GRAPH_REF").ok())]
141+
#[clap(env = "APOLLO_GRAPH_REF", long)]
137142
apollo_graph_ref: Option<String>,
138143
}
139144

0 commit comments

Comments
 (0)