use of graphql.language.Value in project graphql-java by graphql-java.
the class IntrospectionResultToSchema method createInputValueDefinitions.
@SuppressWarnings("unchecked")
private List<InputValueDefinition> createInputValueDefinitions(List<Map<String, Object>> args) {
List<InputValueDefinition> result = new ArrayList<>();
for (Map<String, Object> arg : args) {
Type argType = createTypeIndirection((Map<String, Object>) arg.get("type"));
InputValueDefinition inputValueDefinition = new InputValueDefinition((String) arg.get("name"), argType);
inputValueDefinition.setComments(toComment((String) arg.get("description")));
String valueLiteral = (String) arg.get("defaultValue");
if (valueLiteral != null) {
Value defaultValue = AstValueHelper.valueFromAst(valueLiteral);
inputValueDefinition.setDefaultValue(defaultValue);
}
result.add(inputValueDefinition);
}
return result;
}
Aggregations