piglovesyou/graphql-let

[ graphql-let ] Error: never

marklawlor opened this issue · 1 comments

[ graphql-let ] Error: never
Error: never
    at Object.appendDocumentImportContext (/node_modules/graphql-let/dist/lib/do
cument-import.js:24:28)
    at gen (/node_mod
ules/graphql-let/dist/gen.js:71:23)
    at processTicksAndRejections (internal/process/task_que
ues.js:95:5)

This error is caused when an empty .graphql file is present on the filesystem, as fs.readFile returns an empty string.

I see two possible solutions here

  1. Throw an error and report the problem filepath
  2. Log a warning of the filepath and skip the file.

@marklawlor Thank you for making the issue! I didn't come up with the case. Error: never is a very unkind library runtime exception that I cannot come up with.

I think the 1. would be better since an empty GraphQL document isn't valid and graphql-let isn't something reporting warnings for invalid things. If you agree, I'll welcome a PR. > all