@@ -59,7 +59,7 @@ export async function getDefinitionQueryResultForNamedType(
59
59
) ;
60
60
61
61
if ( defNodes . length === 0 ) {
62
- throw Error ( `Definition not found for GraphQL type ${ name } ` ) ;
62
+ throw new Error ( `Definition not found for GraphQL type ${ name } ` ) ;
63
63
}
64
64
const definitions : Array < Definition > = defNodes . map (
65
65
( { filePath, content, definition } ) =>
@@ -82,7 +82,7 @@ export async function getDefinitionQueryResultForField(
82
82
) ;
83
83
84
84
if ( defNodes . length === 0 ) {
85
- throw Error ( `Definition not found for GraphQL type ${ typeName } ` ) ;
85
+ throw new Error ( `Definition not found for GraphQL type ${ typeName } ` ) ;
86
86
}
87
87
88
88
const definitions : Array < Definition > = [ ] ;
@@ -119,7 +119,7 @@ export async function getDefinitionQueryResultForFragmentSpread(
119
119
) ;
120
120
121
121
if ( defNodes . length === 0 ) {
122
- throw Error ( `Definition not found for GraphQL fragment ${ name } ` ) ;
122
+ throw new Error ( `Definition not found for GraphQL fragment ${ name } ` ) ;
123
123
}
124
124
const definitions : Array < Definition > = defNodes . map (
125
125
( { filePath, content, definition } ) =>
@@ -150,7 +150,7 @@ function getDefinitionForFragmentDefinition(
150
150
) : Definition {
151
151
const name = definition . name ;
152
152
if ( ! name ) {
153
- throw Error ( 'Expected ASTNode to have a Name.' ) ;
153
+ throw new Error ( 'Expected ASTNode to have a Name.' ) ;
154
154
}
155
155
156
156
return {
0 commit comments