diff --git a/packages/gatsby/src/schema/infer-graphql-input-fields.js b/packages/gatsby/src/schema/infer-graphql-input-fields.js index 49c2205ed9b78..7e30516553c0a 100644 --- a/packages/gatsby/src/schema/infer-graphql-input-fields.js +++ b/packages/gatsby/src/schema/infer-graphql-input-fields.js @@ -227,7 +227,12 @@ export function inferInputObjectStructureFromNodes({ prefix = isRoot ? typeName : prefix if (exampleValue === null) { - exampleValue = getExampleValues({ nodes, typeName }) + // typeName includes "Connection" string, which is not what we want, + // so extract type from first node + exampleValue = getExampleValues({ + nodes, + typeName: nodes && nodes[0] && nodes[0].internal && nodes[0].internal.type, + }) } _.each(exampleValue, (v, k) => { diff --git a/packages/gatsby/src/schema/type-conflict-reporter.js b/packages/gatsby/src/schema/type-conflict-reporter.js index cc0c523cc158f..1259b6bf234b6 100644 --- a/packages/gatsby/src/schema/type-conflict-reporter.js +++ b/packages/gatsby/src/schema/type-conflict-reporter.js @@ -78,7 +78,7 @@ class TypeConflictEntry { printEntry() { const sortedByTypeName = _.sortBy( - this.types.entries(), + Array.from(this.types.entries()), ([typeName, value]) => typeName )