File tree 1 file changed +12
-2
lines changed
packages/gatsby/src/schema
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -494,8 +494,13 @@ const addCustomResolveFunctions = async ({ schemaComposer, parentSpan }) => {
494
494
const originalFieldConfig = tc . getFieldConfig ( fieldName )
495
495
const originalTypeName = originalFieldConfig . type . toString ( )
496
496
const originalResolver = originalFieldConfig . resolve
497
- const fieldTypeName =
498
- fieldConfig . type && fieldConfig . type . toString ( )
497
+ let fieldTypeName
498
+ if ( fieldConfig . type ) {
499
+ fieldTypeName = Array . isArray ( fieldConfig . type )
500
+ ? stringifyArray ( fieldConfig . type )
501
+ : fieldConfig . type . toString ( )
502
+ }
503
+
499
504
if (
500
505
! fieldTypeName ||
501
506
fieldTypeName . replace ( / ! / g, `` ) ===
@@ -743,6 +748,11 @@ const reportParsingError = error => {
743
748
}
744
749
}
745
750
751
+ const stringifyArray = arr =>
752
+ `[${ arr . map ( item =>
753
+ Array . isArray ( item ) ? stringifyArray ( item ) : item . toString ( )
754
+ ) } ]`
755
+
746
756
// TODO: Import this directly from graphql-compose once we update to v7
747
757
const isNamedTypeComposer = type =>
748
758
type instanceof ObjectTypeComposer ||
You can’t perform that action at this time.
0 commit comments