Skip to content

Commit 2e3cb6f

Browse files
committed
Catch schema type registry merge exceptions and report as schema errors (#164)
1 parent a52e48c commit 2e3cb6f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/com/intellij/lang/jsgraphql/schema/SchemaIDLTypeDefinitionRegistry.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,12 @@ public TypeDefinitionRegistryWithErrors getRegistryWithErrors(PsiElement scopedE
223223
// Types defined using GraphQL Endpoint Language
224224
if(graphQLEndpointNamedTypeRegistry.hasEndpointEntryFile()) {
225225
final TypeDefinitionRegistryWithErrors endpointTypesAsRegistry = graphQLEndpointNamedTypeRegistry.getTypesAsRegistry();
226-
typeRegistry.merge(endpointTypesAsRegistry.getRegistry());
227-
errors.addAll(endpointTypesAsRegistry.getErrors());
226+
try {
227+
typeRegistry.merge(endpointTypesAsRegistry.getRegistry());
228+
errors.addAll(endpointTypesAsRegistry.getErrors());
229+
} catch (GraphQLException e) {
230+
errors.add(e);
231+
}
228232
}
229233

230234
return new TypeDefinitionRegistryWithErrors(typeRegistry, errors);

0 commit comments

Comments
 (0)