MCPcopy
hub / github.com/dgraph-io/dgraph / executor

Struct executor

graphql/resolve/resolver_error_test.go:35–53  ·  view source on GitHub ↗

Tests that result completion and GraphQL error propagation are working properly. All the tests work on a mocked json response, rather than a running Dgraph. It's better to mock the Dgraph client interface in these tests and have cases where one can directly see the json response and how it gets modi

Source from the content-addressed store, hash-verified

33// to see what the test is actually doing.
34
35type executor struct {
36 // existenceQueriesResp stores JSON response of the existence queries in case of Add
37 // or Update mutations and is returned for every third Execute call.
38 // counter is used to count how many times Execute function has been called.
39 existenceQueriesResp string
40 counter int
41 counterLock sync.Mutex
42 resp string
43 assigned map[string]string
44 result map[string]interface{}
45
46 queryTouched uint64
47 mutationTouched uint64
48
49 // start reporting Dgraph fails at this point (0 = never fail, 1 = fail on
50 // first request, 2 = succeed once and then fail on 2nd request, etc.)
51 failQuery int
52 failMutation int
53}
54
55type QueryCase struct {
56 Name string

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected