@Test public void noQueries_shouldThrowException() { graphQlSchemaBuilder = new GraphQlSchemaBuilderImpl(graphQlProperties, getGraphQlFields(new DummyGraphQlFieldWithBase(false, true))); val exception = assertThatThrownBy(() -> graphQlSchemaBuilder.postConstruct()); exception.isExactlyInstanceOf(AssertException.class).hasMessage("queryType can't be null"); }
@PostConstruct public void postConstruct() { GraphQLObjectType.Builder queryBuilder = newObject().name(properties.getRootQueryName()); GraphQLObjectType.Builder mutationBuilder = newObject().name(properties.getRootMutationName()); if (StringUtils.hasText(properties.getRootQueryDescription())) { queryBuilder = queryBuilder.description(properties.getRootQueryDescription()); } if (StringUtils.hasText(properties.getRootMutationDescription())) { mutationBuilder = mutationBuilder.description(properties.getRootMutationDescription()); } buildSchemaFromDefinitions(queryBuilder, mutationBuilder); }
GraphQlSchemaBuilderImpl implements GraphQlSchemaBuilder { @PostConstruct public void postConstruct() { GraphQLObjectType.Builder queryBuilder = newObject().name(properties.getRootQueryName()); GraphQLObjectType.Builder mutationBuilder = newObject().name(properties.getRootMutationName()); if (StringUtils.hasText(properties.getRootQueryDescription())) { queryBuilder = queryBuilder.description(properties.getRootQueryDescription()); } if (StringUtils.hasText(properties.getRootMutationDescription())) { mutationBuilder = mutationBuilder.description(properties.getRootMutationDescription()); } buildSchemaFromDefinitions(queryBuilder, mutationBuilder); } }
GraphQlSchemaBuilderImpl implements GraphQlSchemaBuilder { @PostConstruct public void postConstruct() { GraphQLObjectType.Builder queryBuilder = newObject().name(properties.getRootQueryName()); GraphQLObjectType.Builder mutationBuilder = newObject().name(properties.getRootMutationName()); if (StringUtils.hasText(properties.getRootQueryDescription())) { queryBuilder = queryBuilder.description(properties.getRootQueryDescription()); } if (StringUtils.hasText(properties.getRootMutationDescription())) { mutationBuilder = mutationBuilder.description(properties.getRootMutationDescription()); } buildSchemaFromDefinitions(queryBuilder, mutationBuilder); } @Autowired  GraphQlSchemaBuilderImpl(GraphQlProperties properties, List<GraphQlFields> graphQlFieldsDefinitions); }
GraphQlSchemaBuilderImpl implements GraphQlSchemaBuilder { @PostConstruct public void postConstruct() { GraphQLObjectType.Builder queryBuilder = newObject().name(properties.getRootQueryName()); GraphQLObjectType.Builder mutationBuilder = newObject().name(properties.getRootMutationName()); if (StringUtils.hasText(properties.getRootQueryDescription())) { queryBuilder = queryBuilder.description(properties.getRootQueryDescription()); } if (StringUtils.hasText(properties.getRootMutationDescription())) { mutationBuilder = mutationBuilder.description(properties.getRootMutationDescription()); } buildSchemaFromDefinitions(queryBuilder, mutationBuilder); } @Autowired  GraphQlSchemaBuilderImpl(GraphQlProperties properties, List<GraphQlFields> graphQlFieldsDefinitions); @PostConstruct void postConstruct(); }
GraphQlSchemaBuilderImpl implements GraphQlSchemaBuilder { @PostConstruct public void postConstruct() { GraphQLObjectType.Builder queryBuilder = newObject().name(properties.getRootQueryName()); GraphQLObjectType.Builder mutationBuilder = newObject().name(properties.getRootMutationName()); if (StringUtils.hasText(properties.getRootQueryDescription())) { queryBuilder = queryBuilder.description(properties.getRootQueryDescription()); } if (StringUtils.hasText(properties.getRootMutationDescription())) { mutationBuilder = mutationBuilder.description(properties.getRootMutationDescription()); } buildSchemaFromDefinitions(queryBuilder, mutationBuilder); } @Autowired  GraphQlSchemaBuilderImpl(GraphQlProperties properties, List<GraphQlFields> graphQlFieldsDefinitions); @PostConstruct void postConstruct();  }