Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function buildPrismaSchema(options: PrismaSchemaConfig) {
const { schema, metadata } = makeSchemaWithMetadata(
options,
PrismaSchemaBuilder,
)
// Only in development envs do we want to worry about regenerating the
// schema definition and/or generated types.
const {
shouldGenerateArtifacts = process.env.NODE_ENV !== "production",
} = options;
if (shouldGenerateArtifacts) {
// Generating in the next tick allows us to use the schema
// in the optional thunk for the typegen config
metadata.generateArtifacts(schema);
}