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

Function TestParseVarError

dql/parser_test.go:99–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

97}
98
99func TestParseVarError(t *testing.T) {
100 query := `
101 {
102 var(func: uid(0x0a)) {
103 a as friends
104 }
105
106 me(func: uid(a)) {
107 uid(a)
108 }
109 }
110`
111 _, err := Parse(Request{Str: query})
112 require.Error(t, err)
113 require.Contains(t, err.Error(), "Cannot do uid() of a variable")
114}
115
116func TestDuplicateQueryAliasesError(t *testing.T) {
117 query := `

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected