@@ -59,7 +59,7 @@ export async function getDefinitionQueryResultForNamedType(
5959 ) ;
6060
6161 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 } ` ) ;
6363 }
6464 const definitions : Array < Definition > = defNodes . map (
6565 ( { filePath, content, definition } ) =>
@@ -82,7 +82,7 @@ export async function getDefinitionQueryResultForField(
8282 ) ;
8383
8484 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 } ` ) ;
8686 }
8787
8888 const definitions : Array < Definition > = [ ] ;
@@ -119,7 +119,7 @@ export async function getDefinitionQueryResultForFragmentSpread(
119119 ) ;
120120
121121 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 } ` ) ;
123123 }
124124 const definitions : Array < Definition > = defNodes . map (
125125 ( { filePath, content, definition } ) =>
@@ -150,7 +150,7 @@ function getDefinitionForFragmentDefinition(
150150) : Definition {
151151 const name = definition . name ;
152152 if ( ! name ) {
153- throw Error ( 'Expected ASTNode to have a Name.' ) ;
153+ throw new Error ( 'Expected ASTNode to have a Name.' ) ;
154154 }
155155
156156 return {
0 commit comments