Skip to content

Commit bd64f80

Browse files
authored
fix: only apply prefix once (#255)
Simple check that we do not add a configured prefix more than once, as was happening in certain situations
1 parent b62c628 commit bd64f80

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/gatsby-source-sanity/src/util/normalize.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ export function getTypeName(type: string, typePrefix: string | undefined) {
8282
return type
8383
}
8484

85+
if (typePrefix && type.startsWith(typePrefix)) {
86+
return type
87+
}
88+
8589
const typeName = startCase(type)
8690
if (scalarTypeNames.includes(typeName)) {
8791
return typeName

0 commit comments

Comments
 (0)