From 74d05967bf18ad3bb70703d142506a528630917b Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Tue, 2 Jul 2019 23:18:51 -0700 Subject: [PATCH] Strip all extraneous type import characters (#2090) --- packages/plugins/other/visitor-plugin-common/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugins/other/visitor-plugin-common/src/utils.ts b/packages/plugins/other/visitor-plugin-common/src/utils.ts index 28fabf09f0e..e7277913275 100644 --- a/packages/plugins/other/visitor-plugin-common/src/utils.ts +++ b/packages/plugins/other/visitor-plugin-common/src/utils.ts @@ -269,7 +269,7 @@ export function getRootTypeNames(schema: GraphQLSchema): string[] { } export function stripMapperTypeInterpolation(identifier: string): string { - return identifier.includes('{T}') ? identifier.replace(/<.*?>/g, '') : identifier; + return identifier.trim().replace(/[^$\w].*$/, ''); } export const OMIT_TYPE = 'export type Omit = Pick>;';