本文整理汇总了Java中graphql.schema.GraphQLObjectType.getFieldDefinitions方法的典型用法代码示例。如果您正苦于以下问题:Java GraphQLObjectType.getFieldDefinitions方法的具体用法?Java GraphQLObjectType.getFieldDefinitions怎么用?Java GraphQLObjectType.getFieldDefinitions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graphql.schema.GraphQLObjectType
的用法示例。
在下文中一共展示了GraphQLObjectType.getFieldDefinitions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: basicsOutput
import graphql.schema.GraphQLObjectType; //导入方法依赖的package包/类
public void basicsOutput() {
GraphQLType type = generator.getOutputType(clazz);
Assert.assertThat(type,
instanceOf(GraphQLObjectType.class));
GraphQLObjectType objectType = (GraphQLObjectType) type;
Assert.assertThat(objectType.getName(),
containsString(expectedName));
Assert.assertThat(objectType.getDescription(),
containsString("Autogenerated f"));
Assert.assertThat(objectType.getFieldDefinitions(),
notNullValue());
for (GraphQLFieldDefinition field : objectType.getFieldDefinitions()) {
Assert.assertThat(field,
notNullValue());
Assert.assertThat(field.getDescription(),
containsString("Autogenerated f"));
}
Assert.assertThat(objectType.getFieldDefinitions().size(),
is(expectedNumFields));
}
开发者ID:graphql-java,项目名称:graphql-java-type-generator,代码行数:21,代码来源:TypeGeneratorParameterizedTest.java
示例2: toMessage
import graphql.schema.GraphQLObjectType; //导入方法依赖的package包/类
private static String toMessage(GraphQLObjectType type) {
ArrayList<String> fields = new ArrayList<>();
fields.add(getJspb(type));
int i = 1;
for (GraphQLFieldDefinition field : type.getFieldDefinitions()) {
if (field.getName().equals("_")) {
continue;
}
fields.add(String.format("%s = %d;", toField(field), i));
i++;
}
return String.format("message %s {\n%s\n}", type.getName(), Joiner.on("\n").join(fields));
}
示例3: apply
import graphql.schema.GraphQLObjectType; //导入方法依赖的package包/类
@Override
public GraphQLObjectType apply(GraphQLObjectType input) {
ImmutableList.Builder<GraphQLFieldDefinition> remainingFields = ImmutableList.builder();
for (GraphQLFieldDefinition field : input.getFieldDefinitions()) {
if (!fieldNamesToRemove.contains(field.getName())) {
remainingFields.add(field);
}
}
return newObject()
.name(input.getName())
.description(input.getDescription())
.fields(remainingFields.build())
.build();
}
示例4: MappedGraphQLObjectType
import graphql.schema.GraphQLObjectType; //导入方法依赖的package包/类
public MappedGraphQLObjectType(GraphQLObjectType graphQLType, AnnotatedType javaType) {
super(graphQLType.getName(), graphQLType.getDescription(), graphQLType.getFieldDefinitions(),
graphQLType.getInterfaces());
this.javaType = javaType;
}