本文整理汇总了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();
}
示例2: getTypeResolver
import graphql.schema.TypeResolver; //导入依赖的package包/类
@Override
public TypeResolver getTypeResolver(Object object) {
if (typeResolver == null) {
typeResolver = new TypeResolver_BuildContextAware(getContext());
}
return typeResolver;
}
示例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;
};
}
示例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;
};
}
示例5: getTypeResolver
import graphql.schema.TypeResolver; //导入依赖的package包/类
protected TypeResolver getTypeResolver(Object object) {
return getStrategies().getTypeResolverStrategy().getTypeResolver(object);
}
示例6: getTypeResolver
import graphql.schema.TypeResolver; //导入依赖的package包/类
@Override
public TypeResolver getTypeResolver(InterfaceWiringEnvironment environment) {
return objectTypeResolver;
}
示例7: getTypeResolver
import graphql.schema.TypeResolver; //导入依赖的package包/类
TypeResolver getTypeResolver(Object object);