|
1457 | 1457 | "query": "\n query Foo($a: String, $b: String, $c: String) {\n field(a: $a) {\n field(b: $b) {\n field(c: $c)\n }\n }\n }\n ",
|
1458 | 1458 | "errors": []
|
1459 | 1459 | },
|
| 1460 | + { |
| 1461 | + "name": "Validate: No invalid default String variable values", |
| 1462 | + "rule": "DefaultValuesOfCorrectType", |
| 1463 | + "schema": 0, |
| 1464 | + "query": "\n query Foo($a: String = -\"\") {\n field(a: $a)\n }\n ", |
| 1465 | + "errors": [ |
| 1466 | + { |
| 1467 | + "message": "Variable \"$a\" of type \"String\" has invalid default value -\"\".\nExpected type \"String\", found -\"\".", |
| 1468 | + "locations": [ |
| 1469 | + { |
| 1470 | + "line": 2, |
| 1471 | + "column": 30 |
| 1472 | + } |
| 1473 | + ] |
| 1474 | + } |
| 1475 | + ] |
| 1476 | + }, |
| 1477 | + { |
| 1478 | + "name": "Validate: No invalid default Int variable values/bad input", |
| 1479 | + "rule": "DefaultValuesOfCorrectType", |
| 1480 | + "schema": 0, |
| 1481 | + "query": "\n query Foo($a: Int = -\"\") {\n field(a: $a)\n }\n ", |
| 1482 | + "errors": [ |
| 1483 | + { |
| 1484 | + "message": "Variable \"$a\" of type \"Int\" has invalid default value -\"\".\nExpected type \"Int\", found -\"\".", |
| 1485 | + "locations": [ |
| 1486 | + { |
| 1487 | + "line": 2, |
| 1488 | + "column": 27 |
| 1489 | + } |
| 1490 | + ] |
| 1491 | + } |
| 1492 | + ] |
| 1493 | + }, |
| 1494 | + { |
| 1495 | + "name": "Validate: No invalid default Int variable values/value out of range", |
| 1496 | + "rule": "DefaultValuesOfCorrectType", |
| 1497 | + "schema": 0, |
| 1498 | + "query": "\n query Foo($a: Int = -2147483649) {\n field(a: $a)\n }\n ", |
| 1499 | + "errors": [ |
| 1500 | + { |
| 1501 | + "message": "Variable \"$a\" of type \"Int\" has invalid default value -2147483649.\nExpected type \"Int\", found -2147483649.", |
| 1502 | + "locations": [ |
| 1503 | + { |
| 1504 | + "line": 2, |
| 1505 | + "column": 27 |
| 1506 | + } |
| 1507 | + ] |
| 1508 | + } |
| 1509 | + ] |
| 1510 | + }, |
| 1511 | + { |
| 1512 | + "name": "Validate: No invalid default Float variable values", |
| 1513 | + "rule": "DefaultValuesOfCorrectType", |
| 1514 | + "schema": 0, |
| 1515 | + "query": "\n query Foo($a: Float = -\"\") {\n field(a: $a)\n }\n ", |
| 1516 | + "errors": [ |
| 1517 | + { |
| 1518 | + "message": "Variable \"$a\" of type \"Float\" has invalid default value -\"\".\nExpected type \"Float\", found -\"\".", |
| 1519 | + "locations": [ |
| 1520 | + { |
| 1521 | + "line": 2, |
| 1522 | + "column": 29 |
| 1523 | + } |
| 1524 | + ] |
| 1525 | + } |
| 1526 | + ] |
| 1527 | + }, |
| 1528 | + { |
| 1529 | + "name": "Validate: No invalid default Float variable values/value out of range", |
| 1530 | + "rule": "DefaultValuesOfCorrectType", |
| 1531 | + "schema": 0, |
| 1532 | + "query": "\n query Foo($a: Float = 1.8e+308) {\n field(a: $a)\n }\n ", |
| 1533 | + "errors": [ |
| 1534 | + { |
| 1535 | + "message": "Variable \"$a\" of type \"Float\" has invalid default value 1.8e+308.\nExpected type \"Float\", found 1.8e+308.", |
| 1536 | + "locations": [ |
| 1537 | + { |
| 1538 | + "line": 2, |
| 1539 | + "column": 29 |
| 1540 | + } |
| 1541 | + ] |
| 1542 | + } |
| 1543 | + ] |
| 1544 | + }, |
| 1545 | + { |
| 1546 | + "name": "Validate: No invalid default Boolean variable values", |
| 1547 | + "rule": "DefaultValuesOfCorrectType", |
| 1548 | + "schema": 0, |
| 1549 | + "query": "\n query Foo($a: Boolean = \"false\") {\n field(a: $a)\n }\n ", |
| 1550 | + "errors": [ |
| 1551 | + { |
| 1552 | + "message": "Variable \"$a\" of type \"Boolean\" has invalid default value \"false\".\nExpected type \"Boolean\", found \"false\".", |
| 1553 | + "locations": [ |
| 1554 | + { |
| 1555 | + "line": 2, |
| 1556 | + "column": 31 |
| 1557 | + } |
| 1558 | + ] |
| 1559 | + } |
| 1560 | + ] |
| 1561 | + }, |
| 1562 | + { |
| 1563 | + "name": "Validate: No invalid default ID variable values", |
| 1564 | + "rule": "DefaultValuesOfCorrectType", |
| 1565 | + "schema": 0, |
| 1566 | + "query": "\n query Foo($a: ID = false) {\n field(a: $a)\n }\n ", |
| 1567 | + "errors": [ |
| 1568 | + { |
| 1569 | + "message": "Variable \"$a\" of type \"ID\" has invalid default value false.\nExpected type \"ID\", found false.", |
| 1570 | + "locations": [ |
| 1571 | + { |
| 1572 | + "line": 2, |
| 1573 | + "column": 26 |
| 1574 | + } |
| 1575 | + ] |
| 1576 | + } |
| 1577 | + ] |
| 1578 | + }, |
1460 | 1579 | {
|
1461 | 1580 | "name": "Validate: No unused variables/uses all variables deeply in inline fragments",
|
1462 | 1581 | "rule": "NoUnusedVariables",
|
|
0 commit comments