public Builder(GraphQLInterfaceType existing) { this.name = existing.getName(); this.description = existing.getDescription(); this.typeResolver = existing.getTypeResolver(); this.definition = existing.getDefinition(); this.fields.putAll(getByName(existing.getFieldDefinitions(), GraphQLFieldDefinition::getName)); this.directives.putAll(getByName(existing.getDirectives(), GraphQLDirective::getName)); }
private TypePrinter<GraphQLInterfaceType> interfacePrinter() { return (out, type, visibility) -> { if (isIntrospectionType(type)) { return; } printComments(out, type, ""); out.format("interface %s%s {\n", type.getName(), 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 GraphQLInterfaceType onInterface(GraphQLInterfaceType 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::onInterface); }
public Builder(GraphQLInterfaceType existing) { this.name = existing.getName(); this.description = existing.getDescription(); this.typeResolver = existing.getTypeResolver(); this.definition = existing.getDefinition(); this.fields.putAll(getByName(existing.getFieldDefinitions(), GraphQLFieldDefinition::getName)); this.directives.putAll(getByName(existing.getDirectives(), GraphQLDirective::getName)); }
public GraphQLInterfaceType onInterface(GraphQLInterfaceType 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::onInterface); }
private TypePrinter<GraphQLInterfaceType> interfacePrinter() { return (out, type, visibility) -> { if (isIntrospectionType(type)) { return; } SchemaPrinterComparatorEnvironment environment = SchemaPrinterComparatorEnvironment.newEnvironment() .parentType(GraphQLInterfaceType.class) .elementType(GraphQLFieldDefinition.class) .build(); Comparator<? super GraphQLType> comparator = options.comparatorRegistry.getComparator(environment); printComments(out, type, ""); out.format("interface %s%s {\n", type.getName(), directivesString(GraphQLInterfaceType.class, type.getDirectives())); visibility.getFieldDefinitions(type) .stream() .sorted(comparator) .forEach(fd -> { printComments(out, fd, " "); out.format(" %s%s: %s%s\n", fd.getName(), argsString(GraphQLFieldDefinition.class, fd.getArguments()), typeString(fd.getType()), directivesString(GraphQLFieldDefinition.class, fd.getDirectives())); }); out.format("}\n\n"); }; }