Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import static graphql.Assert.assertNotEmpty;
import static graphql.Assert.assertNotNull;
Expand Down Expand Up @@ -144,6 +145,7 @@ private DirectiveDefinition createDirective(Map<String, Object> input) {
List<Map<String, Object>> args = (List<Map<String, Object>>) input.get("args");
List<InputValueDefinition> inputValueDefinitions = createInputValueDefinitions(args);
directiveDefBuilder.inputValueDefinitions(inputValueDefinitions);
Optional.ofNullable((Boolean) input.get("isRepeatable")).ifPresent(value -> directiveDefBuilder.repeatable(value));

return directiveDefBuilder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,15 @@ directiveArg: String = "default Value") on FIELD | FRAGMENT_SPREAD | INLINE_FRAG
"defaultValue": "\\"default Value\\""
}
]
},
{
"name": "repeatableDirective",
"description": "repeatable directive",
"locations": [
"FIELD_DEFINITION"
],
"args": [],
"isRepeatable":true
}
]
}"""
Expand All @@ -797,6 +806,9 @@ directiveArg: String = "default Value") on FIELD | FRAGMENT_SPREAD | INLINE_FRAG
"customized directive"
directive @customizedDirective("directive arg"
directiveArg: String = "default Value") on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT

"repeatable directive"
directive @repeatableDirective repeatable on FIELD_DEFINITION
"""
}
}