Skip to content
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

feat: rover subgraph introspect #377

Merged
merged 11 commits into from
Mar 29, 2021
Merged

feat: rover subgraph introspect #377

merged 11 commits into from
Mar 29, 2021

Conversation

lrlna
Copy link
Member

@lrlna lrlna commented Mar 26, 2021

Description

Adds rover subgraph introspect command that could be run as is, or with auth headers via the --headers or -H flags. It returns sdl.

Best way to run this is:

cargo run subgraph introspect http://url-to-graphql-service.com

The who subcommand looks like so:

rover-subgraph-introspect 0.0.4
Introspect a subgraph from the Apollo registry

USAGE:
    rover subgraph introspect [OPTIONS] <endpoint>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -H, --header <key:value>...     headers to pass to the endpoint. Values must be key:value pairs. If a value has a
                                    space in it, use quotes around the pair, ex. -H "Auth:some key"
    -l, --log <log-level>            [possible values: error, warn, info, debug,
                                    trace]
        --profile <profile-name>    Name of configuration profile to use [default: default]

ARGS:
    <endpoint>    The endpoint of the subgraph to introspect

closes #349

@lrlna lrlna marked this pull request as ready for review March 29, 2021 14:54
Copy link
Contributor

@EverlastingBugstopper EverlastingBugstopper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

src/command/core/config.rs Outdated Show resolved Hide resolved
@@ -103,7 +103,7 @@ impl RoverStdout {
}
}
RoverStdout::Introspection(introspection_response) => {
eprintln!("Introspection Response:");
eprintln!("Introspection Response:\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the extra newline?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability -- I couldn't visually distinguish where introspection response started. Happy to remove tho!

Co-authored-by: Avery Harnish <avery@apollographql.com>
src/command/output.rs Outdated Show resolved Hide resolved
@lrlna lrlna merged commit 3310ca1 into main Mar 29, 2021
@lrlna lrlna deleted the subgraph-introspect branch March 29, 2021 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

introspection: subgraph (federated introspection)
2 participants