Skip to content

Commit eecada7

Browse files
committed
fixing tests
1 parent 4268506 commit eecada7

4 files changed

Lines changed: 21 additions & 8 deletions

File tree

‎src/main/java/graphql/language/Field.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ private Field(String name,
3838
this.selectionSet = selectionSet;
3939
}
4040

41+
public Field(String name) {
42+
this(name, null, new ArrayList<>(), new ArrayList<>(), null, null, new ArrayList<>());
43+
}
44+
4145
@Override
4246
public List<Node> getChildren() {
4347
List<Node> result = new ArrayList<>();

‎src/main/java/graphql/language/ObjectField.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ private ObjectField(String name, Value value, SourceLocation sourceLocation, Lis
2121
this.value = value;
2222
}
2323

24+
/**
25+
* alternative to using a Builder for convenience
26+
*/
27+
public ObjectField(String name, Value value) {
28+
this(name, value, null, new ArrayList<>());
29+
}
30+
2431
@Override
2532
public String getName() {
2633
return name;

‎src/main/java/graphql/language/ObjectValue.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ private ObjectValue(List<ObjectField> objectFields, SourceLocation sourceLocatio
1919
this.objectFields.addAll(objectFields);
2020
}
2121

22+
23+
/**
24+
* alternative to using a Builder for convenience
25+
*/
26+
public ObjectValue(List<ObjectField> objectFields) {
27+
this(objectFields, null, new ArrayList<>());
28+
}
29+
2230
public List<ObjectField> getObjectFields() {
2331
return new ArrayList<>(objectFields);
2432
}

‎src/main/java/graphql/language/VariableDefinition.java‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,15 @@ private VariableDefinition(String name,
3333
public VariableDefinition(String name,
3434
Type type,
3535
Value defaultValue) {
36-
super(null, new ArrayList<>());
37-
this.name = name;
38-
this.type = type;
39-
this.defaultValue = defaultValue;
36+
this(name, type, defaultValue, null, new ArrayList<>());
4037
}
4138

4239
/**
4340
* alternative to using a Builder for convenience
4441
*/
4542
public VariableDefinition(String name,
4643
Type type) {
47-
super(null, new ArrayList<>());
48-
this.name = name;
49-
this.type = type;
50-
this.defaultValue = null;
44+
this(name, type, null, null, new ArrayList<>());
5145
}
5246

5347

0 commit comments

Comments
 (0)