-
Notifications
You must be signed in to change notification settings - Fork 124
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(cli): add support for reading schema from stdin in subgraph check command #1512
base: main
Are you sure you want to change the base?
Conversation
…k command
58f14fa
to
35b9825
Compare
@@ -50,8 +47,27 @@ export default (opts: BaseCommandOptions) => { | |||
}); | |||
} | |||
|
|||
// submit an empty schema in case of a delete check | |||
const schema = schemaFile ? await readFile(schemaFile) : Buffer.from(''); | |||
// Handle schema input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@L42y the apollo approach in accepting the schema from stdin is unusual. Why should we use the --schema
flag when piping data is already implicit? Additionally, --schema
is declared as a way to specify a file path.
What do you think about this approach?
data | wgc subgraph check my-graph
This would follow the behaviour of common unix tools. An example to implement this is demonstrated here. This can be then also reused across all other commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know what you think, I think both approaches has it's benefits.
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Motivation and Context
I want to introspect the schema then pipe to wgc for subgraph check without saving it to actual file first, as demonstrated in Apollo's Rover: https://www.apollographql.com/docs/rover/commands/subgraphs#subgraph-check
Checklist