Skip to content

Commit 910a391

Browse files
michaekKyleAMathews
authored andcommitted
Added createTypeName to ensure unique name for union types. (#4925)
Signed-off-by: Michael Hellein <[email protected]>
1 parent 5eae501 commit 910a391

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ function inferFromFieldName(value, selector, types): GraphQLFieldConfig<*, *> {
248248
// If there's more than one type, we'll create a union type.
249249
if (fields.length > 1) {
250250
type = new GraphQLUnionType({
251-
name: `Union_${key}_${fields
251+
name: createTypeName(`Union_${key}_${fields
252252
.map(f => f.name)
253253
.sort()
254-
.join(`__`)}`,
254+
.join(`__`)}`),
255255
description: `Union interface for the field "${key}" for types [${fields
256256
.map(f => f.name)
257257
.sort()

0 commit comments

Comments
 (0)