Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Warn when SchemaFromExport finds a matching file, but doesn't export the schema in the right way. #83

Closed
koenpunt opened this issue Apr 9, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@koenpunt
Copy link
Contributor

koenpunt commented Apr 9, 2019

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.

@koenpunt 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
@ardatan ardatan added the enhancement New feature or request label Apr 19, 2019
@darkbasic
Copy link
Collaborator

Can you please upload the faulty repo along with the glob pattern you're using?

@darkbasic
Copy link
Collaborator

Btw, are you using 0.2.9 right?

@koenpunt
Copy link
Contributor Author

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

@darkbasic
Copy link
Collaborator

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.

@ardatan ardatan closed this as completed Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants