|
12 | 12 | yakSource: searchDairy(product: [{source: COW, fatContent: 1.1}]) { __typename }
|
13 | 13 | badSource: searchDairy(product: [{source: 1.1}]) { __typename }
|
14 | 14 | missingSource: searchDairy(product: [{fatContent: 1.1}]) { __typename }
|
| 15 | + missingNestedRequiredInputObjectAttribute: searchDairy(product: [{fatContent: 1.2, order_by: {}}]) { __typename } |
15 | 16 | listCoerce: cheese(id: 1) { similarCheese(source: YAK) { __typename } }
|
16 | 17 | missingInputField: searchDairy(product: [{source: YAK, wacky: 1}]) { __typename }
|
17 | 18 | }
|
|
42 | 43 | "inputObjectType"=>"DairyProductInput"
|
43 | 44 | }
|
44 | 45 | }
|
| 46 | + missing_order_by_direction_error = { |
| 47 | + "message"=>"Argument 'direction' on InputObject 'ResourceOrderType' is required. Expected type String!", |
| 48 | + "locations"=>[{"line"=>8, "column"=>100}], |
| 49 | + "path"=>["query getCheese", "missingNestedRequiredInputObjectAttribute", "product", "order_by", "direction"], |
| 50 | + "extensions"=>{ |
| 51 | + "code"=>"missingRequiredInputObjectAttribute", |
| 52 | + "argumentName"=>"direction", |
| 53 | + "argumentType"=>"String!", |
| 54 | + "inputObjectType"=>"ResourceOrderType" |
| 55 | + } |
| 56 | + } |
45 | 57 | it "finds undefined or missing-required arguments to fields and directives" do
|
46 | 58 | without_error_bubbling(schema) do
|
47 | 59 | assert_includes(errors, missing_source_error)
|
| 60 | + assert_includes(errors, missing_order_by_direction_error) |
48 | 61 | refute_includes(errors, missing_required_field_error)
|
49 | 62 | end
|
50 | 63 | end
|
| 64 | + # focus |
51 | 65 | it 'works with error bubbling enabled' do
|
52 | 66 | with_error_bubbling(schema) do
|
53 | 67 | assert_includes(errors, missing_required_field_error)
|
54 | 68 | assert_includes(errors, missing_source_error)
|
| 69 | + assert_includes(errors, missing_order_by_direction_error) |
55 | 70 | end
|
56 | 71 | end
|
57 | 72 | end
|
|
0 commit comments