-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
nerdgraph_query.go
25 lines (21 loc) · 967 Bytes
/
nerdgraph_query.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var nerdgraph_queryCmd = &cobra.Command{
Use: "query",
Short: "Execute a raw GraphQL query request to the NerdGraph API",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(nerdgraph_queryCmd).Standalone()
nerdgraph_queryCmd.Flags().String("queryFile", "", "the query to use, represented as a JSON file")
nerdgraph_queryCmd.Flags().String("variables", "{}", "the variables to pass to the GraphQL query, represented as a JSON string (this will overwrite duplicate variables that are set through variablesFile")
nerdgraph_queryCmd.Flags().String("variablesFile", "", "the variables to pass to GraphQL query, represented as a JSON file")
nerdgraphCmd.AddCommand(nerdgraph_queryCmd)
carapace.Gen(nerdgraph_queryCmd).FlagCompletion(carapace.ActionMap{
"queryFile": carapace.ActionFiles(),
"variablesFile": carapace.ActionFiles(),
})
}