Skip to content

Commit 431affc

Browse files
committed
fix missing GraphQLAppliedDirectiveArgument: type child was not considered
1 parent d9c1399 commit 431affc

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/main/java/graphql/schema/GraphQLAppliedDirectiveArgument.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.jetbrains.annotations.NotNull;
1212
import org.jetbrains.annotations.Nullable;
1313

14+
import java.util.ArrayList;
1415
import java.util.List;
1516
import java.util.function.Consumer;
1617

@@ -34,6 +35,8 @@ public class GraphQLAppliedDirectiveArgument implements GraphQLNamedSchemaElemen
3435
private final Argument definition;
3536

3637

38+
public static final String CHILD_TYPE = "type";
39+
3740
private GraphQLAppliedDirectiveArgument(String name,
3841
InputValueWithState value,
3942
GraphQLInputType type,
@@ -104,19 +107,23 @@ public Argument getDefinition() {
104107

105108
@Override
106109
public List<GraphQLSchemaElement> getChildren() {
107-
return ImmutableKit.emptyList();
110+
List<GraphQLSchemaElement> children = new ArrayList<>();
111+
children.add(getType());
112+
return children;
108113
}
109114

110-
111115
@Override
112116
public SchemaElementChildrenContainer getChildrenWithTypeReferences() {
113117
return SchemaElementChildrenContainer.newSchemaElementChildrenContainer()
118+
.child(CHILD_TYPE, originalType)
114119
.build();
115120
}
116121

117122
@Override
118123
public GraphQLAppliedDirectiveArgument withNewChildren(SchemaElementChildrenContainer newChildren) {
119-
return this;
124+
return transform(builder ->
125+
builder.type(newChildren.getChildOrNull(CHILD_TYPE))
126+
);
120127
}
121128

122129
@Override

0 commit comments

Comments
 (0)