File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/main/java/com/intuit/graphql/orchestrator/utils Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -197,12 +197,14 @@ public GraphQLSchemaElement caseObjectTypeDefinition(final ObjectTypeDefinition
197197
198198 GraphQLType graphQLType = graphQLObjectTypes .get (me );
199199 if (Objects .nonNull (graphQLType )) {
200- int cachedFieldSize = ((GraphQLObjectType ) graphQLType ).getFieldDefinitions ().size ();
201- int incomingFieldSize = object .getFieldDefinition ().size ();
202- //No need to check types with same field size and with different fields b/c it would conflict earlier on and would fail to stitch
203- if (cachedFieldSize != incomingFieldSize && !typesWithInaccessibleFields .contains (me )) {
204- String conflictingNamespace = (cachedFieldSize > incomingFieldSize ) ? ((GraphQLObjectType ) graphQLType ).getDescription () : object .getDesc ();
205- throw new StitchingException (String .format (ERRMSG_REUSED_CONFLICTING_TYPE , conflictingNamespace , me ));
200+ if (graphQLType instanceof GraphQLObjectType ) {
201+ int cachedFieldSize = ((GraphQLObjectType ) graphQLType ).getFieldDefinitions ().size ();
202+ int incomingFieldSize = object .getFieldDefinition ().size ();
203+ //No need to check types with same field size and with different fields b/c it would conflict earlier on and would fail to stitch
204+ if (cachedFieldSize != incomingFieldSize && !typesWithInaccessibleFields .contains (me )) {
205+ String conflictingNamespace = (cachedFieldSize > incomingFieldSize ) ? ((GraphQLObjectType ) graphQLType ).getDescription () : object .getDesc ();
206+ throw new StitchingException (String .format (ERRMSG_REUSED_CONFLICTING_TYPE , conflictingNamespace , me ));
207+ }
206208 }
207209 return graphQLType ;
208210 }
You can’t perform that action at this time.
0 commit comments