Skip to content

Commit ba69310

Browse files
committed
Added createTypeName to ensure unique name for union types.
1 parent e5d6656 commit ba69310

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/gatsby/src/schema/infer-graphql-type.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ function inferFromFieldName(value, selector, types): GraphQLFieldConfig<*, *> {
290290
// If there's more than one type, we'll create a union type.
291291
if (fields.length > 1) {
292292
type = new GraphQLUnionType({
293-
name: `Union_${key}_${fields.map(f => f.name).join(`__`)}`,
293+
name: createTypeName(`Union_${key}_${fields.map(f => f.name).join(`__`)}`),
294294
description: `Union interface for the field "${key}" for types [${fields
295295
.map(f => f.name)
296296
.join(`, `)}]`,

0 commit comments

Comments
 (0)