File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
packages/gatsby/src/schema Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1041,7 +1041,7 @@ const addInferredChildOfExtension = ({ schemaComposer, typeComposer }) => {
10411041 const many = maxChildCount > 1
10421042
10431043 // Add `@childOf` extension automatically unless it is already set for this type
1044- if ( ! childOfExtension ?. types . includes ( parentTypeName ) ) {
1044+ if ( ! childOfExtension ?. types ? .includes ( parentTypeName ) ) {
10451045 // Adding children fields to types with the `@dontInfer` extension is deprecated
10461046 // Only warn when the parent-child relation has not been explicitly set with
10471047 if ( shouldInfer === false ) {
@@ -1062,7 +1062,7 @@ const addInferredChildOfExtension = ({ schemaComposer, typeComposer }) => {
10621062 // This will cause convenience children fields like `childImageSharp`
10631063 // to be added in `addConvenienceChildrenFields` method.
10641064 // Also required for proper printing of the `@childOf` directive in the snapshot plugin
1065- if ( ! childOfExtension ) {
1065+ if ( ! childOfExtension ?. types ) {
10661066 // FIXME: `many` is applied to all parent types equally which seems wrong?
10671067 childOfExtension = { types : [ ] }
10681068 if ( many ) {
You can’t perform that action at this time.
0 commit comments