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

Function groupGraphQLVariables

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

Source from the content-addressed store, hash-verified

93}
94
95func groupGraphQLVariables(params map[string]any) map[string]any {
96 topLevel := make(map[string]any)
97 variables := make(map[string]any)
98
99 for key, val := range params {
100 switch key {
101 case "query", "operationName":
102 topLevel[key] = val
103 default:
104 variables[key] = val
105 }
106 }
107
108 if len(variables) > 0 {
109 topLevel["variables"] = variables
110 }
111 return topLevel
112}
113
114func addQuery(path string, params map[string]any) string {
115 if len(params) == 0 {

Callers 2

httpRequestFunction · 0.85

Calls

no outgoing calls

Tested by 1