Diagram of implementation design of the way an API call flows through Godspeed framework, event source, workflows, workflows.
How can you add custom middleware to data sources and event sources without changing the plugin.
--> data sources, even sources, are global objects and can be accessed outside.
--> to apply a middleware on database level, go to your index.ts, where you initialize Godspeed,
all your data sources will be available here dot prisma, or then dot client. Now this will give you native Prisma client.
You can override the Prisma data source and this init client method in your event source,
Diagram of implementation design of the way an API call flows through Godspeed framework, event source, workflows, workflows.
How can you add custom middleware to data sources and event sources without changing the plugin.
--> data sources, even sources, are global objects and can be accessed outside.
--> to apply a middleware on database level, go to your index.ts, where you initialize Godspeed,
all your data sources will be available here dot prisma, or then dot client. Now this will give you native Prisma client.
You can override the Prisma data source and this init client method in your event source,