MCPcopy Index your code
hub / github.com/cli/cli / groupGraphQLVariables

Function groupGraphQLVariables

pkg/cmd/api/http.go:84–101  ·  view source on GitHub ↗
(params map[string]interface{})

Source from the content-addressed store, hash-verified

82}
83
84func groupGraphQLVariables(params map[string]interface{}) map[string]interface{} {
85 topLevel := make(map[string]interface{})
86 variables := make(map[string]interface{})
87
88 for key, val := range params {
89 switch key {
90 case "query", "operationName":
91 topLevel[key] = val
92 default:
93 variables[key] = val
94 }
95 }
96
97 if len(variables) > 0 {
98 topLevel["variables"] = variables
99 }
100 return topLevel
101}
102
103func addQuery(path string, params map[string]interface{}) string {
104 if len(params) == 0 {

Callers 2

httpRequestFunction · 0.85

Calls

no outgoing calls

Tested by 1