Skip to content

Commit

Permalink
fix(): add more descriptive message when no type defs found
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Jun 23, 2020
1 parent 24dbec5 commit f5dd302
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/graphql-types.loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export class GraphQLTypesLoader {
const filePaths = await glob(paths, {
ignore: ['node_modules'],
});
if (filePaths.length === 0) {
throw new Error(
`No type definitions were found with the specified file name patterns: "${paths}". Please make sure there is at least one file that matches the given patterns.`,
);
}
const fileContentsPromises = filePaths.sort().map((filePath) => {
return readFile(filePath.toString(), 'utf8');
});
Expand Down

0 comments on commit f5dd302

Please sign in to comment.