Skip to content

Commit

Permalink
Added createTypeName to ensure unique name for union types.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaek committed Apr 10, 2018
1 parent e5d6656 commit ba69310
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/gatsby/src/schema/infer-graphql-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function inferFromFieldName(value, selector, types): GraphQLFieldConfig<*, *> {
// If there's more than one type, we'll create a union type.
if (fields.length > 1) {
type = new GraphQLUnionType({
name: `Union_${key}_${fields.map(f => f.name).join(`__`)}`,
name: createTypeName(`Union_${key}_${fields.map(f => f.name).join(`__`)}`),
description: `Union interface for the field "${key}" for types [${fields
.map(f => f.name)
.join(`, `)}]`,
Expand Down

0 comments on commit ba69310

Please sign in to comment.