Umm, how do I go about seeding my DB? I thought th...
# orm-help
s
Umm, how do I go about seeding my DB? I thought that having a
seed.graphql
file with multiple mutations listed, would do it.. but I get an error:
ERROR: Must provide operation name if query contains multiple operations
s
Ah cheers @nilan, what does
prisma seed --reset
actually do?
n
check
prisma help seed
🙂
s
Yeah, that just says:
-r, --reset    Reset the service before seeding
Reset how? Full data wipe?
n
yes. What else came to your mind?
s
Ah, it just doesn’t make it very clear that it wipes all data
n
well, seeding typically is used in the context of development/CI
what alternative wording do you suggest for the description of
--reset
?
s
--hard-reset
?
Maybe makes it a little more “impactful”?
Is there a way to stop it from seeding the DB in `prod/staging`… when it’s configured to do it in
dev/test
n
how is it configured to do that?
s
Copy code
Seeds are implicitly executed when deploying a service for the first time (unless explicitly disabled using the --no-seed flag).
I guess I can change it in my CI/CD to add that flag
👍 1
@nilan It says that seed can also use a
*.js
file, are there any examples of how you’d go about doing it that way?
s
Ah thanks @nilan I got it all working, other than the bug that everyone else seems to be dealing with: https://www.prisma.io/forum/clicks/track?url=https%3A%2F%2Fgithub.com%2Fprismagraphql%2Fprisma%2Fpull%2F2569&post_id=9281&topic_id=3615
👍 1