MCPcopy Create free account
hub / github.com/cli/cli / groupGraphQLVariables

Function groupGraphQLVariables

pkg/cmd/api/http.go:86–103  ·  view source on GitHub ↗
(params map[string]any)

Source from the content-addressed store, hash-verified

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

Callers 2

httpRequestFunction · 0.85

Calls

no outgoing calls

Tested by 1