spec/graphql/language/parser_spec.rb in graphql-0.9.5 vs spec/graphql/language/parser_spec.rb in graphql-0.10.0
- old
+ new
@@ -40,10 +40,11 @@
it 'parses operation definitions' do
assert(parser.operation_definition.parse_with_debug(%|{id, name, ...people}|), "just a selection")
assert(parser.operation_definition.parse_with_debug(%|query personStuff {id, name, ...people, ... stuff}|), "named fetch")
assert(parser.operation_definition.parse_with_debug(%|query personStuff @flagDirective {id, name, ...people}|), "with a directive")
- assert(parser.operation_definition.parse_with_debug(%|mutation changeStuff($stuff: Int = 1, $things: [SomeType]!) {id, name, ...people}|), "mutation with arguments")
+ assert(parser.operation_definition.parse_with_debug(%|mutation changeStuff($stuff: Int = 1 $things: [SomeType]! = [{something: 1}, {something: 2}], $another: Sometype = {something: 3}) { id }|), "mutation with arguments")
+ assert(parser.operation_definition.parse_with_debug(%|mutation { id }|), "unnamed")
end
it 'parses fragment definitions' do
assert(parser.fragment_definition.parse_with_debug(%|fragment nutritionFacts on Food { fat, sodium, carbohydrates, vitamins { a, b } }|))
assert(parser.fragment_definition.parse_with_debug(%|fragment nutritionFacts on Food @directive(key: 1) { fat, sodium, carbohydrates, vitamins { a, b } }|), 'gets directives')