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

Function graphQLBody

script/ghmock/server_test.go:56–65  ·  view source on GitHub ↗
(t *testing.T, query string, operation ...string)

Source from the content-addressed store, hash-verified

54}
55
56func graphQLBody(t *testing.T, query string, operation ...string) string {
57 t.Helper()
58 payload := map[string]string{"query": query}
59 if len(operation) > 0 {
60 payload["operationName"] = operation[0]
61 }
62 data, err := json.Marshal(payload)
63 require.NoError(t, err)
64 return string(data)
65}
66
67func graphQLBodyWithVariables(t *testing.T, query, variables string) string {
68 t.Helper()

Callers 1

TestMockServerFunction · 0.85

Calls 1

HelperMethod · 0.65

Tested by

no test coverage detected