Closed razzeee closed 1 year ago
HI @razzeee I think I see what you are suggesting: since the plugin at its core takes the GraphQL request, processes it, enriches it, redacts it, constructs some payload and then sends it ... "somewhere" ... here being Inngest as an event, one could have a generic plugin that "does all that" and then has an abstract payload composer and "sender" to send to whatever third party service or destination one wants.
But, those plugins likely already exist and seem better off to be domain specific.
For example, see the "metrics" tag on the plugin hub here: https://the-guild.dev/graphql/envelop/plugins
There are existing plugins to send to Sentry, or New Relic, or Hive or to Open Telemetry ... all that do similar takes like this plugin does but constructs a purposeful payload in the structure it needs and to an endpoint and api to receive the info.
Here, we want this plugin to be specific to Inngest and provide a nice DX for it.
It seems like sending stuff off to ingest is only the very last thing that happens. So it would be cool to separate those concerns and have an envelop plungin, that allows to watch for events and execute something, that can be configured.
That would for example allow to use this with other workers like https://github.com/graphile/worker