I have completed the tutorial and started working on extending the blog bit by adding a users table and using bcrypt for hashing passwords and jwt for tokens. I successfully created the table and added it to the migrations. But when I tried generating the sdl file it fails.
I typed: yarn rw g sdl users
The output is:
⠴ Generating SDL files…
Generating SDL files…
Generating service files…
It just hangs there and does nothing.
Could I manually create the sdl and service files and still have them work as a work around?
Hmm, does a users.sdl.js or users.js service already exist? You should see a message if they do. And you can --force to overwrite them. If that’s not the problem then something else is going on…
Yes you can create everything manually if you want, the generators are just a helper to save you from so much boilerplate typing!
And you definitely named your table users plural and not user? Again, there should be an error message, but we’re moving pretty fast and breaking things all the time, so you never know.
You don’t need the actual table to exist in the database, but you do need it defined in the schema (the SDL generator reads and parses the schema file to create everything).
Could you try making Users singular User and see if the SDL generator works? Prisma recently changed some of their pluralization/singularization logic and it’s possible our generator was relying on some old behavior.
If that doesn’t help, is it possible to put your codebase up on Github so we can take a look?