public GraphQLDirective getDirective(String name) { for (GraphQLDirective directive : getDirectives()) { if (directive.getName().equals(name)) { return directive; } } return null; }
void replaceTypeReferences(GraphQLSchema schema) { final Map<String, GraphQLType> typeMap = schema.getTypeMap(); List<GraphQLType> roots = new ArrayList<>(typeMap.values()); roots.addAll(schema.getDirectives()); TRAVERSER.depthFirst(new GraphQLTypeResolvingVisitor(typeMap), roots); }
Map<String, GraphQLType> allTypes(final GraphQLSchema schema, final Set<GraphQLType> additionalTypes) { List<GraphQLType> roots = new ArrayList<>(); roots.add(schema.getQueryType()); if (schema.isSupportingMutations()) { roots.add(schema.getMutationType()); } if (schema.isSupportingSubscriptions()) { roots.add(schema.getSubscriptionType()); } if (additionalTypes != null) { roots.addAll(additionalTypes); } if (schema.getDirectives() != null) { roots.addAll(schema.getDirectives()); } roots.add(Introspection.__Schema); GraphQLTypeCollectingVisitor visitor = new GraphQLTypeCollectingVisitor(); TRAVERSER.depthFirst(visitor, roots); return visitor.getResult(); }
public GraphQLDirective getDirective(String name) { for (GraphQLDirective directive : getDirectives()) { if (directive.getName().equals(name)) { return directive; } } return null; }
void replaceTypeReferences(GraphQLSchema schema) { final Map<String, GraphQLType> typeMap = schema.getTypeMap(); List<GraphQLType> roots = new ArrayList<>(typeMap.values()); roots.addAll(schema.getDirectives()); TRAVERSER.depthFirst(new GraphQLTypeResolvingVisitor(typeMap), roots); }
Map<String, GraphQLType> allTypes(final GraphQLSchema schema, final Set<GraphQLType> additionalTypes) { List<GraphQLType> roots = new ArrayList<>(); roots.add(schema.getQueryType()); if (schema.isSupportingMutations()) { roots.add(schema.getMutationType()); } if (schema.isSupportingSubscriptions()) { roots.add(schema.getSubscriptionType()); } if (additionalTypes != null) { roots.addAll(additionalTypes); } if (schema.getDirectives() != null) { roots.addAll(schema.getDirectives()); } roots.add(Introspection.__Schema); GraphQLTypeCollectingVisitor visitor = new GraphQLTypeCollectingVisitor(); TRAVERSER.depthFirst(visitor, roots); return visitor.getResult(); }