Skip to content

Commit a415c6b

Browse files
authored
Fix missing entity types for type reference resolution (#520)
1 parent 40cb4e4 commit a415c6b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

schema/src/main/java/com/introproventures/graphql/jpa/query/schema/impl/GraphQLJpaSchemaBuilder.java

+8
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
import java.util.concurrent.ConcurrentHashMap;
8383
import java.util.concurrent.atomic.AtomicInteger;
8484
import java.util.function.Function;
85+
import java.util.function.Predicate;
8586
import java.util.function.Supplier;
8687
import java.util.stream.Collectors;
8788
import java.util.stream.Stream;
@@ -184,6 +185,13 @@ public GraphQLSchema build() {
184185

185186
GraphQLSchema.Builder schema = GraphQLSchema.newSchema().query(getQueryType());
186187

188+
entityManager
189+
.getMetamodel()
190+
.getEntities()
191+
.stream()
192+
.filter(Predicate.not(entityCache::containsKey))
193+
.forEach(entity -> schema.additionalType(getEntityObjectType(entity)));
194+
187195
if (enableSubscription) {
188196
schema.subscription(getSubscriptionType());
189197
}

0 commit comments

Comments
 (0)