ProtoRegistry.java 文件源码

java
阅读 38 收藏 0 点赞 0 评论 0

项目:rejoiner 作者:
ProtoRegistry build() {
  ImmutableListMultimap<String, TypeModification> modificationsMap =
      ImmutableListMultimap.copyOf(
          this.typeModifications
              .stream()
              .map(
                  modification ->
                      new SimpleImmutableEntry<>(modification.getTypeName(), modification))
              .collect(Collectors.toList()));

  final BiMap<String, GraphQLType> mapping = HashBiMap.create();

  GraphQLInterfaceType nodeInterface =
      new Relay()
          .nodeInterface(
              env -> {
                Relay.ResolvedGlobalId resolvedGlobalId =
                    new Relay().fromGlobalId(env.getArguments().get("id").toString());
                return (GraphQLObjectType) mapping.get(resolvedGlobalId.getType());
              });

  mapping.putAll(
      modifyTypes(
          getMap(fileDescriptors, descriptors, enumDescriptors, nodeInterface),
          modificationsMap));

  return new ProtoRegistry(mapping, nodeInterface);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号