[go: nahoru, domu]

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

'output' field in generator deletes all data in folder without warning #251

Open
john-h-k opened this issue Feb 15, 2022 · 3 comments
Open
Labels
question Further information is requested

Comments

@john-h-k
Copy link

Describe the Bug

To Reproduce

  1. Have an incorrect output path in the schema
generator typegraphql {
  provider = "typegraphql-prisma"
  output = "../../blah" // Incorrect
}
  1. Run npx prisma generate
  2. Output folder contents are entirely deleted, even when folder is not JS/TS/node_modules

Expected Behavior
A warning at least would be nice. Probably should only be so buccaneer about deleting its own files, or at least provide an option to make it so

Environment (please complete the following information):

  • OS: Mac OS Monterey
  • Node 16.13.1
  • typegraphql-prisma 0.18.5
  • Prisma version 3.9.2
  • TypeScript version 4.6.1
@MichalLytek
Copy link
Owner

It has to delete the old files, otherwise you would stay with some orphaned resolvers or inputs after any schema change.

@MichalLytek MichalLytek added the question Further information is requested label Feb 15, 2022
@john-h-k
Copy link
Author

It has to delete the old files, otherwise you would stay with some orphaned resolvers or inputs after any schema change.

Still, it is very trivial to notice that the output folder contains files not generated by the package

@MichalLytek
Copy link
Owner

Go ahead and create a PR with that feature 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants