| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 61d7c7b commit fccc0c7
17 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -390,6 +390,11 @@ private void checkInputFields(DiffCtx ctx, TypeDefinition old, List<InputValueDe | |||
| 390 | 390 | oldField.getName(), getAstDesc(oldField.getType()), getAstDesc(newField.get().getType())) | |
| 391 | 391 | .build()); | |
| 392 | 392 | } | |
| 393 | + | ||
| 394 | + // | ||
| 395 | + // recurse via input types | ||
| 396 | + // | ||
| 397 | + checkType( ctx, oldField.getType(), newField.get().getType() ); | ||
| 393 | 398 | } | |
| 394 | 399 | } | |
| 395 | 400 | ||
@@ -854,6 +859,6 @@ private static String capitalize(String name) { | |||
| 854 | 859 | } | |
| 855 | 860 | ||
| 856 | 861 | private String mkDotName(String... objectNames) { | |
| 857 | - return Arrays.stream(objectNames).collect(Collectors.joining(".")); | ||
| 862 | + return String.join(".", objectNames); | ||
| 858 | 863 | } | |
| 859 | 864 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -317,6 +317,21 @@ class SchemaDiffTest extends Specification { | |||
| 317 | 317 | ||
| 318 | 318 | } | |
| 319 | 319 | ||
| 320 | + def "changed nested input object field types"() { | ||
| 321 | + DiffSet diffSet = diffSet("schema_changed_nested_input_object_fields.graphqls") | ||
| 322 | + | ||
| 323 | + def diff = new SchemaDiff() | ||
| 324 | + diff.diffSchema(diffSet, chainedReporter) | ||
| 325 | + | ||
| 326 | + expect: | ||
| 327 | + reporter.breakageCount == 1 | ||
| 328 | + reporter.breakages[0].category == DiffCategory.INVALID | ||
| 329 | + reporter.breakages[0].typeName == 'NestedInput' | ||
| 330 | + reporter.breakages[0].typeKind == TypeKind.InputObject | ||
| 331 | + reporter.breakages[0].fieldName == 'nestedInput' | ||
| 332 | + | ||
| 333 | + } | ||
| 334 | + | ||
| 320 | 335 | def "changed input object field types"() { | |
| 321 | 336 | DiffSet diffSet = diffSet("schema_changed_input_object_fields.graphqls") | |
| 322 | 337 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,11 @@ type Mutation { | |||
| 24 | 24 | input Questor { | |
| 25 | 25 | beingID : ID | |
| 26 | 26 | queryTarget : String | |
| 27 | + nestedInput : NestedInput | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + input NestedInput { | ||
| 31 | + nestedInput: String | ||
| 27 | 32 | } | |
| 28 | 33 | ||
| 29 | 34 | scalar CustomScalar | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,11 @@ type Mutation { | |||
| 25 | 25 | input Questor { | |
| 26 | 26 | beingID : ID | |
| 27 | 27 | queryTarget : String | |
| 28 | + nestedInput : NestedInput | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + input NestedInput { | ||
| 32 | + nestedInput: String | ||
| 28 | 33 | } | |
| 29 | 34 | ||
| 30 | 35 | scalar CustomScalar | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,9 +24,14 @@ type Mutation { | |||
| 24 | 24 | input Questor { | |
| 25 | 25 | beingID : ID | |
| 26 | 26 | queryTarget : Int | |
| 27 | + nestedInput : NestedInput | ||
| 27 | 28 | newMandatoryField : String! | |
| 28 | 29 | } | |
| 29 | 30 | ||
| 31 | + input NestedInput { | ||
| 32 | + nestedInput: String | ||
| 33 | + } | ||
| 34 | + | ||
| 30 | 35 | scalar CustomScalar | |
| 31 | 36 | ||
| 32 | 37 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,81 @@ | |||
| 1 | + schema { | ||
| 2 | + query : Query | ||
| 3 | + mutation : Mutation | ||
| 4 | + } | ||
| 5 | + | ||
| 6 | + type Query { | ||
| 7 | + being(id : ID, type : String = "wizard") : Being | ||
| 8 | + beings(type : String) : [Being] | ||
| 9 | + | ||
| 10 | + wizards : [Istari] | ||
| 11 | + gods : [Ainur] | ||
| 12 | + deities : [Deity] | ||
| 13 | + | ||
| 14 | + allCharacters : [Character!] @deprecated(reason: "no longer supported") | ||
| 15 | + | ||
| 16 | + customScalar : CustomScalar | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + type Mutation { | ||
| 20 | + being(questor : Questor) : Query | ||
| 21 | + sword(bearer : Questor, name : String, alloy : String, temperament : Temperament) : String | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + input Questor { | ||
| 25 | + beingID : ID | ||
| 26 | + queryTarget : String | ||
| 27 | + nestedInput : NestedInput | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + input NestedInput { | ||
| 31 | + nestedInput: Int | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + scalar CustomScalar | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + interface Being { | ||
| 38 | + id : ID | ||
| 39 | + name : String | ||
| 40 | + nameInQuenyan : String | ||
| 41 | + invitedBy(id : ID) : Being | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + | ||
| 45 | + type Ainur implements Being { | ||
| 46 | + id : ID | ||
| 47 | + name : String | ||
| 48 | + nameInQuenyan : String | ||
| 49 | + invitedBy(id : ID) : Being | ||
| 50 | + loves : String | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + type Istari implements Being { | ||
| 55 | + id : ID | ||
| 56 | + name : String | ||
| 57 | + nameInQuenyan : String | ||
| 58 | + invitedBy(id : ID) : Being | ||
| 59 | + colour : String | ||
| 60 | + temperament : Temperament! | ||
| 61 | + | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + type Deity implements Being { | ||
| 65 | + id : ID | ||
| 66 | + name : String | ||
| 67 | + nameInQuenyan : String | ||
| 68 | + invitedBy(id : ID) : Being | ||
| 69 | + outlook : String | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + union Character = Ainur | Istari | Deity | ||
| 73 | + | ||
| 74 | + enum Temperament { | ||
| 75 | + Hero | ||
| 76 | + Duplicitous | ||
| 77 | + Evil | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + | ||
| 81 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,11 @@ type Mutation { | |||
| 30 | 30 | input Questor { | |
| 31 | 31 | beingID : ID | |
| 32 | 32 | queryTarget : String | |
| 33 | + nestedInput : NestedInput | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + input NestedInput { | ||
| 37 | + nestedInput: String | ||
| 33 | 38 | } | |
| 34 | 39 | ||
| 35 | 40 | scalar CustomScalar | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,11 @@ type Mutation { | |||
| 24 | 24 | input Questor { | |
| 25 | 25 | beingID : ID | |
| 26 | 26 | queryTarget : String | |
| 27 | + nestedInput : NestedInput | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + input NestedInput { | ||
| 31 | + nestedInput: String | ||
| 27 | 32 | } | |
| 28 | 33 | ||
| 29 | 34 | scalar CustomScalar | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,11 @@ type Mutation { | |||
| 24 | 24 | input Questor { | |
| 25 | 25 | beingID : ID | |
| 26 | 26 | queryTarget : String | |
| 27 | + nestedInput : NestedInput | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + input NestedInput { | ||
| 31 | + nestedInput: String | ||
| 27 | 32 | } | |
| 28 | 33 | ||
| 29 | 34 | scalar CustomScalar | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,11 @@ type Mutation { | |||
| 24 | 24 | input Questor { | |
| 25 | 25 | beingID : ID | |
| 26 | 26 | queryTarget : String | |
| 27 | + nestedInput : NestedInput | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + input NestedInput { | ||
| 31 | + nestedInput: String | ||
| 27 | 32 | } | |
| 28 | 33 | ||
| 29 | 34 | scalar CustomScalar | |
| Back | FazBrowse Home | New Git URL |
0 commit comments