|
1 | 1 | package com.introproventures.graphql.jpa.query.autoconfigure;
|
2 | 2 |
|
| 3 | +import java.util.Arrays; |
| 4 | +import java.util.Collection; |
| 5 | +import java.util.List; |
| 6 | +import java.util.Map; |
| 7 | +import java.util.Objects; |
| 8 | +import java.util.Optional; |
| 9 | +import java.util.Set; |
| 10 | +import java.util.concurrent.ConcurrentHashMap; |
| 11 | +import java.util.function.Function; |
| 12 | +import java.util.function.Predicate; |
| 13 | +import java.util.stream.Collectors; |
| 14 | +import java.util.stream.Stream; |
3 | 15 | import graphql.Internal;
|
4 | 16 | import graphql.schema.DataFetcher;
|
5 | 17 | import graphql.schema.FieldCoordinates;
|
|
20 | 32 | import graphql.util.TraversalControl;
|
21 | 33 | import graphql.util.TraverserContext;
|
22 | 34 | import org.springframework.beans.factory.config.AbstractFactoryBean;
|
23 |
| - |
24 |
| -import java.util.Arrays; |
25 |
| -import java.util.Collection; |
26 |
| -import java.util.List; |
27 |
| -import java.util.Map; |
28 |
| -import java.util.Objects; |
29 |
| -import java.util.Optional; |
30 |
| -import java.util.Set; |
31 |
| -import java.util.concurrent.ConcurrentHashMap; |
32 |
| -import java.util.function.Function; |
33 |
| -import java.util.function.Predicate; |
34 |
| -import java.util.stream.Collectors; |
35 |
| -import java.util.stream.Stream; |
| 35 | +import org.springframework.util.Assert; |
36 | 36 |
|
37 | 37 | import static graphql.Assert.assertTrue;
|
38 | 38 | import static graphql.schema.FieldCoordinates.coordinates;
|
@@ -62,12 +62,14 @@ public class GraphQLSchemaFactoryBean extends AbstractFactoryBean<GraphQLSchema>
|
62 | 62 |
|
63 | 63 |
|
64 | 64 | public GraphQLSchemaFactoryBean(GraphQLSchema[] managedGraphQLSchemas) {
|
| 65 | + Assert.notEmpty(managedGraphQLSchemas, "Managed GraphQLSchema registrations can't be empty."); |
| 66 | + |
65 | 67 | this.managedGraphQLSchemas = managedGraphQLSchemas;
|
66 | 68 | }
|
67 | 69 |
|
68 | 70 | @Override
|
69 |
| - protected GraphQLSchema createInstance() throws Exception { |
70 |
| - |
| 71 | + protected GraphQLSchema createInstance() { |
| 72 | + |
71 | 73 | GraphQLSchema.Builder schemaBuilder = GraphQLSchema.newSchema();
|
72 | 74 | GraphQLCodeRegistry.Builder codeRegistryBuilder = GraphQLCodeRegistry.newCodeRegistry();
|
73 | 75 | TypeTraverser typeTraverser = new TypeTraverser();
|
|
0 commit comments