From 68f49383671d546365f29cce541ab1681955c6db Mon Sep 17 00:00:00 2001 From: rstoyanchev Date: Mon, 17 Jan 2022 20:49:59 +0000 Subject: [PATCH] Update GraphQL QBE auto-config This change is the same as 68806bfef851e28accc99fe839ae4c1651b242cc for Querydsl, but applied also to the Query By Example auto config. Closes gh-29445 --- .../data/GraphQlQueryByExampleAutoConfiguration.java | 9 ++++----- .../GraphQlReactiveQueryByExampleAutoConfiguration.java | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/data/GraphQlQueryByExampleAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/data/GraphQlQueryByExampleAutoConfiguration.java index 504d4bf024..b39727f874 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/data/GraphQlQueryByExampleAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/data/GraphQlQueryByExampleAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package org.springframework.boot.autoconfigure.graphql.data; -import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -44,7 +43,7 @@ import org.springframework.graphql.execution.GraphQlSource; * * @author Rossen Stoyanchev * @since 2.7.0 - * @see QueryByExampleDataFetcher#autoRegistrationTypeVisitor(List, List) + * @see QueryByExampleDataFetcher#autoRegistrationConfigurer(List, List) */ @Configuration(proxyBeanMethods = false) @ConditionalOnClass({ GraphQL.class, QueryByExampleDataFetcher.class, QueryByExampleExecutor.class }) @@ -62,8 +61,8 @@ public class GraphQlQueryByExampleAutoConfiguration { List> reactiveExecutors = reactiveExecutorsProvider.stream() .collect(Collectors.toList()); if (!executors.isEmpty()) { - builder.typeVisitors(Collections.singletonList( - QueryByExampleDataFetcher.autoRegistrationTypeVisitor(executors, reactiveExecutors))); + builder.configureRuntimeWiring( + QueryByExampleDataFetcher.autoRegistrationConfigurer(executors, reactiveExecutors)); } }; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/data/GraphQlReactiveQueryByExampleAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/data/GraphQlReactiveQueryByExampleAutoConfiguration.java index e36ec5ba03..6c8c730b4a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/data/GraphQlReactiveQueryByExampleAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/graphql/data/GraphQlReactiveQueryByExampleAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ import org.springframework.graphql.execution.GraphQlSource; * * @author Rossen Stoyanchev * @since 2.7.0 - * @see QueryByExampleDataFetcher#autoRegistrationTypeVisitor(List, List) + * @see QueryByExampleDataFetcher#autoRegistrationConfigurer(List, List) */ @Configuration(proxyBeanMethods = false) @ConditionalOnClass({ GraphQL.class, QueryByExampleDataFetcher.class, ReactiveQueryByExampleExecutor.class }) @@ -58,8 +58,8 @@ public class GraphQlReactiveQueryByExampleAutoConfiguration { return (builder) -> { List> executors = executorsProvider.stream().collect(Collectors.toList()); if (!executors.isEmpty()) { - builder.typeVisitors(Collections.singletonList( - QueryByExampleDataFetcher.autoRegistrationTypeVisitor(Collections.emptyList(), executors))); + builder.configureRuntimeWiring( + QueryByExampleDataFetcher.autoRegistrationConfigurer(Collections.emptyList(), executors)); } }; }