spec/graphql/language/parser_spec.rb in graphql-0.10.4 vs spec/graphql/language/parser_spec.rb in graphql-0.10.5

- old
+ new

@@ -13,25 +13,27 @@ $override: Boolean = true, $cucumbers: [Vegetable]!, $input: SomeInputType = {key: "value"}, ) @veggie, @healthy(vitamins: true) { # change the cucumber - changeStuff(thing: $cucumbers) { + changeStuff( + thing: $cucumbers + ) { id, name, ... on Species { color }, ... family # background info, of course } } subscription watchStuff { - field, otherField + field(emptyObj: {}), otherField } # a fragment: fragment family on Species { family { - name, # name of the family + name, # name of the family members(first: 3, query: {isPlant: true}) # some of the other examples } } fragment nonsense on NonsenseType @skip(if: true) { bogus } @@ -123,9 +125,11 @@ it 'gets objects' do assert(parser.value.parse_with_debug('{name: "tomato", calories: 50}'), 'gets scalar values') assert(parser.value.parse_with_debug('{listOfValues: [1, 2, [3]], nestedObject: {nestedKey: "nested{Value}"}}'), 'gets complex values') assert(parser.value.parse_with_debug('{variableKey: $variableValue}'), 'gets variables') + assert(parser.value.parse_with_debug('{}'), 'gets empty') + assert(parser.value.parse_with_debug('{ }'), 'gets empty') end it 'gets enums' do assert(parser.value.parse_with_debug("MY_ENUM"), 'gets enums') end