当前位置: 首页>>代码示例>>Java>>正文


Java TypeResolver类代码示例

本文整理汇总了Java中graphql.schema.TypeResolver的典型用法代码示例。如果您正苦于以下问题:Java TypeResolver类的具体用法?Java TypeResolver怎么用?Java TypeResolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TypeResolver类属于graphql.schema包,在下文中一共展示了TypeResolver类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateInterfaceType

import graphql.schema.TypeResolver; //导入依赖的package包/类
protected GraphQLInterfaceType generateInterfaceType(Object object) {
    List<GraphQLFieldDefinition> fieldDefinitions = getOutputFieldDefinitions(object);
    if (fieldDefinitions == null || fieldDefinitions.isEmpty()) {
        return null;
    }
    String name = getGraphQLTypeNameOrIdentityCode(object);
    TypeResolver typeResolver = getTypeResolver(object);
    String description = getTypeDescription(object);
    if (name == null || fieldDefinitions == null || typeResolver == null) {
        return null;
    }
    GraphQLInterfaceType.Builder builder = GraphQLInterfaceType.newInterface()
            .description(description)
            .fields(fieldDefinitions)
            .name(name)
            .typeResolver(typeResolver);
    return builder.build();
}
 
开发者ID:graphql-java,项目名称:graphql-java-type-generator,代码行数:19,代码来源:FullTypeGenerator.java

示例2: getTypeResolver

import graphql.schema.TypeResolver; //导入依赖的package包/类
@Override
public TypeResolver getTypeResolver(Object object) {
    if (typeResolver == null) {
        typeResolver = new TypeResolver_BuildContextAware(getContext());
    }
    return typeResolver;
}
 
开发者ID:graphql-java,项目名称:graphql-java-type-generator,代码行数:8,代码来源:TypeResolverStrategy_Caching.java

示例3: getCharacterTypeResolver

import graphql.schema.TypeResolver; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "SuspiciousMethodCalls"})
static TypeResolver getCharacterTypeResolver() {
    return object -> {
        Object id = ((Map<String, Object>) object).get("id");
        if (humanData.containsKey(id)) {
            return StarWarsSchema.humanType;
        }
        return null;
    };
}
 
开发者ID:engagingspaces,项目名称:vertx-graphql-service-discovery,代码行数:11,代码来源:HumanData.java

示例4: getCharacterTypeResolver

import graphql.schema.TypeResolver; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "SuspiciousMethodCalls"})
static TypeResolver getCharacterTypeResolver() {
    return object -> {
        Object id = ((Map<String, Object>) object).get("id");
        if (droidData.containsKey(id)) {
            return DroidsSchema.droidType;
        }
        return null;
    };
}
 
开发者ID:engagingspaces,项目名称:vertx-graphql-service-discovery,代码行数:11,代码来源:DroidsData.java

示例5: getTypeResolver

import graphql.schema.TypeResolver; //导入依赖的package包/类
protected TypeResolver getTypeResolver(Object object) {
    return getStrategies().getTypeResolverStrategy().getTypeResolver(object);
}
 
开发者ID:graphql-java,项目名称:graphql-java-type-generator,代码行数:4,代码来源:TypeGenerator.java

示例6: getTypeResolver

import graphql.schema.TypeResolver; //导入依赖的package包/类
@Override
public TypeResolver getTypeResolver(InterfaceWiringEnvironment environment) {
  return objectTypeResolver;
}
 
开发者ID:HuygensING,项目名称:timbuctoo,代码行数:5,代码来源:RdfWiringFactory.java

示例7: getTypeResolver

import graphql.schema.TypeResolver; //导入依赖的package包/类
TypeResolver getTypeResolver(Object object); 
开发者ID:graphql-java,项目名称:graphql-java-type-generator,代码行数:2,代码来源:TypeResolverStrategy.java


注:本文中的graphql.schema.TypeResolver类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。