File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed
resources/com/walmartlabs/lacinia
test/com/walmartlabs/lacinia/parser Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ unionExtDef
118118 ;
119119
120120unionTypes
121- : ( anyName ' |' )* anyName
121+ : ' | ' ? ( anyName ' |' )* anyName
122122 ;
123123
124124enumDef
Original file line number Diff line number Diff line change 181181 (parse-string " interface Flow { ebb : String }" ))))
182182
183183(deftest schema-union
184- (is (= {:unions
185- {:Matter
186- {:members [:Solid :Liquid :Gas :Plasma :INPUT_OBJECT ]}}}
187- (parse-string " union Matter = Solid | Liquid | Gas | Plasma | INPUT_OBJECT" )))
184+
185+ (testing " basic union type"
186+ (is (= {:unions
187+ {:Matter
188+ {:members [:Solid :Liquid :Gas :Plasma :INPUT_OBJECT ]}}}
189+ (parse-string " union Matter = Solid | Liquid | Gas | Plasma | INPUT_OBJECT" ))))
190+
191+ (testing " leading pipe chars in union"
192+ (is (= {:unions
193+ {:Matter
194+ {:members [:Solid :Liquid :Gas :Plasma :INPUT_OBJECT ]}}}
195+ (parse-string " union Matter = | Solid | Liquid | Gas | Plasma | INPUT_OBJECT" ))))
188196
189197 (testing " extensions"
190- (is (= {:unions
191- {:Matter
192- {:members [:Solid :Liquid :Gas :Plasma :INPUT_OBJECT ]}}}
193- (parse-string (str " union Matter = Solid\n "
194- " extend union Matter = Liquid | Gas | Plasma | INPUT_OBJECT" ))))))
198+ (is (= {:unions
199+ {:Matter
200+ {:members [:Solid :Liquid :Gas :Plasma :INPUT_OBJECT ]}}}
201+ (parse-string (str " union Matter = Solid\n "
202+ " extend union Matter = Liquid | Gas | Plasma | INPUT_OBJECT" ))))))
195203
196204(deftest schema-field-args
197205 (is (= {:objects
You can’t perform that action at this time.
0 commit comments