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


Java GraphQLObjectType.getFieldDefinitions方法代码示例

本文整理汇总了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));
}
 
开发者ID:google,项目名称:rejoiner,代码行数:15,代码来源:SchemaToProto.java

示例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();
}
 
开发者ID:google,项目名称:rejoiner,代码行数:15,代码来源:Type.java

示例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;
}
 
开发者ID:leangen,项目名称:graphql-spqr,代码行数:6,代码来源:MappedGraphQLObjectType.java


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