@Test public void noQueriesAndMutations_shouldGenerateGettingStartedGraphQlSchema() { graphQlSchemaBuilder = new GraphQlSchemaBuilderImpl(graphQlProperties, new ArrayList<>()); graphQlSchemaBuilder.postConstruct(); val schema = graphQlSchemaBuilder.getSchema(); assertThat(schema).isNotNull(); assertThat(schema.getQueryType().getName()).isEqualTo("gettingStartedQuery"); }
@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();  }