Main .prisma file location with new prismaSchemaFolder feature (+ Bazel)
I'm applying some changes by splitting the main file into smaller pieces, thanks to this new cool feature. Anyway, as we are using BAZEL and a custom generator, I need to tell BAZEL build rules file where to locate the file which has all the models, and If I keep It like It was just aiming to the schema.prisma file, It will log several errors not finding the models: (As It is taking the schema.prisma raw directly from the folder). I can't seem to find the location (If that's how It works) where a single schema.prisma file is located having all the .prisma files of /schema folder. For now I managed to make it work concatenating all files through a script but I think there should be another way
Sample of error If using the main schema.prisma:
It's currently working with this bazel genrule, but It seems hard-coded as I think there might be a single file already created by prisma where all the .prisma files are combined (?)
Solution:Jump to solution
Solved - Importing all files on schema folder in BUILD.bazel instead of just the schema.prisma, and then change command to
generate --schema schema
folder, worked just fine. No need to make bazel create a single file, prisma manages the folder correctly.1 Reply
Solution
Solved - Importing all files on schema folder in BUILD.bazel instead of just the schema.prisma, and then change command to
generate --schema schema
folder, worked just fine. No need to make bazel create a single file, prisma manages the folder correctly.