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

Function TestMultipleQueryErr

dql/upsert_test.go:67–100  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

65}
66
67func TestMultipleQueryErr(t *testing.T) {
68 query := `
69upsert {
70 query {
71 me(func: eq(age, 34)) {
72 uid
73 friend {
74 uid
75 age
76 }
77 }
78 }
79
80 query {
81 me2(func: eq(age, 34)) {
82 uid
83 friend {
84 uid
85 age
86 }
87 }
88 }
89
90 mutation {
91 set {
92 "_:user1" <age> "45" .
93 }
94 }
95}
96`
97 _, err := ParseDQL(query)
98 require.Error(t, err)
99 require.Contains(t, err.Error(), "Multiple query ops inside upsert block")
100}
101
102func TestEmptyUpsertErr(t *testing.T) {
103 query := `upsert {}`

Callers

nothing calls this directly

Calls 2

ParseDQLFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected