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 TypePrinter<GraphQLObjectType> objectPrinter() { return (out, type, visibility) -> { if (isIntrospectionType(type)) { return; } printComments(out, type, ""); if (type.getInterfaces().isEmpty()) { out.format("type %s%s {\n", type.getName(), directivesString(type.getDirectives())); } else { Stream<String> interfaceNames = type.getInterfaces() .stream() .map(GraphQLType::getName) .sorted(Comparator.naturalOrder()); out.format("type %s implements %s%s {\n", type.getName(), interfaceNames.collect(joining(" & ")), directivesString(type.getDirectives())); } visibility.getFieldDefinitions(type) .stream() .sorted(Comparator.comparing(GraphQLFieldDefinition::getName)) .forEach(fd -> { printComments(out, fd, " "); out.format(" %s%s: %s%s\n", fd.getName(), argsString(fd.getArguments()), typeString(fd.getType()), directivesString(fd.getDirectives())); }); out.format("}\n\n"); }; }
public GraphQLObjectType onObject(GraphQLObjectType element, Parameters params) { return wireForEachDirective(params, element, element.getDirectives(), (outputElement, directive) -> new SchemaDirectiveWiringEnvironmentImpl<>(outputElement, directive, params.getNodeParentTree(), params.getTypeRegistry(), params.getContext(), params.getCodeRegistry(), params.getFieldsContainer()), SchemaDirectiveWiring::onObject); }
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)); }
out.format("type %s%s {\n", type.getName(), directivesString(GraphQLObjectType.class, type.getDirectives())); } else { type.getName(), interfaceNames.collect(joining(" & ")), directivesString(GraphQLObjectType.class, type.getDirectives()));
public GraphQLObjectType onObject(GraphQLObjectType element, Parameters params) { return wireForEachDirective(params, element, element.getDirectives(), (outputElement, directive) -> new SchemaDirectiveWiringEnvironmentImpl<>(outputElement, directive, params.getNodeParentTree(), params.getTypeRegistry(), params.getContext(), params.getCodeRegistry(), params.getFieldsContainer()), SchemaDirectiveWiring::onObject); }