MCPcopy Index your code
hub / github.com/github/github-mcp-server / NewQueryMatcher

Function NewQueryMatcher

internal/githubv4mock/githubv4mock.go:22–33  ·  view source on GitHub ↗

NewQueryMatcher constructs a new matcher for the provided query and variables. If the provided query is a string, it will be used-as-is, otherwise it will be converted to a string using the constructQuery function taken from shurcooL/graphql.

(query any, variables map[string]any, response GQLResponse)

Source from the content-addressed store, hash-verified

20// If the provided query is a string, it will be used-as-is, otherwise it will be
21// converted to a string using the constructQuery function taken from shurcooL/graphql.
22func NewQueryMatcher(query any, variables map[string]any, response GQLResponse) Matcher {
23 queryString, ok := query.(string)
24 if !ok {
25 queryString = constructQuery(query, variables)
26 }
27
28 return Matcher{
29 Request: queryString,
30 Variables: variables,
31 Response: response,
32 }
33}
34
35// NewMutationMatcher constructs a new matcher for the provided mutation and variables.
36// If the provided mutation is a string, it will be used-as-is, otherwise it will be

Calls 1

constructQueryFunction · 0.85