Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 87eb576

Browse files
committed
Added ability to auto-detect and enable GraphQLResponseCache if implementation is provided.
1 parent 9712d3d commit 87eb576

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ subprojects {
3636
group "$PROJECT_GROUP"
3737

3838
repositories {
39-
// mavenLocal()
39+
mavenLocal()
4040
mavenCentral()
4141
jcenter()
4242
maven { url "https://dl.bintray.com/graphql-java-kickstart/releases" }

graphql-kickstart-spring-boot-autoconfigure-tools/src/main/java/graphql/kickstart/tools/boot/GraphQLJavaToolsAutoConfiguration.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import graphql.kickstart.tools.PerFieldObjectMapperProvider;
1111
import graphql.kickstart.tools.SchemaParser;
1212
import graphql.kickstart.tools.SchemaParserBuilder;
13-
import graphql.kickstart.tools.SchemaParserDictionary;
1413
import graphql.kickstart.tools.SchemaParserOptions;
1514
import graphql.kickstart.tools.SchemaParserOptions.GenericWrapper;
1615
import graphql.kickstart.tools.TypeDefinitionFactory;
@@ -46,7 +45,7 @@
4645
public class GraphQLJavaToolsAutoConfiguration {
4746

4847
@Autowired(required = false)
49-
private SchemaParserDictionary dictionary;
48+
private SchemaParserBuilder schemaParserBuilder;
5049

5150
@Autowired(required = false)
5251
private GraphQLScalarType[] scalars;
@@ -123,7 +122,7 @@ public SchemaParser schemaParser(
123122
SchemaStringProvider schemaStringProvider,
124123
SchemaParserOptions.Builder optionsBuilder
125124
) throws IOException {
126-
SchemaParserBuilder builder = dictionary != null ? new SchemaParserBuilder(dictionary) : new SchemaParserBuilder();
125+
SchemaParserBuilder builder = schemaParserBuilder != null ? schemaParserBuilder : new SchemaParserBuilder();
127126

128127
List<String> schemaStrings = schemaStringProvider.schemaStrings();
129128
schemaStrings.forEach(builder::schemaString);

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/spring/web/boot/GraphQLWebAutoConfiguration.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import graphql.kickstart.servlet.AbstractGraphQLHttpServlet;
3939
import graphql.kickstart.servlet.GraphQLConfiguration;
4040
import graphql.kickstart.servlet.GraphQLHttpServlet;
41+
import graphql.kickstart.servlet.cache.GraphQLResponseCache;
4142
import graphql.kickstart.servlet.config.DefaultGraphQLSchemaServletProvider;
4243
import graphql.kickstart.servlet.config.GraphQLSchemaServletProvider;
4344
import graphql.kickstart.servlet.context.GraphQLServletContextBuilder;
@@ -130,6 +131,9 @@ public class GraphQLWebAutoConfiguration {
130131
@Autowired(required = false)
131132
private BatchInputPreProcessor batchInputPreProcessor;
132133

134+
@Autowired(required = false)
135+
private GraphQLResponseCache graphQLResponseCache;
136+
133137
@PostConstruct
134138
void postConstruct() {
135139
if (errorHandler != null) {
@@ -287,6 +291,7 @@ public GraphQLConfiguration graphQLServletConfiguration(GraphQLInvocationInputFa
287291
.with(graphQLServletProperties.getSubscriptionTimeout())
288292
.with(batchInputPreProcessor)
289293
.with(graphQLServletProperties.getContextSetting())
294+
.with(graphQLResponseCache)
290295
.build();
291296
}
292297

0 commit comments

Comments
 (0)