| 114 | } |
| 115 | |
| 116 | func TestDuplicateQueryAliasesError(t *testing.T) { |
| 117 | query := ` |
| 118 | { |
| 119 | find_michael(func: eq(name@., "Michael")) { |
| 120 | uid |
| 121 | name@. |
| 122 | age |
| 123 | } |
| 124 | find_michael(func: eq(name@., "Amit")) { |
| 125 | uid |
| 126 | name@. |
| 127 | } |
| 128 | }` |
| 129 | _, err := Parse(Request{Str: query}) |
| 130 | require.Error(t, err) |
| 131 | |
| 132 | queryInOpType := ` |
| 133 | { |
| 134 | find_michael(func: eq(name@., "Michael")) { |
| 135 | uid |
| 136 | name@. |
| 137 | age |
| 138 | } |
| 139 | } |
| 140 | query {find_michael(func: eq(name@., "Amit")) { |
| 141 | uid |
| 142 | name@. |
| 143 | } |
| 144 | } |
| 145 | ` |
| 146 | _, err = Parse(Request{Str: queryInOpType}) |
| 147 | require.Error(t, err) |
| 148 | |
| 149 | queryWithDuplicateShortestPaths := ` |
| 150 | { |
| 151 | path as shortest(from: 0x1, to: 0x4) { |
| 152 | friend |
| 153 | } |
| 154 | path2 as shortest(from: 0x2, to: 0x3) { |
| 155 | friend |
| 156 | } |
| 157 | pathQuery1(func: uid(path)) { |
| 158 | name |
| 159 | } |
| 160 | pathQuery2(func: uid(path2)) { |
| 161 | name |
| 162 | } |
| 163 | |
| 164 | }` |
| 165 | _, err = Parse(Request{Str: queryWithDuplicateShortestPaths}) |
| 166 | require.NoError(t, err) |
| 167 | } |
| 168 | |
| 169 | func TestParseQueryListPred1(t *testing.T) { |
| 170 | query := ` |