Lib vs services (Redwood file structure)

Yeah, understood about the confusion. But Lib really isn’t much of a thing (yet). The reason for db.js is due to future plans to add a Redwood wrapper-type-implementation to the Prisma Client so we can do things like handle workarounds for Prisma Relations. This hasn’t been implemented yet, but there were also increasing questions about “what exactly is this db thing in my Services?” – it wasn’t clear it was the Prisma Client because it was hidden in the API package.

The common theme between the existing db and auth .js files are that they are consumed by Services but are not specifically “application/business logic” themselves. E.g. they’re not queries or mutations.

1 Like