spec/graph_ql/parser/parser_spec.rb in graphql-0.2.0 vs spec/graph_ql/parser/parser_spec.rb in graphql-0.3.0

- old
+ new

@@ -7,11 +7,15 @@ assert(parser.parse_with_debug(%| # let's make a big query: # a read-only: query getStuff {id, name @skip(if: true)} # a mutation: - mutation changeStuff($override: Boolean!, $cucumbers: [Vegetable]!) @veggie, @healthy(vitamins: true) { + mutation changeStuff( + $override: Boolean = true, + $cucumbers: [Vegetable]!, + $input: SomeInputType = {key: "value"}, + ) @veggie, @healthy(vitamins: true) { # change the cucumber changeStuff(thing: $cucumbers) { id, name, ... on Species { color }, @@ -70,10 +74,10 @@ it 'parses variable definitions' do assert(parser.operation_variable_definition.parse_with_debug("$myVar: Boolean = true"), "it gets variables with defaults") assert(parser.operation_variable_definition.parse_with_debug("$myVar: [Int]"), "it gets list variables") assert(parser.operation_variable_definition.parse_with_debug("$myVar: Elephant!"), "it gets non-null variables") assert(parser.operation_variable_definition.parse_with_debug("$myVar: [Food]!"), "it gets non-null list variables") - assert(parser.operation_variable_definitions.parse_with_debug(%|($myVar: Elephant!, $myList: [Float], $myString: String="Cheese")|), "it gets a list of defns") + assert(parser.operation_variable_definitions.parse_with_debug(%|($myVar: Elephant!, $myList: [Float], $myString: String = "Cheese")|), "it gets a list of defns") end describe 'value' do it 'gets ints' do assert(parser.value.parse_with_debug("100"), 'positive')