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
Describe the bug
Seed logic doesn't belong to any endpoint. In a serverless approach, seeding should hapeen in a "predev" or "prestart" script that is run globally at application startup .
To Reproduce
On a fresh, empty database, try running /api/loginbefore /api/graphql => admin user won't be seeded. This is because the seed happens only in /api/graphql.
Expected behavior
Seeding should happen before "yarn dev", not inside API routes.
To fix:
move seed code outside of "/api/graphql", into it's own independent script, in a "scripts" folder
setup an environment that stills allows to use TS in this script (eg running the script with node-ts or whatever)
run this script on "predev" in package.json (and maybe "prestart" for prod? we don't seed yet in production)
The text was updated successfully, but these errors were encountered:
In progress, thanks to the new ability to build TypeScript files as independant scripts. We already have introduced db:seed and db:reset. We could document them as scripts to run after app creation.
Describe the bug
Seed logic doesn't belong to any endpoint. In a serverless approach, seeding should hapeen in a "predev" or "prestart" script that is run globally at application startup .
To Reproduce
On a fresh, empty database, try running
/api/login
before /api/graphql => admin user won't be seeded. This is because the seed happens only in/api/graphql
.Expected behavior
Seeding should happen before "yarn dev", not inside API routes.
To fix:
The text was updated successfully, but these errors were encountered: