You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use a .ts file for loading the schema I found it was very difficult to see why it was not working.
Initially this was because I didn't add ts-node to the require array. But the error just showed me that the glob wasn't matching any files, which was confusing.
Before knowing I needed the require, I tried changing the file to export a function, instead of the schema directly.
When I then did add the require of ts-node, it still showed me the same "glob not matching" error.
I think it would help to show a warning or error when a file is found that doesn't export the schema in the right way.
The text was updated successfully, but these errors were encountered:
koenpunt
changed the title
Enhancement: Warn when SchemaFromExport finds a matching file, but doesn't export the right things
Enhancement: Warn when SchemaFromExport finds a matching file, but doesn't export the schema in the right way.
Apr 9, 2019
There isn't really a faulty repo. I experienced the behavior through graphql-code-generator, and while stepping through the code to figure out why my files were not being loaded, I noticed that it was actually finding my ts file, but then skipped it because it wasn't exporting the schema correctly.
I've created a PR with where I think a warning should be triggered; #87
Please see me comment on your PR.
I need to understand the context of what you are trying to achieve and how do you expect it to behave.
An repro would help alot to let me understand what's you issue.
When trying to use a
.ts
file for loading the schema I found it was very difficult to see why it was not working.Initially this was because I didn't add
ts-node
to therequire
array. But the error just showed me that the glob wasn't matching any files, which was confusing.Before knowing I needed the require, I tried changing the file to export a function, instead of the schema directly.
When I then did add the require of
ts-node
, it still showed me the same "glob not matching" error.I think it would help to show a warning or error when a file is found that doesn't export the schema in the right way.
The text was updated successfully, but these errors were encountered: