public GraphQLDirective buildDirectiveFromDefinition(DirectiveDefinition directiveDefinition, Function<Type, GraphQLInputType> inputTypeFactory) { GraphQLDirective.Builder builder = GraphQLDirective.newDirective() .name(directiveDefinition.getName()) .description(buildDescription(directiveDefinition, directiveDefinition.getDescription())); List<DirectiveLocation> locations = buildLocations(directiveDefinition); locations.forEach(builder::validLocations); List<GraphQLArgument> arguments = directiveDefinition.getInputValueDefinitions().stream() .map(arg -> buildDirectiveArgumentFromDefinition(arg, inputTypeFactory)) .collect(Collectors.toList()); arguments.forEach(builder::argument); return builder.build(); }
private Builder(DirectiveDefinition existing) { this.sourceLocation = existing.getSourceLocation(); this.comments = existing.getComments(); this.name = existing.getName(); this.description = existing.getDescription(); this.inputValueDefinitions = existing.getInputValueDefinitions(); this.directiveLocations = existing.getDirectiveLocations(); this.ignoredChars = existing.getIgnoredChars(); }
public GraphQLDirective buildDirectiveFromDefinition(DirectiveDefinition directiveDefinition, Function<Type, GraphQLInputType> inputTypeFactory) { GraphQLDirective.Builder builder = GraphQLDirective.newDirective() .name(directiveDefinition.getName()) .description(buildDescription(directiveDefinition, directiveDefinition.getDescription())); List<DirectiveLocation> locations = buildLocations(directiveDefinition); locations.forEach(builder::validLocations); List<GraphQLArgument> arguments = directiveDefinition.getInputValueDefinitions().stream() .map(arg -> buildDirectiveArgumentFromDefinition(arg, inputTypeFactory)) .collect(Collectors.toList()); arguments.forEach(builder::argument); return builder.build(); }
private Builder(DirectiveDefinition existing) { this.sourceLocation = existing.getSourceLocation(); this.comments = existing.getComments(); this.name = existing.getName(); this.description = existing.getDescription(); this.inputValueDefinitions = existing.getInputValueDefinitions(); this.directiveLocations = existing.getDirectiveLocations(); this.ignoredChars = existing.getIgnoredChars(); }