public Builder(GraphQLObjectType existing) { name = existing.getName(); description = existing.getDescription(); definition = existing.getDefinition(); fields.putAll(getByName(existing.getFieldDefinitions(), GraphQLFieldDefinition::getName)); interfaces.putAll(getByName(existing.getInterfaces(), GraphQLType::getName)); directives.putAll(getByName(existing.getDirectives(), GraphQLDirective::getName)); }
private AstDescriptionAndComments getDescriptionAndComments(Object descriptionHolder) { if (descriptionHolder instanceof GraphQLObjectType) { GraphQLObjectType type = (GraphQLObjectType) descriptionHolder; return descriptionAndComments(type::getDescription, type::getDefinition, () -> type.getDefinition().getDescription()); } else if (descriptionHolder instanceof GraphQLEnumType) { GraphQLEnumType type = (GraphQLEnumType) descriptionHolder;
public static Optional<String> getDirectiveArgument(GraphQLObjectType parentType, String directiveName, String argumentName) { return Optional.ofNullable(parentType.getDefinition().getDirective(directiveName)) .map(d -> d.getArgument(argumentName)) .map(v -> (StringValue) v.getValue()) .map(StringValue::getValue); }
public Builder(GraphQLObjectType existing) { name = existing.getName(); description = existing.getDescription(); definition = existing.getDefinition(); fields.putAll(getByName(existing.getFieldDefinitions(), GraphQLFieldDefinition::getName)); interfaces.putAll(getByName(existing.getInterfaces(), GraphQLType::getName)); directives.putAll(getByName(existing.getDirectives(), GraphQLDirective::getName)); }
private AstDescriptionAndComments getDescriptionAndComments(Object descriptionHolder) { if (descriptionHolder instanceof GraphQLObjectType) { GraphQLObjectType type = (GraphQLObjectType) descriptionHolder; return descriptionAndComments(type::getDescription, type::getDefinition, () -> type.getDefinition().getDescription()); } else if (descriptionHolder instanceof GraphQLEnumType) { GraphQLEnumType type = (GraphQLEnumType) descriptionHolder;